diff options
author | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2006-03-09 19:41:21 (GMT) |
---|---|---|
committer | Mathieu Malaterre <mathieu.malaterre@gmail.com> | 2006-03-09 19:41:21 (GMT) |
commit | 81922f811aab896135b52838a829782e06630e23 (patch) | |
tree | 7fd4e15ddc5584e1d011179905ad68fd68e7bebb /Source | |
parent | 1defe94e31dcfdfb9a10c684ddf1b01761322bf2 (diff) | |
download | CMake-81922f811aab896135b52838a829782e06630e23.zip CMake-81922f811aab896135b52838a829782e06630e23.tar.gz CMake-81922f811aab896135b52838a829782e06630e23.tar.bz2 |
ENH: Carefully turn testing of DynamicLib on
Diffstat (limited to 'Source')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index a44c882..cc08056 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -426,11 +426,11 @@ ENDIF(KWSYS_USE_Glob) # Add selected C++ classes. SET(cppclasses Directory DynamicLoader Glob RegularExpression SystemTools CommandLineArguments Registry) -FOREACH(c ${cppclasses}) - IF(KWSYS_USE_${c}) - SET(KWSYS_CLASSES ${KWSYS_CLASSES} ${c}) - ENDIF(KWSYS_USE_${c}) -ENDFOREACH(c) +FOREACH(cpp ${cppclasses}) + IF(KWSYS_USE_${cpp}) + SET(KWSYS_CLASSES ${KWSYS_CLASSES} ${cpp}) + ENDIF(KWSYS_USE_${cpp}) +ENDFOREACH(cpp) # Add selected C components. FOREACH(c Process Base64 FundamentalType) @@ -513,6 +513,13 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS) ADD_LIBRARY(${KWSYS_NAMESPACE} ${KWSYS_LIBRARY_TYPE} ${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS}) + # If kwsys contains the DynamicLoader, need extra library + IF(KWSYS_USE_DynamicLoader) + IF(UNIX) + TARGET_LINK_LIBRARIES(${KWSYS_NAMESPACE} dl) + ENDIF(UNIX) + ENDIF(KWSYS_USE_DynamicLoader) + # Apply user-defined target properties to the library. IF(KWSYS_PROPERTIES_CXX) SET_TARGET_PROPERTIES(${KWSYS_NAMESPACE} PROPERTIES @@ -602,12 +609,18 @@ ENDIF(KWSYS_USE_Process) IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) IF(BUILD_TESTING) # C++ tests + IF(KWSYS_USE_DynamicLoader) + SET(EXTRA_TESTS + testDynamicLoader + ) + ENDIF(KWSYS_USE_DynamicLoader) FOREACH(test testSystemTools testIOS testHashSTL testCommandLineArguments testRegistry + ${EXTRA_TESTS} ) ADD_EXECUTABLE(${test} ${test}.cxx) TARGET_LINK_LIBRARIES(${test} ${KWSYS_NAMESPACE}) @@ -629,7 +642,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(TEST_SYSTEMTOOLS_BIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/testSystemTools.bin") - SET(TEST_SYSTEMTOOLS_SRC_FILE + SET(TEST_SYSTEMTOOLS_SRC_FILE "${CMAKE_CURRENT_SOURCE_DIR}/testSystemTools.cxx") CONFIGURE_FILE( ${PROJECT_SOURCE_DIR}/testSystemTools.h.in @@ -642,6 +655,9 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET_DIRECTORY_PROPERTIES(PROPERTIES TEST_INCLUDE_FILE "${CMAKE_CURRENT_BINARY_DIR}/ExtraTest.cmake") ENDIF(CTEST_TEST_KWSYS) ADD_TEST(kwsys.testSystemTools ${EXEC_DIR}/testSystemTools) + IF(KWSYS_USE_DynamicLoader) + ADD_TEST(kwsys.testDynamicLoader ${EXEC_DIR}/testDynamicLoader) + ENDIF(KWSYS_USE_DynamicLoader) ADD_TEST(kwsys.testProcess-1 ${EXEC_DIR}/testProcess 1) ADD_TEST(kwsys.testProcess-2 ${EXEC_DIR}/testProcess 2) ADD_TEST(kwsys.testProcess-3 ${EXEC_DIR}/testProcess 3) |