diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2022-08-20 22:00:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-09-22 13:24:46 (GMT) |
commit | a509602699eb83fbbea67244051c8a18f708a6ae (patch) | |
tree | 94dc40d7c2f27d428e3e421a079fdb9c74ca29e3 /Source/CMakeLists.txt | |
parent | 914d21de58094d461c9f86738136fb034a691113 (diff) | |
download | CMake-a509602699eb83fbbea67244051c8a18f708a6ae.zip CMake-a509602699eb83fbbea67244051c8a18f708a6ae.tar.gz CMake-a509602699eb83fbbea67244051c8a18f708a6ae.tar.bz2 |
Build: Modernize some `foreach` calls to use `IN LISTS`/`IN ITEMS`
Diffstat (limited to 'Source/CMakeLists.txt')
-rw-r--r-- | Source/CMakeLists.txt | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 86f8116..8f4750e 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -881,16 +881,13 @@ if(WIN32 AND NOT CYGWIN) target_link_libraries(cmcldeps CMakeLib) endif() -foreach(v CURL_CA_BUNDLE CURL_CA_PATH) +foreach(v IN ITEMS CURL_CA_BUNDLE CURL_CA_PATH) if(${v}) set_property(SOURCE cmCurl.cxx APPEND PROPERTY COMPILE_DEFINITIONS ${v}="${${v}}") endif() endforeach() -foreach(check - STAT_HAS_ST_MTIM - STAT_HAS_ST_MTIMESPEC - ) +foreach(check IN ITEMS STAT_HAS_ST_MTIM STAT_HAS_ST_MTIMESPEC) if(KWSYS_CXX_${check}_COMPILED) # abuse KWSys check cache entry set(CMake_${check} 1) else() @@ -1217,7 +1214,7 @@ if(WIN32) # MinGW's windres tool with spaces in the path to the include directories. add_library(CMakeVersion OBJECT "${CMAKE_CURRENT_BINARY_DIR}/CMakeVersion.rc") set_property(TARGET CMakeVersion PROPERTY INCLUDE_DIRECTORIES "") - foreach(_tool ${_tools}) + foreach(_tool IN LISTS _tools) target_sources(${_tool} PRIVATE $<TARGET_OBJECTS:CMakeVersion>) endforeach() endif() @@ -1229,7 +1226,7 @@ endif() # Install tools -foreach(_tool ${_tools}) +foreach(_tool IN LISTS _tools) CMake_OPTIONAL_COMPONENT(${_tool}) install(TARGETS ${_tool} DESTINATION ${CMAKE_BIN_DIR} ${COMPONENT}) endforeach() |