diff options
-rw-r--r-- | modules/KDE4Macros.cmake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake index 36b401f4..1d92101a 100644 --- a/modules/KDE4Macros.cmake +++ b/modules/KDE4Macros.cmake @@ -706,10 +706,21 @@ macro (KDE4_ADD_UNIT_TEST _test_NAME) set(_targetName ${_test_NAME}) if( ${ARGV1} STREQUAL "TESTNAME" ) set(_targetName ${ARGV2}) - LIST(REMOVE_AT _srcList 0 1) + list(REMOVE_AT _srcList 0 1) endif( ${ARGV1} STREQUAL "TESTNAME" ) kde4_add_test_executable( ${_test_NAME} ${_srcList} ) add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} ) + + # if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests + if (NOT KDE4_BUILD_TESTS) + get_directory_property(_buildtestsAdded BUILDTESTS_ADDED) + if(NOT _buildtestsAdded) + add_custom_target(buildtests) + set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE) + endif(NOT _buildtestsAdded) + add_dependencies(buildtests ${_test_NAME}) + endif (NOT KDE4_BUILD_TESTS) + endmacro (KDE4_ADD_UNIT_TEST) # add an test executable |