summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-23 12:45:57 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-23 12:46:08 (GMT)
commit87b9a31489c4251f3fb6a9b79da6156cdb1a1d64 (patch)
tree3c7f0f32ec7928bed69138c5fd9fb05533d7e564 /Tests/RunCMake
parent4281f6ac345601ac6f40c5fcb3b43af8361e98ab (diff)
parent9629be8080d054ab44603802923a3ce72620f864 (diff)
downloadCMake-87b9a31489c4251f3fb6a9b79da6156cdb1a1d64.zip
CMake-87b9a31489c4251f3fb6a9b79da6156cdb1a1d64.tar.gz
CMake-87b9a31489c4251f3fb6a9b79da6156cdb1a1d64.tar.bz2
Merge topic 'modernize-build-self'
9629be8080 Build: Use `CMAKE_CURRENT_XXX_DIR` instead of top dirs e6fb5a1feb Build: Sort linked libraries list of `CMakeLib` aa7290e8dc Build: Use imported target `Threads::Threads` instead of variable df8ad72ffa Build: Use imported target `kwiml::kwiml` instead of variables eeebf31e54 Build: Use imported target `LibRHash::LibRHash` instead of variables 08be01a181 Build: Use imported target `LibUV::LibUV` instead of variables ddac6dcbe8 Build: Use imported target `JsonCpp::JsonCpp` instead of variables ac76c53d33 Build: Use imported target `CURL::libcurl` instead of variables ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7570
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/RunCMake.cmake10
2 files changed, 11 insertions, 7 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index d802e1f..2f5bc87 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -527,7 +527,9 @@ function(add_RunCMake_test_try_compile)
set(CMAKE_CXX_STANDARD_DEFAULT 14)
endif()
endif()
- foreach(var
+ foreach(
+ var
+ IN ITEMS
CMAKE_SYSTEM_NAME
CMAKE_C_COMPILER_ID
CMAKE_C_COMPILER_VERSION
@@ -541,7 +543,7 @@ function(add_RunCMake_test_try_compile)
CMake_TEST_FILESYSTEM_1S
CMAKE_OBJC_STANDARD_DEFAULT
CMAKE_OBJCXX_STANDARD_DEFAULT
- )
+ )
if(DEFINED ${var})
list(APPEND try_compile_ARGS -D${var}=${${var}})
endif()
@@ -958,7 +960,7 @@ if(CMake_TEST_ANDROID_NDK OR CMake_TEST_ANDROID_STANDALONE_TOOLCHAIN)
if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja|Visual Studio 1[456]")
message(FATAL_ERROR "Android tests supported only by Makefile, Ninja, and Visual Studio >= 14 generators")
endif()
- foreach(v TEST_ANDROID_NDK TEST_ANDROID_STANDALONE_TOOLCHAIN)
+ foreach(v IN ITEMS TEST_ANDROID_NDK TEST_ANDROID_STANDALONE_TOOLCHAIN)
if(CMake_${v})
string(REPLACE ";" "|" ${v} "${CMake_${v}}")
list(APPEND Android_ARGS "-D${v}=${${v}}")
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 1c92ca0..c329b46 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -1,8 +1,10 @@
-foreach(arg
+foreach(
+ arg
+ IN ITEMS
RunCMake_GENERATOR
RunCMake_SOURCE_DIR
RunCMake_BINARY_DIR
- )
+ )
if(NOT DEFINED ${arg})
message(FATAL_ERROR "${arg} not given!")
endif()
@@ -31,7 +33,7 @@ function(run_cmake test)
set(platform_name msys)
endif()
- foreach(o out err)
+ foreach(o IN ITEMS out err)
if(RunCMake-std${o}-file AND EXISTS ${top_src}/${RunCMake-std${o}-file})
file(READ ${top_src}/${RunCMake-std${o}-file} expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
@@ -176,7 +178,7 @@ function(run_cmake test)
"|[^\n]*Bullseye Testing Technology"
")[^\n]*\n)+"
)
- foreach(o out err)
+ foreach(o IN ITEMS out err)
string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "${ignore_line_regex}" "\\1" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "\n+$" "" actual_std${o} "${actual_std${o}}")