aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-11 21:32:24 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-12 18:33:03 +0100
commit9a90f932e51db486b166dd38f00e4186e40a1aee (patch)
tree9ca0d37ed6f6631019bc65543fa114dfb40bb436 /tests
parentbdfc18a9681d45b454b91bc8f7493c41400cd5bc (diff)
downloadayatana-indicator-power-9a90f932e51db486b166dd38f00e4186e40a1aee.tar.gz
ayatana-indicator-power-9a90f932e51db486b166dd38f00e4186e40a1aee.tar.bz2
ayatana-indicator-power-9a90f932e51db486b166dd38f00e4186e40a1aee.zip
tests/CMakeLists.txt: Prohibit gschemas.compiled to be generated multiple times.
Spotted by James Cowgill, see https://bugs.debian.org/892091.
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2c45057..dc2dcab 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -32,6 +32,10 @@ add_custom_command (OUTPUT gschemas.compiled
COMMAND cp -f ${CMAKE_BINARY_DIR}/data/*gschema.xml ${SCHEMA_DIR}
COMMAND ${COMPILE_SCHEMA_EXECUTABLE} ${SCHEMA_DIR})
+add_custom_target(
+ gschemas-compiled ALL DEPENDS gschemas.compiled
+)
+
# look for headers in our src dir, and also in the directories where we autogenerate files...
include_directories (${CMAKE_SOURCE_DIR}/src)
include_directories (${CMAKE_BINARY_DIR}/src)
@@ -42,9 +46,9 @@ include_directories (${CMAKE_CURRENT_BINARY_DIR})
function(add_test_by_name name)
set (TEST_NAME ${name})
- add_executable (${TEST_NAME} ${TEST_NAME}.cc gschemas.compiled)
+ add_executable (${TEST_NAME} ${TEST_NAME}.cc)
add_test (${TEST_NAME} ${TEST_NAME})
- add_dependencies (${TEST_NAME} ayatanaindicatorpowerservice)
+ add_dependencies (${TEST_NAME} ayatanaindicatorpowerservice gschemas-compiled)
target_link_libraries (${TEST_NAME} ayatanaindicatorpowerservice gtest ${DBUSTEST_LIBRARIES} ${SERVICE_DEPS_LIBRARIES} ${GTEST_LIBS})
endfunction()
add_test_by_name(test-notify)