diff options
author | Brad King <brad.king@kitware.com> | 2023-08-22 17:45:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-08-22 17:45:55 (GMT) |
commit | a856486167323085098ead7842becc844735aafc (patch) | |
tree | d2b847f051582b2714c905d863e7c8923f2584a5 /Source/kwsys/CMakeLists.txt | |
parent | b4a68240db27c0677c1d968aca7973767c70e814 (diff) | |
parent | c7b30fa8b3aae2e1ff0ff18867712e58588b1ab4 (diff) | |
download | CMake-a856486167323085098ead7842becc844735aafc.zip CMake-a856486167323085098ead7842becc844735aafc.tar.gz CMake-a856486167323085098ead7842becc844735aafc.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
KWSys 2023-08-22 (7f82ad45)
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 2b8eedd..2b7f2cc 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -634,7 +634,7 @@ set(cppclasses Directory DynamicLoader Encoding Glob RegularExpression SystemTools CommandLineArguments FStream SystemInformation ConsoleBuf Status ) -foreach(cpp ${cppclasses}) +foreach(cpp IN LISTS cppclasses) if(KWSYS_USE_${cpp}) # Use the corresponding class. set(KWSYS_CLASSES ${KWSYS_CLASSES} ${cpp}) @@ -647,7 +647,7 @@ foreach(cpp ${cppclasses}) endforeach() # Add selected C components. -foreach(c +foreach(c IN ITEMS Process Base64 Encoding MD5 Terminal System String ) if(KWSYS_USE_${c}) @@ -679,7 +679,7 @@ if(KWSYS_USE_Process) endif() # Add selected C sources. -foreach(c Base64 Encoding MD5 Terminal System String) +foreach(c IN ITEMS Base64 Encoding MD5 Terminal System String) if(KWSYS_USE_${c}) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${c}C.c) list(APPEND KWSYS_C_SRCS ${c}C.c) @@ -690,7 +690,7 @@ foreach(c Base64 Encoding MD5 Terminal System String) endforeach() # Configure headers of C++ classes and construct the list of sources. -foreach(c ${KWSYS_CLASSES}) +foreach(c IN LISTS KWSYS_CLASSES) # Add this source to the list of source files for the library. if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${c}CXX.cxx) list(APPEND KWSYS_CXX_SRCS ${c}CXX.cxx) @@ -712,7 +712,7 @@ foreach(c ${KWSYS_CLASSES}) endforeach() # Configure C headers. -foreach(h ${KWSYS_H_FILES}) +foreach(h IN LISTS KWSYS_H_FILES) # Configure the header into the given directory. configure_file(${PROJECT_SOURCE_DIR}/${h}.h.in ${KWSYS_HEADER_DIR}/${h}.h @ONLY IMMEDIATE) @@ -727,7 +727,7 @@ foreach(h ${KWSYS_H_FILES}) endforeach() # Configure other C++ headers. -foreach(h ${KWSYS_HXX_FILES}) +foreach(h IN LISTS KWSYS_HXX_FILES) # Configure the header into the given directory. configure_file(${PROJECT_SOURCE_DIR}/${h}.hxx.in ${KWSYS_HEADER_DIR}/${h}.hxx @ONLY IMMEDIATE) @@ -956,9 +956,11 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR) add_executable(${KWSYS_NAMESPACE}TestsC ${KWSYS_C_TEST_SRCS}) set_property(TARGET ${KWSYS_NAMESPACE}TestsC PROPERTY LABELS ${KWSYS_LABELS_EXE}) target_link_libraries(${KWSYS_NAMESPACE}TestsC ${KWSYS_TARGET_C_LINK}) - foreach(testfile ${KWSYS_C_TESTS}) + foreach(testfile IN LISTS KWSYS_C_TESTS) get_filename_component(test "${testfile}" NAME_WE) - add_test(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsC ${test} ${KWSYS_TEST_ARGS_${test}}) + add_test(NAME kwsys.${test} + COMMAND ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsC ${test} ${KWSYS_TEST_ARGS_${test}} + ) set_property(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) endforeach() @@ -1080,9 +1082,11 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR) -p some junk at the end ) - foreach(testfile ${KWSYS_CXX_TESTS}) + foreach(testfile IN LISTS KWSYS_CXX_TESTS) get_filename_component(test "${testfile}" NAME_WE) - add_test(kwsys.${test} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsCxx ${test} ${KWSYS_TEST_ARGS_${test}}) + add_test(NAME kwsys.${test} + COMMAND ${EXEC_DIR}/${KWSYS_NAMESPACE}TestsCxx ${test} ${KWSYS_TEST_ARGS_${test}} + ) set_property(TEST kwsys.${test} PROPERTY LABELS ${KWSYS_LABELS_TEST}) endforeach() @@ -1091,10 +1095,12 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR) set_property(TARGET ${KWSYS_NAMESPACE}TestProcess PROPERTY LABELS ${KWSYS_LABELS_EXE}) target_link_libraries(${KWSYS_NAMESPACE}TestProcess ${KWSYS_TARGET_C_LINK}) #set(KWSYS_TEST_PROCESS_7 7) # uncomment to run timing-sensitive test locally - foreach(n 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7} 9 10) - add_test(kwsys.testProcess-${n} ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n}) + foreach(n IN ITEMS 1 2 3 4 5 6 ${KWSYS_TEST_PROCESS_7} 9 10) + add_test(NAME kwsys.testProcess-${n} + COMMAND ${EXEC_DIR}/${KWSYS_NAMESPACE}TestProcess ${n} + ) set_property(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) - set_tests_properties(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120) + set_property(TEST kwsys.testProcess-${n} PROPERTY TIMEOUT 120) endforeach() set(testProcess_COMPILE_FLAGS "") @@ -1121,9 +1127,9 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR) # Configure some test properties. if(KWSYS_STANDALONE) # We expect test to fail - set_tests_properties(kwsys.testFail PROPERTIES WILL_FAIL ON) + set_property(TEST kwsys.testFail PROPERTY WILL_FAIL ON) get_test_property(kwsys.testFail WILL_FAIL wfv) - set_tests_properties(kwsys.testFail PROPERTIES MEASUREMENT "Some Key=Some Value") + set_property(TEST kwsys.testFail PROPERTY MEASUREMENT "Some Key=Some Value") message(STATUS "GET_TEST_PROPERTY returned: ${wfv}") endif() @@ -1133,7 +1139,7 @@ if(KWSYS_STANDALONE OR CMake_SOURCE_DIR) # Suppress known consistent failures on buggy systems. if(KWSYS_TEST_BOGUS_FAILURES) - set_tests_properties(${KWSYS_TEST_BOGUS_FAILURES} PROPERTIES WILL_FAIL ON) + set_property(TEST ${KWSYS_TEST_BOGUS_FAILURES} PROPERTY WILL_FAIL ON) endif() endif() |