cmake: Avoid double generating of dcop/tests files.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 83d02c95a1)
r14.0.x
Slávek Banko 5 years ago
parent 70a4d2895b
commit 95e165a077
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -30,24 +30,12 @@ tde_add_check_executable( dcop_test AUTOMOC
DEPENDENCIES dcop_tests_generated DEPENDENCIES dcop_tests_generated
) )
set_property(
SOURCE test.cpp
APPEND PROPERTY
OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_skel.cpp
)
tde_add_check_executable( driver AUTOMOC tde_add_check_executable( driver AUTOMOC
SOURCES driver.cpp ${CMAKE_CURRENT_BINARY_DIR}/test.stub SOURCES driver.cpp ${CMAKE_CURRENT_BINARY_DIR}/test.stub
LINK tdecore-shared LINK tdecore-shared
DEPENDENCIES dcop_tests_generated DEPENDENCIES dcop_tests_generated
) )
set_property(
SOURCE driver.cpp
APPEND PROPERTY
OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test_stub.cpp
)
add_test( NAME "dcop/dcop-tests" add_test( NAME "dcop/dcop-tests"
COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/run-tests.sh" COMMAND sh -x "${CMAKE_CURRENT_SOURCE_DIR}/run-tests.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" )
@ -55,9 +43,14 @@ add_test( NAME "dcop/dcop-tests"
set_tests_properties( dcop/dcop-tests PROPERTIES TIMEOUT 30) set_tests_properties( dcop/dcop-tests PROPERTIES TIMEOUT 30)
##### test.h and files ########################## ##### generated files ###########################
add_custom_target( dcop_tests_generated DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/test.h ) add_custom_target( dcop_tests_generated
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/test.h
${CMAKE_CURRENT_BINARY_DIR}/test_skel.cpp
${CMAKE_CURRENT_BINARY_DIR}/test_stub.cpp
)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test.h ${CMAKE_CURRENT_BINARY_DIR}/shell.generated OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test.h ${CMAKE_CURRENT_BINARY_DIR}/shell.generated

Loading…
Cancel
Save