From 7097cddbca41ee8b817a89191db5d39e89ce0b5a Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 5 Aug 2007 01:55:47 +0000 Subject: add a target "buildtests" which builds all tests in this and its subdirs Alex svn path=/trunk/KDE/kdelibs/; revision=696490 --- modules/KDE4Macros.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1