summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-04-20 18:05:36 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2022-04-20 19:34:28 (GMT)
commit233997a914af8341527eddd83a09fcc0f383ec65 (patch)
tree309760092a7173970cee55f50a3173b7d66021b5 /Source
parent2ec44be41e1359e6df07edcc86d0934042cd2ef3 (diff)
downloadCMake-233997a914af8341527eddd83a09fcc0f383ec65.zip
CMake-233997a914af8341527eddd83a09fcc0f383ec65.tar.gz
CMake-233997a914af8341527eddd83a09fcc0f383ec65.tar.bz2
generated-scripts: use `foreach(IN LISTS)`
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmExportInstallFileGenerator.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 7aa35d3..d13253a 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -988,7 +988,7 @@ void cmExportFileGenerator::GenerateExpectedTargetsCode(
"set(_cmake_targets_defined \"\")\n"
"set(_cmake_targets_not_defined \"\")\n"
"set(_cmake_expected_targets \"\")\n"
- "foreach(_cmake_expected_target " << expectedTargets << ")\n"
+ "foreach(_cmake_expected_target IN ITEMS " << expectedTargets << ")\n"
" list(APPEND _cmake_expected_targets \"${_cmake_expected_target}\")\n"
" if(TARGET \"${_cmake_expected_target}\")\n"
" list(APPEND _cmake_targets_defined \"${_cmake_expected_target}\")\n"
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index edee26d..7de1230 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -256,7 +256,7 @@ void cmExportInstallFileGenerator::LoadConfigFiles(std::ostream& os)
<< "get_filename_component(_DIR \"${CMAKE_CURRENT_LIST_FILE}\" PATH)\n"
<< "file(GLOB _cmake_config_files \"${_DIR}/"
<< this->GetConfigImportFileGlob() << "\")\n"
- << "foreach(_cmake_config_file ${_cmake_config_files})\n"
+ << "foreach(_cmake_config_file IN LISTS _cmake_config_files)\n"
<< " include(\"${_cmake_config_file}\")\n"
<< "endforeach()\n"
<< "\n";