diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-08-05 01:55:47 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-08-05 01:55:47 +0000 |
commit | 7097cddbca41ee8b817a89191db5d39e89ce0b5a (patch) | |
tree | e415ad43d11bbb8282951fba4577f53f28d38fe2 | |
parent | 92f5a6c8cc0b20e322dc46cb4f2caef5b8345e77 (diff) | |
download | extra-cmake-modules-7097cddbca41ee8b817a89191db5d39e89ce0b5a.tar.gz extra-cmake-modules-7097cddbca41ee8b817a89191db5d39e89ce0b5a.tar.bz2 |
add a target "buildtests" which builds all tests in this and its subdirs
Alex
svn path=/trunk/KDE/kdelibs/; revision=696490
-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 |