From 9a90f932e51db486b166dd38f00e4186e40a1aee Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 11 Mar 2018 21:32:24 +0100 Subject: tests/CMakeLists.txt: Prohibit gschemas.compiled to be generated multiple times. Spotted by James Cowgill, see https://bugs.debian.org/892091. --- tests/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') 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) -- cgit v1.2.3