Merge topic 'ctest-cleanup'

5d2e93f9e8 cmCTestMultiProcessHandler: Simplify logic on unavailable resources
a4b061a035 cmCTestMultiProcessHandler: Clarify resource availability error member names
1487e540aa cmCTestMultiProcessHandler: Reduce repeat test property map lookups
b02b628ad9 cmCTestMultiProcessHandler: Simplify loop termination on serial test
8f1e8af0cc cmCTestMultiProcessHandler: Stop searching for tests when limit is reached
bd0b4ca867 cmCTestMultiProcessHandler: Invert spare load condition
9b548139fd cmCTestMultiProcessHandler: Clarify search for tests <= concurrency limit
ee321dc85f cmCTestMultiProcessHandler: Clarify search for tests <= spare load
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8981
diff --git a/.clang-tidy b/.clang-tidy
index 1b776e1..03e6a51 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -3,15 +3,18 @@
 bugprone-*,\
 -bugprone-assignment-in-if-condition,\
 -bugprone-easily-swappable-parameters,\
+-bugprone-empty-catch,\
 -bugprone-implicit-widening-of-multiplication-result,\
 -bugprone-macro-parentheses,\
 -bugprone-misplaced-widening-cast,\
 -bugprone-narrowing-conversions,\
+-bugprone-switch-missing-default-case,\
 -bugprone-too-small-loop-variable,\
 -bugprone-unchecked-optional-access,\
 misc-*,\
 -misc-confusable-identifiers,\
 -misc-const-correctness,\
+-misc-include-cleaner,\
 -misc-no-recursion,\
 -misc-non-private-member-variables-in-classes,\
 -misc-static-assert,\
@@ -20,14 +23,18 @@
 -modernize-avoid-c-arrays,\
 -modernize-macro-to-enum,\
 -modernize-return-braced-init-list,\
+-modernize-type-traits,\
 -modernize-use-emplace,\
 -modernize-use-nodiscard,\
 -modernize-use-noexcept,\
 -modernize-use-trailing-return-type,\
 -modernize-use-transparent-functors,\
 performance-*,\
+-performance-avoid-endl,\
 -performance-inefficient-vector-operation,\
+-performance-noexcept-swap,\
 readability-*,\
+-readability-avoid-unconditional-preprocessor-if,\
 -readability-convert-member-functions-to-static,\
 -readability-function-cognitive-complexity,\
 -readability-function-size,\
@@ -41,6 +48,7 @@
 -readability-redundant-declaration,\
 -readability-redundant-member-init,\
 -readability-simplify-boolean-expr,\
+-readability-static-accessed-through-instance,\
 -readability-suspicious-call-argument,\
 -readability-uppercase-literal-suffix,\
 cmake-*,\
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 032a6fc..b8bb4ab 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -59,7 +59,7 @@
 
 p:doc-package:
     extends:
-        - .fedora38_sphinx_package
+        - .fedora39_sphinx_package
         - .cmake_prep_doc_linux
         - .linux_x86_64_tags
         - .cmake_doc_artifacts
@@ -108,17 +108,17 @@
         - .cmake_cdash_artifacts
         - .run_automatically
 
-l:tidy-fedora38:
+l:tidy-fedora39:
     extends:
-        - .fedora38_tidy
+        - .fedora39_tidy
         - .cmake_build_linux
         - .linux_x86_64_tags
         - .cmake_cdash_artifacts
         - .run_automatically
 
-l:sphinx-fedora38:
+l:sphinx-fedora39:
     extends:
-        - .fedora38_sphinx
+        - .fedora39_sphinx
         - .cmake_build_linux
         - .cmake_sphinx_artifacts
         - .linux_x86_64_tags
@@ -127,9 +127,9 @@
         CMAKE_CI_JOB_CONTINUOUS: "true"
         CMAKE_CI_JOB_HELP: "true"
 
-l:clang-analyzer-fedora38:
+l:clang-analyzer-fedora39:
     extends:
-        - .fedora38_clang_analyzer
+        - .fedora39_clang_analyzer
         - .cmake_build_linux
         - .linux_x86_64_tags
         - .run_automatically
@@ -223,9 +223,9 @@
     variables:
         CMAKE_CI_NO_MR: "true"
 
-t:fedora38-hip-radeon:
+t:fedora39-hip-radeon:
     extends:
-        - .fedora38_hip_radeon
+        - .fedora39_hip_radeon
         - .cmake_test_linux_release
         - .linux_x86_64_tags_radeon
         - .run_dependent
@@ -233,9 +233,9 @@
     variables:
         CMAKE_CI_NO_MR: "true"
 
-t:fedora38-ninja-clang:
+t:fedora39-ninja-clang:
     extends:
-        - .fedora38_ninja_clang
+        - .fedora39_ninja_clang
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -243,9 +243,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora38-ninja-multi-clang:
+t:fedora39-ninja-multi-clang:
     extends:
-        - .fedora38_ninja_multi_clang
+        - .fedora39_ninja_multi_clang
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -253,9 +253,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora38-makefiles-clang:
+t:fedora39-makefiles-clang:
     extends:
-        - .fedora38_makefiles_clang
+        - .fedora39_makefiles_clang
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -263,17 +263,17 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora38-makefiles:
+t:fedora39-makefiles:
     extends:
-        - .fedora38_makefiles
+        - .fedora39_makefiles
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
         - .needs_centos7_x86_64
 
-t:fedora38-makefiles-nospace:
+t:fedora39-makefiles-nospace:
     extends:
-        - .fedora38_makefiles
+        - .fedora39_makefiles
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .cmake_junit_artifacts
@@ -281,7 +281,7 @@
         - .needs_centos7_x86_64
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci"
-        CMAKE_CI_BUILD_NAME: fedora38_makefiles_nospace
+        CMAKE_CI_BUILD_NAME: fedora39_makefiles_nospace
         CMAKE_CI_JOB_NIGHTLY: "true"
 
 t:nvhpc22.11-ninja:
@@ -413,9 +413,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-b:fedora38-ninja:
+b:fedora39-ninja:
     extends:
-        - .fedora38_ninja
+        - .fedora39_ninja
         - .cmake_build_linux
         - .cmake_build_artifacts
         - .linux_x86_64_tags
@@ -423,9 +423,9 @@
     variables:
         CMAKE_CI_JOB_CONTINUOUS: "true"
 
-b:fedora38-makefiles-symlinked:
+b:fedora39-makefiles-symlinked:
     extends:
-        - .fedora38_makefiles_symlinked
+        - .fedora39_makefiles_symlinked
         - .cmake_build_linux
         - .cmake_build_artifacts
         - .linux_x86_64_tags
@@ -460,54 +460,54 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-b:fedora38-extdeps:
+b:fedora39-extdeps:
     extends:
-        - .fedora38_extdeps
+        - .fedora39_extdeps
         - .cmake_build_linux_standalone
         - .linux_x86_64_tags
         - .run_manually
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora38-ninja:
+t:fedora39-ninja:
     extends:
-        - .fedora38_ninja
+        - .fedora39_ninja
         - .cmake_test_linux
         - .linux_x86_64_tags_x11
         - .cmake_test_artifacts
         - .run_dependent
     dependencies:
-        - b:fedora38-ninja
+        - b:fedora39-ninja
     needs:
-        - b:fedora38-ninja
+        - b:fedora39-ninja
     variables:
         CMAKE_CI_JOB_CONTINUOUS: "true"
 
-t:fedora38-makefiles-symlinked:
+t:fedora39-makefiles-symlinked:
     extends:
-        - .fedora38_makefiles_symlinked
+        - .fedora39_makefiles_symlinked
         - .cmake_test_linux
         - .linux_x86_64_tags_x11
         - .cmake_test_artifacts
         - .run_dependent
     dependencies:
-        - b:fedora38-makefiles-symlinked
+        - b:fedora39-makefiles-symlinked
     needs:
-        - b:fedora38-makefiles-symlinked
+        - b:fedora39-makefiles-symlinked
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora38-ninja-multi:
+t:fedora39-ninja-multi:
     extends:
-        - .fedora38_ninja_multi
+        - .fedora39_ninja_multi
         - .cmake_test_linux_external
         - .linux_x86_64_tags
         - .cmake_junit_artifacts
         - .run_dependent
     dependencies:
-        - t:fedora38-ninja
+        - t:fedora39-ninja
     needs:
-        - t:fedora38-ninja
+        - t:fedora39-ninja
 
 t:intel2016-makefiles:
     extends:
@@ -874,9 +874,9 @@
 
 ## Sanitizer builds
 
-b:fedora38-asan:
+b:fedora39-asan:
     extends:
-        - .fedora38_asan
+        - .fedora39_asan
         - .cmake_build_linux
         - .cmake_build_artifacts
         - .linux_x86_64_tags
@@ -884,16 +884,16 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora38-asan:
+t:fedora39-asan:
     extends:
-        - .fedora38_asan
+        - .fedora39_asan
         - .cmake_memcheck_linux
         - .linux_x86_64_tags
         - .run_dependent
     dependencies:
-        - b:fedora38-asan
+        - b:fedora39-asan
     needs:
-        - b:fedora38-asan
+        - b:fedora39-asan
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml
index cc52971..40a8509 100644
--- a/.gitlab/artifacts.yml
+++ b/.gitlab/artifacts.yml
@@ -86,7 +86,6 @@
             - ${CMAKE_CI_BUILD_DIR}/cmake-*.zip
             # Any unsigned packages made.
             - ${CMAKE_CI_BUILD_DIR}/unsigned/cmake-*
-            - ${CMAKE_CI_BUILD_DIR}/cdash-build-id
         reports:
             annotations:
                 - ${CMAKE_CI_BUILD_DIR}/annotations.json
diff --git a/.gitlab/ci/configure_fedora38_clang_analyzer.cmake b/.gitlab/ci/configure_fedora38_clang_analyzer.cmake
deleted file mode 100644
index c11eef1..0000000
--- a/.gitlab/ci/configure_fedora38_clang_analyzer.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(configure_no_sccache 1)
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake")
diff --git a/.gitlab/ci/configure_fedora38_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora38_makefiles_symlinked.cmake
deleted file mode 100644
index 177bbcf..0000000
--- a/.gitlab/ci/configure_fedora38_makefiles_symlinked.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake")
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake")
diff --git a/.gitlab/ci/configure_fedora38_ninja_clang.cmake b/.gitlab/ci/configure_fedora38_ninja_clang.cmake
deleted file mode 100644
index 848c5b6..0000000
--- a/.gitlab/ci/configure_fedora38_ninja_clang.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "")
-set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake b/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake
deleted file mode 100644
index 848c5b6..0000000
--- a/.gitlab/ci/configure_fedora38_ninja_multi_clang.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "")
-set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora38_asan.cmake b/.gitlab/ci/configure_fedora39_asan.cmake
similarity index 65%
rename from .gitlab/ci/configure_fedora38_asan.cmake
rename to .gitlab/ci/configure_fedora39_asan.cmake
index 8eae500..872517c 100644
--- a/.gitlab/ci/configure_fedora38_asan.cmake
+++ b/.gitlab/ci/configure_fedora39_asan.cmake
@@ -1,4 +1,4 @@
 set(CMAKE_C_FLAGS "-fsanitize=address" CACHE STRING "")
 set(CMAKE_CXX_FLAGS "-fsanitize=address" CACHE STRING "")
 
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora39_clang_analyzer.cmake b/.gitlab/ci/configure_fedora39_clang_analyzer.cmake
new file mode 100644
index 0000000..1bfb3fb
--- /dev/null
+++ b/.gitlab/ci/configure_fedora39_clang_analyzer.cmake
@@ -0,0 +1,3 @@
+set(configure_no_sccache 1)
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora38_common.cmake b/.gitlab/ci/configure_fedora39_common.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora38_common.cmake
rename to .gitlab/ci/configure_fedora39_common.cmake
diff --git a/.gitlab/ci/configure_fedora38_common_clang.cmake b/.gitlab/ci/configure_fedora39_common_clang.cmake
similarity index 78%
rename from .gitlab/ci/configure_fedora38_common_clang.cmake
rename to .gitlab/ci/configure_fedora39_common_clang.cmake
index 70c9df9..1b3835a 100644
--- a/.gitlab/ci/configure_fedora38_common_clang.cmake
+++ b/.gitlab/ci/configure_fedora39_common_clang.cmake
@@ -1,6 +1,5 @@
 set(CMAKE_Fortran_COMPILER "/usr/bin/flang-new" CACHE FILEPATH "")
 set(CMAKE_Fortran_COMPILER_ID "LLVMFlang" CACHE STRING "")
 set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 "1" CACHE BOOL "")
-set(CMAKE_Fortran_FLAGS "-flang-experimental-exec" CACHE STRING "")
 
 include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora38_extdeps.cmake b/.gitlab/ci/configure_fedora39_extdeps.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora38_extdeps.cmake
rename to .gitlab/ci/configure_fedora39_extdeps.cmake
diff --git a/.gitlab/ci/configure_fedora38_hip_radeon.cmake b/.gitlab/ci/configure_fedora39_hip_radeon.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora38_hip_radeon.cmake
rename to .gitlab/ci/configure_fedora39_hip_radeon.cmake
diff --git a/.gitlab/ci/configure_fedora38_makefiles.cmake b/.gitlab/ci/configure_fedora39_makefiles.cmake
similarity index 99%
rename from .gitlab/ci/configure_fedora38_makefiles.cmake
rename to .gitlab/ci/configure_fedora39_makefiles.cmake
index a3881cf..953b2a8 100644
--- a/.gitlab/ci/configure_fedora38_makefiles.cmake
+++ b/.gitlab/ci/configure_fedora39_makefiles.cmake
@@ -57,7 +57,7 @@
 set(CMake_TEST_FindMPI_C "ON" CACHE BOOL "")
 set(CMake_TEST_FindMPI_CXX "ON" CACHE BOOL "")
 set(CMake_TEST_FindMPI_Fortran "ON" CACHE BOOL "")
-set(CMake_TEST_FindMPI_ENVMOD "PATH=path_list_prepend:/usr/lib64/mpich/bin;LD_LIBRARY_PATH=path_list_prepend:/usr/lib64/mpich/lib" CACHE STRING "")
+set(CMake_TEST_FindMPI_ENVMOD "PATH=path_list_prepend:/usr/lib64/mpich/bin;LD_LIBRARY_PATH=path_list_prepend:/usr/lib64/mpich/lib;FI_PROVIDER=set:tcp" CACHE STRING "")
 set(CMake_TEST_FindMPI "ON" CACHE BOOL "")
 set(CMake_TEST_FindODBC "ON" CACHE BOOL "")
 set(CMake_TEST_FindOpenACC "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_fedora38_makefiles_clang.cmake b/.gitlab/ci/configure_fedora39_makefiles_clang.cmake
similarity index 68%
rename from .gitlab/ci/configure_fedora38_makefiles_clang.cmake
rename to .gitlab/ci/configure_fedora39_makefiles_clang.cmake
index 3ac23be..a85ae70 100644
--- a/.gitlab/ci/configure_fedora38_makefiles_clang.cmake
+++ b/.gitlab/ci/configure_fedora39_makefiles_clang.cmake
@@ -2,4 +2,4 @@
   set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "")
 endif()
 
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common_clang.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora39_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora39_makefiles_symlinked.cmake
new file mode 100644
index 0000000..b53ab66
--- /dev/null
+++ b/.gitlab/ci/configure_fedora39_makefiles_symlinked.cmake
@@ -0,0 +1,2 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora38_ninja.cmake b/.gitlab/ci/configure_fedora39_ninja.cmake
similarity index 88%
rename from .gitlab/ci/configure_fedora38_ninja.cmake
rename to .gitlab/ci/configure_fedora39_ninja.cmake
index ac6b9f6..ff233a3 100644
--- a/.gitlab/ci/configure_fedora38_ninja.cmake
+++ b/.gitlab/ci/configure_fedora39_ninja.cmake
@@ -11,4 +11,4 @@
 # Cover compilation with C++11 only and not higher standards.
 set(CMAKE_CXX_STANDARD "11" CACHE STRING "")
 
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_fedora39_ninja_clang.cmake b/.gitlab/ci/configure_fedora39_ninja_clang.cmake
new file mode 100644
index 0000000..79d3eaa
--- /dev/null
+++ b/.gitlab/ci/configure_fedora39_ninja_clang.cmake
@@ -0,0 +1,3 @@
+set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora38_ninja_multi.cmake b/.gitlab/ci/configure_fedora39_ninja_multi.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora38_ninja_multi.cmake
rename to .gitlab/ci/configure_fedora39_ninja_multi.cmake
diff --git a/.gitlab/ci/configure_fedora39_ninja_multi_clang.cmake b/.gitlab/ci/configure_fedora39_ninja_multi_clang.cmake
new file mode 100644
index 0000000..79d3eaa
--- /dev/null
+++ b/.gitlab/ci/configure_fedora39_ninja_multi_clang.cmake
@@ -0,0 +1,3 @@
+set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora38_sphinx.cmake b/.gitlab/ci/configure_fedora39_sphinx.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora38_sphinx.cmake
rename to .gitlab/ci/configure_fedora39_sphinx.cmake
diff --git a/.gitlab/ci/configure_fedora38_sphinx_package.cmake b/.gitlab/ci/configure_fedora39_sphinx_package.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora38_sphinx_package.cmake
rename to .gitlab/ci/configure_fedora39_sphinx_package.cmake
diff --git a/.gitlab/ci/configure_fedora38_tidy.cmake b/.gitlab/ci/configure_fedora39_tidy.cmake
similarity index 78%
rename from .gitlab/ci/configure_fedora38_tidy.cmake
rename to .gitlab/ci/configure_fedora39_tidy.cmake
index 5b062da..4ed1eb3 100644
--- a/.gitlab/ci/configure_fedora38_tidy.cmake
+++ b/.gitlab/ci/configure_fedora39_tidy.cmake
@@ -2,4 +2,4 @@
 set(CMake_USE_CLANG_TIDY_MODULE ON CACHE BOOL "")
 set(CMake_CLANG_TIDY_MODULE "$ENV{CI_PROJECT_DIR}/Utilities/ClangTidyModule/build/libcmake-clang-tidy-module.so" CACHE FILEPATH "")
 
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora38_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora39_common.cmake")
diff --git a/.gitlab/ci/configure_windows_clang_ninja.cmake b/.gitlab/ci/configure_windows_clang_ninja.cmake
index 8a65eef..fcb2d46 100644
--- a/.gitlab/ci/configure_windows_clang_ninja.cmake
+++ b/.gitlab/ci/configure_windows_clang_ninja.cmake
@@ -1,5 +1,4 @@
 if("$ENV{CMAKE_CI_BUILD_NAME}" MATCHES "(^|_)gnu(_|$)")
   set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly" CACHE STRING "")
-  set(CMake_TEST_MODULE_COMPILATION_RULES "${CMAKE_CURRENT_LIST_DIR}/cxx_modules_rules_clang.cmake" CACHE STRING "")
 endif()
 include("${CMAKE_CURRENT_LIST_DIR}/configure_windows_clang_common.cmake")
diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake
index a2789c3..159c1c8 100644
--- a/.gitlab/ci/ctest_exclusions.cmake
+++ b/.gitlab/ci/ctest_exclusions.cmake
@@ -34,6 +34,15 @@
     )
 endif()
 
+if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "fedora39_makefiles")
+  list(APPEND test_exclusions
+    # FIXME(#25421): CPack/RPM needs an update for Fedora 39.
+    "^CPackComponentsForAll-RPM-default$"
+    "^CPackComponentsForAll-RPM-AllInOne$"
+    "^CPackComponentsForAll-RPM-OnePackPerGroup$"
+    )
+endif()
+
 string(REPLACE ";" "|" test_exclusions "${test_exclusions}")
 if (test_exclusions)
   set(test_exclusions "(${test_exclusions})")
diff --git a/.gitlab/ci/ctest_memcheck_fedora38_asan.lsan.supp b/.gitlab/ci/ctest_memcheck_fedora39_asan.lsan.supp
similarity index 100%
rename from .gitlab/ci/ctest_memcheck_fedora38_asan.lsan.supp
rename to .gitlab/ci/ctest_memcheck_fedora39_asan.lsan.supp
diff --git a/.gitlab/ci/cxx_modules_rules_clang.cmake b/.gitlab/ci/cxx_modules_rules_clang.cmake
deleted file mode 100644
index 1268244..0000000
--- a/.gitlab/ci/cxx_modules_rules_clang.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-# Default to C++ extensions being off. Clang's modules support have trouble
-# with extensions right now.
-set(CMAKE_CXX_EXTENSIONS OFF)
diff --git a/.gitlab/ci/docker/fedora38/Dockerfile b/.gitlab/ci/docker/fedora39/Dockerfile
similarity index 98%
rename from .gitlab/ci/docker/fedora38/Dockerfile
rename to .gitlab/ci/docker/fedora39/Dockerfile
index 4918693..f14e017 100644
--- a/.gitlab/ci/docker/fedora38/Dockerfile
+++ b/.gitlab/ci/docker/fedora39/Dockerfile
@@ -1,6 +1,6 @@
 # syntax=docker/dockerfile:1
 
-ARG BASE_IMAGE=fedora:38
+ARG BASE_IMAGE=fedora:39
 
 FROM ${BASE_IMAGE} AS dnf-cache
 # Populate DNF cache w/ the fresh metadata and prefetch packages.
diff --git a/.gitlab/ci/docker/fedora38/deps_packages.lst b/.gitlab/ci/docker/fedora39/deps_packages.lst
similarity index 98%
rename from .gitlab/ci/docker/fedora38/deps_packages.lst
rename to .gitlab/ci/docker/fedora39/deps_packages.lst
index da050d9..7656cbc 100644
--- a/.gitlab/ci/docker/fedora38/deps_packages.lst
+++ b/.gitlab/ci/docker/fedora39/deps_packages.lst
@@ -6,6 +6,7 @@
 
 # Install development tools.
 clang
+clang-devel
 clang-tools-extra
 clang-tools-extra-devel
 compiler-rt
@@ -13,6 +14,7 @@
 flang-devel
 gcc-c++
 git-core
+llvm-devel
 make
 
 # Install optional external build dependencies.
diff --git a/.gitlab/ci/docker/fedora38/install_deps.sh b/.gitlab/ci/docker/fedora39/install_deps.sh
similarity index 90%
rename from .gitlab/ci/docker/fedora38/install_deps.sh
rename to .gitlab/ci/docker/fedora39/install_deps.sh
index cd2701e..70e2293 100755
--- a/.gitlab/ci/docker/fedora38/install_deps.sh
+++ b/.gitlab/ci/docker/fedora39/install_deps.sh
@@ -19,12 +19,12 @@
 done
 
 # Remove tests for numpy
-for v in 2.7 3.11; do
+for v in 2.7 3.12; do
     find /usr/lib64/python${v}/site-packages/numpy -type d -a -name tests -exec rm -rf {} +
 done
 
 # Remove some other packages tests
-find /usr/lib64/python3.11/site-packages/breezy -type d -a -name tests -exec rm -rf {} +
+find /usr/lib64/python3.12/site-packages/breezy -type d -a -name tests -exec rm -rf {} +
 
 # Perforce
 curl -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz -o - \
diff --git a/.gitlab/ci/docker/fedora38/install_iwyu.sh b/.gitlab/ci/docker/fedora39/install_iwyu.sh
similarity index 100%
rename from .gitlab/ci/docker/fedora38/install_iwyu.sh
rename to .gitlab/ci/docker/fedora39/install_iwyu.sh
diff --git a/.gitlab/ci/docker/fedora38/install_rvm.sh b/.gitlab/ci/docker/fedora39/install_rvm.sh
similarity index 100%
rename from .gitlab/ci/docker/fedora38/install_rvm.sh
rename to .gitlab/ci/docker/fedora39/install_rvm.sh
diff --git a/.gitlab/ci/docker/fedora38/iwyu_packages.lst b/.gitlab/ci/docker/fedora39/iwyu_packages.lst
similarity index 100%
rename from .gitlab/ci/docker/fedora38/iwyu_packages.lst
rename to .gitlab/ci/docker/fedora39/iwyu_packages.lst
diff --git a/.gitlab/ci/docker/fedora38/rvm_packages.lst b/.gitlab/ci/docker/fedora39/rvm_packages.lst
similarity index 100%
rename from .gitlab/ci/docker/fedora38/rvm_packages.lst
rename to .gitlab/ci/docker/fedora39/rvm_packages.lst
diff --git a/.gitlab/ci/env_fedora38_common_clang.sh b/.gitlab/ci/env_fedora38_common_clang.sh
deleted file mode 100644
index fc9c041..0000000
--- a/.gitlab/ci/env_fedora38_common_clang.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-export CC=/usr/bin/clang-16
-export CXX=/usr/bin/clang++-16
-export FC=/usr/bin/flang-new
-export FFLAGS=-flang-experimental-exec
diff --git a/.gitlab/ci/env_fedora38_hip_radeon.sh b/.gitlab/ci/env_fedora38_hip_radeon.sh
deleted file mode 100644
index 812ef5a..0000000
--- a/.gitlab/ci/env_fedora38_hip_radeon.sh
+++ /dev/null
@@ -1 +0,0 @@
-export HIPCXX=/usr/bin/clang++-16
diff --git a/.gitlab/ci/env_fedora38_makefiles_clang.sh b/.gitlab/ci/env_fedora38_makefiles_clang.sh
deleted file mode 100644
index 9f3edde..0000000
--- a/.gitlab/ci/env_fedora38_makefiles_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora38_common_clang.sh
diff --git a/.gitlab/ci/env_fedora38_makefiles_symlinked.cmake b/.gitlab/ci/env_fedora38_makefiles_symlinked.cmake
deleted file mode 100644
index 2accabf..0000000
--- a/.gitlab/ci/env_fedora38_makefiles_symlinked.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/env_fedora38_makefiles.cmake")
diff --git a/.gitlab/ci/env_fedora38_makefiles_symlinked.sh b/.gitlab/ci/env_fedora38_makefiles_symlinked.sh
deleted file mode 100644
index 452d3785..0000000
--- a/.gitlab/ci/env_fedora38_makefiles_symlinked.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora38_makefiles.sh
diff --git a/.gitlab/ci/env_fedora38_ninja_clang.sh b/.gitlab/ci/env_fedora38_ninja_clang.sh
deleted file mode 100644
index 9f3edde..0000000
--- a/.gitlab/ci/env_fedora38_ninja_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora38_common_clang.sh
diff --git a/.gitlab/ci/env_fedora38_ninja_multi_clang.sh b/.gitlab/ci/env_fedora38_ninja_multi_clang.sh
deleted file mode 100644
index 9f3edde..0000000
--- a/.gitlab/ci/env_fedora38_ninja_multi_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora38_common_clang.sh
diff --git a/.gitlab/ci/env_fedora38_asan.sh b/.gitlab/ci/env_fedora39_asan.sh
similarity index 100%
rename from .gitlab/ci/env_fedora38_asan.sh
rename to .gitlab/ci/env_fedora39_asan.sh
diff --git a/.gitlab/ci/env_fedora38_clang_analyzer.sh b/.gitlab/ci/env_fedora39_clang_analyzer.sh
similarity index 100%
rename from .gitlab/ci/env_fedora38_clang_analyzer.sh
rename to .gitlab/ci/env_fedora39_clang_analyzer.sh
diff --git a/.gitlab/ci/env_fedora39_common_clang.sh b/.gitlab/ci/env_fedora39_common_clang.sh
new file mode 100644
index 0000000..076669b
--- /dev/null
+++ b/.gitlab/ci/env_fedora39_common_clang.sh
@@ -0,0 +1,3 @@
+export CC=/usr/bin/clang-17
+export CXX=/usr/bin/clang++-17
+export FC=/usr/bin/flang-new
diff --git a/.gitlab/ci/env_fedora38_extdeps.sh b/.gitlab/ci/env_fedora39_extdeps.sh
similarity index 100%
rename from .gitlab/ci/env_fedora38_extdeps.sh
rename to .gitlab/ci/env_fedora39_extdeps.sh
diff --git a/.gitlab/ci/env_fedora39_hip_radeon.sh b/.gitlab/ci/env_fedora39_hip_radeon.sh
new file mode 100644
index 0000000..0f7df8d
--- /dev/null
+++ b/.gitlab/ci/env_fedora39_hip_radeon.sh
@@ -0,0 +1 @@
+export HIPCXX=/usr/bin/clang++-17
diff --git a/.gitlab/ci/env_fedora38_makefiles.cmake b/.gitlab/ci/env_fedora39_makefiles.cmake
similarity index 100%
rename from .gitlab/ci/env_fedora38_makefiles.cmake
rename to .gitlab/ci/env_fedora39_makefiles.cmake
diff --git a/.gitlab/ci/env_fedora38_makefiles.sh b/.gitlab/ci/env_fedora39_makefiles.sh
similarity index 100%
rename from .gitlab/ci/env_fedora38_makefiles.sh
rename to .gitlab/ci/env_fedora39_makefiles.sh
diff --git a/.gitlab/ci/env_fedora39_makefiles_clang.sh b/.gitlab/ci/env_fedora39_makefiles_clang.sh
new file mode 100644
index 0000000..6200f82
--- /dev/null
+++ b/.gitlab/ci/env_fedora39_makefiles_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora39_common_clang.sh
diff --git a/.gitlab/ci/env_fedora39_makefiles_symlinked.cmake b/.gitlab/ci/env_fedora39_makefiles_symlinked.cmake
new file mode 100644
index 0000000..052e9a7
--- /dev/null
+++ b/.gitlab/ci/env_fedora39_makefiles_symlinked.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/env_fedora39_makefiles.cmake")
diff --git a/.gitlab/ci/env_fedora39_makefiles_symlinked.sh b/.gitlab/ci/env_fedora39_makefiles_symlinked.sh
new file mode 100644
index 0000000..39ac189
--- /dev/null
+++ b/.gitlab/ci/env_fedora39_makefiles_symlinked.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora39_makefiles.sh
diff --git a/.gitlab/ci/env_fedora38_ninja.sh b/.gitlab/ci/env_fedora39_ninja.sh
similarity index 100%
rename from .gitlab/ci/env_fedora38_ninja.sh
rename to .gitlab/ci/env_fedora39_ninja.sh
diff --git a/.gitlab/ci/env_fedora39_ninja_clang.sh b/.gitlab/ci/env_fedora39_ninja_clang.sh
new file mode 100644
index 0000000..6200f82
--- /dev/null
+++ b/.gitlab/ci/env_fedora39_ninja_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora39_common_clang.sh
diff --git a/.gitlab/ci/env_fedora38_ninja_multi.sh b/.gitlab/ci/env_fedora39_ninja_multi.sh
similarity index 100%
rename from .gitlab/ci/env_fedora38_ninja_multi.sh
rename to .gitlab/ci/env_fedora39_ninja_multi.sh
diff --git a/.gitlab/ci/env_fedora39_ninja_multi_clang.sh b/.gitlab/ci/env_fedora39_ninja_multi_clang.sh
new file mode 100644
index 0000000..6200f82
--- /dev/null
+++ b/.gitlab/ci/env_fedora39_ninja_multi_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora39_common_clang.sh
diff --git a/.gitlab/ci/pre_build_fedora38_tidy.sh b/.gitlab/ci/pre_build_fedora39_tidy.sh
similarity index 100%
rename from .gitlab/ci/pre_build_fedora38_tidy.sh
rename to .gitlab/ci/pre_build_fedora39_tidy.sh
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index 8894057..f529ab2 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -5,7 +5,7 @@
 ### Release
 
 .linux_prep_source:
-    image: "fedora:38"
+    image: "fedora:39"
 
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -68,8 +68,8 @@
 
 ### Fedora
 
-.fedora38:
-    image: "kitware/cmake:ci-fedora38-x86_64-2023-08-07"
+.fedora39:
+    image: "kitware/cmake:ci-fedora39-x86_64-2023-11-16"
 
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"
@@ -77,37 +77,37 @@
 
 #### Lint builds
 
-.fedora38_tidy:
-    extends: .fedora38
+.fedora39_tidy:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_tidy
+        CMAKE_CONFIGURATION: fedora39_tidy
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_CI_NO_INSTALL: 1
 
-.fedora38_clang_analyzer:
-    extends: .fedora38
+.fedora39_clang_analyzer:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_clang_analyzer
+        CMAKE_CONFIGURATION: fedora39_clang_analyzer
         CMAKE_CI_BUILD_TYPE: Debug
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_CI_NO_INSTALL: 1
 
-.fedora38_sphinx:
-    extends: .fedora38
+.fedora39_sphinx:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_sphinx
+        CMAKE_CONFIGURATION: fedora39_sphinx
         CTEST_NO_WARNINGS_ALLOWED: 1
         CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
         CMAKE_CI_NO_INSTALL: 1
 
-.fedora38_sphinx_package:
-    extends: .fedora38
+.fedora39_sphinx_package:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_sphinx_package
+        CMAKE_CONFIGURATION: fedora39_sphinx_package
         CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
 
 #### Build and test
@@ -163,43 +163,43 @@
         CMAKE_CI_BUILD_TYPE: Release
         CTEST_NO_WARNINGS_ALLOWED: 1
 
-.fedora38_extdeps:
-    extends: .fedora38
+.fedora39_extdeps:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_extdeps
+        CMAKE_CONFIGURATION: fedora39_extdeps
         CMAKE_CI_BUILD_TYPE: Release
         CTEST_NO_WARNINGS_ALLOWED: 1
 
-.fedora38_ninja:
-    extends: .fedora38
+.fedora39_ninja:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_ninja
+        CMAKE_CONFIGURATION: fedora39_ninja
         CMAKE_CI_BUILD_TYPE: Release
         CTEST_NO_WARNINGS_ALLOWED: 1
 
-.fedora38_ninja_multi:
-    extends: .fedora38
+.fedora39_ninja_multi:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_ninja_multi
+        CMAKE_CONFIGURATION: fedora39_ninja_multi
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_GENERATOR: "Ninja Multi-Config"
 
-.fedora38_makefiles:
-    extends: .fedora38
+.fedora39_makefiles:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_makefiles
+        CMAKE_CONFIGURATION: fedora39_makefiles
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_GENERATOR: "Unix Makefiles"
 
-.fedora38_makefiles_symlinked:
-    extends: .fedora38
+.fedora39_makefiles_symlinked:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_makefiles_symlinked
+        CMAKE_CONFIGURATION: fedora39_makefiles_symlinked
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_GENERATOR: "Unix Makefiles"
         CMAKE_CI_IN_SYMLINK_TREE: 1
@@ -220,24 +220,24 @@
     variables:
         CMAKE_CONFIGURATION: debian12_ninja_clang
 
-.fedora38_makefiles_clang:
-    extends: .fedora38
+.fedora39_makefiles_clang:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_makefiles_clang
+        CMAKE_CONFIGURATION: fedora39_makefiles_clang
         CMAKE_GENERATOR: "Unix Makefiles"
 
-.fedora38_ninja_clang:
-    extends: .fedora38
+.fedora39_ninja_clang:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_ninja_clang
+        CMAKE_CONFIGURATION: fedora39_ninja_clang
 
-.fedora38_ninja_multi_clang:
-    extends: .fedora38
+.fedora39_ninja_multi_clang:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_ninja_multi_clang
+        CMAKE_CONFIGURATION: fedora39_ninja_multi_clang
         CMAKE_GENERATOR: "Ninja Multi-Config"
 
 ### Sanitizers
@@ -253,13 +253,13 @@
         CTEST_MEMORYCHECK_TYPE: AddressSanitizer
         CTEST_MEMORYCHECK_SANITIZER_OPTIONS: ""
 
-.fedora38_asan:
+.fedora39_asan:
     extends:
-        - .fedora38
+        - .fedora39
         - .fedora_asan_addon
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_asan
+        CMAKE_CONFIGURATION: fedora39_asan
 
 ### Intel Compiler
 
@@ -392,11 +392,11 @@
         CMAKE_CONFIGURATION: debian12_hip_radeon
         CTEST_LABELS: "HIP"
 
-.fedora38_hip_radeon:
-    extends: .fedora38
+.fedora39_hip_radeon:
+    extends: .fedora39
 
     variables:
-        CMAKE_CONFIGURATION: fedora38_hip_radeon
+        CMAKE_CONFIGURATION: fedora39_hip_radeon
         CTEST_LABELS: "HIP"
 
 .hip5.5_nvidia:
@@ -526,7 +526,7 @@
 
 .cmake_codespell_linux:
     stage: build
-    extends: .fedora38
+    extends: .fedora39
     script:
         - .gitlab/ci/codespell.sh
     interruptible: true
@@ -670,7 +670,7 @@
 .cmake_org_help:
     stage: build
     extends:
-        - .fedora38
+        - .fedora39
         - .linux_x86_64_tags
         - .cmake_org_help_artifacts
     script:
diff --git a/.gitlab/upload.yml b/.gitlab/upload.yml
index caa2119..56793af 100644
--- a/.gitlab/upload.yml
+++ b/.gitlab/upload.yml
@@ -1,7 +1,7 @@
 # Steps for uploading artifacts
 
 .rsync_upload_package:
-    image: "fedora:38"
+    image: "fedora:39"
     stage: upload
     tags:
         - cmake
@@ -21,7 +21,7 @@
 
 .rsync_upload_help:
     stage: upload
-    image: "fedora:38"
+    image: "fedora:39"
     tags:
         - cmake
         - docker
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index 9dad4ac..aa9ebe4 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -375,6 +375,7 @@
             \ Swift_LANGUAGE_VERSION
             \ Swift_MODULE_DIRECTORY
             \ Swift_MODULE_NAME
+            \ Swift_COMPILATION_MODE
             \ TARGET_ARCHIVES_MAY_BE_SHARED_LIBS
             \ TARGET_MESSAGES
             \ TARGET_SUPPORTS_SHARED_LIBS
diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in
index f354362..7aacf8e 100644
--- a/CMakeCPackOptions.cmake.in
+++ b/CMakeCPackOptions.cmake.in
@@ -5,7 +5,7 @@
 if(CPACK_GENERATOR MATCHES "NSIS")
   set(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
 
-  # set the install/unistall icon used for the installer itself
+  # set the install/uninstall icon used for the installer itself
   # There is a bug in NSI that does not handle full unix paths properly.
   set(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
   set(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
diff --git a/Help/command/cmake_language.rst b/Help/command/cmake_language.rst
index 707568c..3af6b9c 100644
--- a/Help/command/cmake_language.rst
+++ b/Help/command/cmake_language.rst
@@ -195,7 +195,7 @@
   Immediate Message
   Deferred Message
 
-The ``Cancelled Message`` is never printed because its command is
+The ``Canceled Message`` is never printed because its command is
 canceled.  The ``deferred_message`` variable reference is not evaluated
 until the call site, so it can be set after the deferred call is scheduled.
 
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index db55bc2..50eaf22 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -94,7 +94,7 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The command also supports a second signature which can be used to specify that
-one target re-uses a precompiled header file artifact from another target
+one target reuses a precompiled header file artifact from another target
 instead of generating its own:
 
 .. code-block:: cmake
diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst
index e97ba49..2a4a308 100644
--- a/Help/cpack_gen/freebsd.rst
+++ b/Help/cpack_gen/freebsd.rst
@@ -19,9 +19,9 @@
 depending on the installed package-management tools -- using :module:`CPack`.
 
 The CPack FreeBSD generator is a :module:`CPack` generator and uses the
-:variable:`!CPACK_XXX` variables used by :module:`CPack`. It tries to re-use packaging
+:variable:`!CPACK_XXX` variables used by :module:`CPack`. It tries to reuse packaging
 information that may already be specified for Debian packages for the
-:cpack_gen:`CPack DEB Generator`. It also tries to re-use RPM packaging
+:cpack_gen:`CPack DEB Generator`. It also tries to reuse RPM packaging
 information when Debian does not specify.
 
 The CPack FreeBSD generator should work on any host with libpkg installed. The
diff --git a/Help/cpack_gen/wix.rst b/Help/cpack_gen/wix.rst
index af01252..cb56c9d 100644
--- a/Help/cpack_gen/wix.rst
+++ b/Help/cpack_gen/wix.rst
@@ -119,7 +119,8 @@
 
  If this variable is set, the specified template will be used to generate
  the WiX wxs file.  This should be used if further customization of the
- output is required.
+ output is required. The template contents will override the effect of most
+ ``CPACK_WIX_`` variables.
 
  If this variable is not set, the default MSI template included with CMake
  will be used.
@@ -337,3 +338,31 @@
  of the installer. May for example be set to ``x64`` or ``arm64``.
 
  When unspecified, CPack will default to ``x64`` or ``x86``.
+
+.. variable:: CPACK_WIX_INSTALL_SCOPE
+
+ .. versionadded:: 3.29
+
+ This variable can be optionally set to specify the ``InstallScope``
+ of the installer:
+
+ ``perMachine`` (default)
+   Create an installer that installs for all users and requires
+   administrative privileges.  Start menu entries created by the
+   installer are visible to all users.
+
+ ``perUser``
+   Not yet supported. This is reserved for future use.
+
+ ``NONE``
+   Create an installer without any ``InstallScope`` attribute.
+
+   .. deprecated:: 3.29
+
+     This value is only for compatibility with the inconsistent behavior used
+     by CPack 3.28 and older.  The resulting installer requires administrative
+     privileges and installs into the system-wide ``ProgramFiles`` directory,
+     but the start menu entry and uninstaller registration are created only
+     for the current user.
+
+ See https://wixtoolset.org/docs/v3/xsd/wix/package/
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index de19aa8..81e0e6f 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -338,7 +338,7 @@
 
   export: Increase maximum policy version in exported files to $prev
 
-  The files generatd by `install(EXPORT)` and `export()` commands
+  The files generated by `install(EXPORT)` and `export()` commands
   are known to work with policies as of CMake $prev, so enable them
   in sufficiently new CMake versions.
 
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 5b1939e..ddde877 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@
 .. toctree::
    :maxdepth: 1
 
+   CMP0157: Swift compilation mode is selected by an abstraction. </policy/CMP0157>
    CMP0156: De-duplicate libraries on link lines based on linker capabilities. </policy/CMP0156>
 
 Policies Introduced by CMake 3.28
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 28d61f7..0adfdfb 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -394,6 +394,7 @@
    /prop_tgt/STATIC_LIBRARY_FLAGS_CONFIG
    /prop_tgt/STATIC_LIBRARY_OPTIONS
    /prop_tgt/SUFFIX
+   /prop_tgt/Swift_COMPILATION_MODE
    /prop_tgt/Swift_DEPENDENCIES_FILE
    /prop_tgt/Swift_LANGUAGE_VERSION
    /prop_tgt/Swift_MODULE_DIRECTORY
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 5f47c6e..35b57a5 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -115,6 +115,7 @@
    /variable/CMAKE_SOURCE_DIR
    /variable/CMAKE_STATIC_LIBRARY_PREFIX
    /variable/CMAKE_STATIC_LIBRARY_SUFFIX
+   /variable/CMAKE_Swift_COMPILATION_MODE
    /variable/CMAKE_Swift_MODULE_DIRECTORY
    /variable/CMAKE_Swift_NUM_THREADS
    /variable/CMAKE_TOOLCHAIN_FILE
diff --git a/Help/policy/CMP0157.rst b/Help/policy/CMP0157.rst
new file mode 100644
index 0000000..a8f8210
--- /dev/null
+++ b/Help/policy/CMP0157.rst
@@ -0,0 +1,48 @@
+CMP0157
+-------
+
+.. versionadded:: 3.29
+
+Swift compilation mode is selected by an abstraction.
+
+The Swift compiler can compile modules in different modes. The desired build
+mode depends whether the developer is iterating and wants to incrementally make
+changes, or if they are building a release for distribution and want more
+optimizations applied to the resulting binary.
+
+CMake versions 3.26 through 3.28 build Swift binaries with whole-module
+optimizations enabled when configured in a non-debug build type.
+For CMake versions earlier than 3.26, the developer needs to specify
+the necessary flag manually for the :ref:`Ninja Generators`, and cannot
+not specify whole-module optimizations to the :generator:`Xcode` generator.
+
+CMake versions 3.29 and above prefer to set the compilation mode using
+the :prop_tgt:`Swift_COMPILATION_MODE` target property, which can be
+initialized by the :variable:`CMAKE_Swift_COMPILATION_MODE` variable.
+
+This policy provides compatibility for projects that have not been updated.
+The policy setting takes effect as of the first :command:`project` or
+:command:`enable_language` command that enables the ``Swift`` language.
+
+.. note::
+
+  Once the policy has taken effect at the top of a project, that choice
+  must be used throughout the tree. In projects that have nested projects
+  in subdirectories, be sure to convert everything together.
+
+The ``OLD`` behavior for this policy builds all Swift targets in
+``wholemodule`` mode for non-debug configurations.  :ref:`Ninja Generators`
+prepend the ``-wmo`` flag to the default set of Swift flags.
+The :generator:`Xcode` generator sets the ``SWIFT_COMPILATION_MODE``
+attribute to ``wholemodule`` in the generated Xcode project file.
+
+The ``NEW`` behavior for this policy is to apply the compilation mode specified
+in the :prop_tgt:`Swift_COMPILATION_MODE` target property, initialized as each
+target is created by the :variable:`CMAKE_Swift_COMPILATION_MODE` variable.
+
+This policy was introduced in CMake version 3.29. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike many policies, CMake version |release| does *not* warn when this policy
+is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt b/Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
new file mode 100644
index 0000000..b94380a
--- /dev/null
+++ b/Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
@@ -0,0 +1,19 @@
+``incremental``
+  Compiles each Swift source in the module separately, resulting in better
+  parallelism in the build. The compiler emits additional information into
+  the build directory improving rebuild performance when small changes are made
+  to the source between rebuilds. This is the best option to use while
+  iterating on changes in a project.
+
+``wholemodule``
+  Whole-module optimizations are slowest to compile, but results in the most
+  optimized library. The entire context is loaded into once instance of the
+  compiler, so there is no parallelism across source files in the module.
+
+``singlefile``
+  Compiles each source in a Swift modules separately, resulting in better
+  parallelism. Unlike the ``incremental`` build mode, no additional information
+  is emitted by the compiler during the build, so rebuilding after making small
+  changes to the source file will not run faster. This option should be used
+  sparingly, preferring ``incremental`` builds, unless working around a compiler
+  bug.
diff --git a/Help/prop_tgt/Swift_COMPILATION_MODE.rst b/Help/prop_tgt/Swift_COMPILATION_MODE.rst
new file mode 100644
index 0000000..e26474a
--- /dev/null
+++ b/Help/prop_tgt/Swift_COMPILATION_MODE.rst
@@ -0,0 +1,33 @@
+Swift_COMPILATION_MODE
+----------------------
+
+.. versionadded:: 3.29
+
+Specify how Swift compiles a target.
+
+The allowed values are:
+
+.. include:: Swift_COMPILATION_MODE-VALUES.txt
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>` to support
+per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+  add_library(foo foo.swift)
+  set_property(TARGET foo PROPERTY
+    Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
+
+sets the Swift compilation mode to wholemodule mode in the release configuration
+and sets the property to incremental mode in other configurations.
+
+The property is initialized from the value of the
+:variable:`CMAKE_Swift_COMPILATION_MODE` variable, if it is set. If the property
+is not set or is empty, then CMake uses the default value ``incremental`` to
+specify the swift compilation mode.
+
+.. note::
+
+   This property only has effect when policy :policy:`CMP0157` is set to ``NEW``
+   prior to the first :command:`project` or :command:`enable_language` command
+   that enables the Swift language.
diff --git a/Help/release/3.10.rst b/Help/release/3.10.rst
index 117415b..03fce92 100644
--- a/Help/release/3.10.rst
+++ b/Help/release/3.10.rst
@@ -263,7 +263,7 @@
 3.10.1
 ------
 
-* The :manual:`cmake-server(7)` ``codemodel`` response ``crossReferences``
+* The :manual:`cmake-server(7)` ``codemodel`` response cross-references
   field added by 3.10.0 has been dropped due to excessive memory usage.
   Another approach will be needed to provide backtrace information.
 
diff --git a/Help/release/3.21.rst b/Help/release/3.21.rst
index 91c3768..8da1c94 100644
--- a/Help/release/3.21.rst
+++ b/Help/release/3.21.rst
@@ -318,7 +318,7 @@
 * The :generator:`Visual Studio 17 2022` generator is now based on
   "Visual Studio 2022 Preview 4".  Previously it was based on "Preview 3.1".
 
-* The AMD ROCm Platform ``hipcc`` compiler was identifed by CMake 3.21.0
+* The AMD ROCm Platform ``hipcc`` compiler was identified by CMake 3.21.0
   through 3.21.2 as a distinct compiler with id ``ROCMClang``.  This has
   been removed because it caused regressions.  Instead:
 
diff --git a/Help/release/3.6.rst b/Help/release/3.6.rst
index b798f0d..cc0d5da 100644
--- a/Help/release/3.6.rst
+++ b/Help/release/3.6.rst
@@ -104,7 +104,7 @@
 -------
 
 * The :module:`CMakePushCheckState` module now pushes/pops/resets the variable
-  ``CMAKE_EXTRA_INCLUDE_FILE`` used in :module:`CheckTypeSize`.
+  ``CMAKE_EXTRA_INCLUDE_FILES`` used in :module:`CheckTypeSize`.
 
 * The :module:`ExternalProject` module leared the ``GIT_SHALLOW 1``
   option to perform a shallow clone of a Git repository.
diff --git a/Help/release/dev/wix-installscope.rst b/Help/release/dev/wix-installscope.rst
new file mode 100644
index 0000000..1978698
--- /dev/null
+++ b/Help/release/dev/wix-installscope.rst
@@ -0,0 +1,13 @@
+wix-installscope
+----------------
+
+* The :cpack_gen:`CPack WIX Generator` gained a new variable,
+  :variable:`CPACK_WIX_INSTALL_SCOPE`, to control the
+  ``InstallScope`` property of WiX MSI installers.
+
+* The :cpack_gen:`CPack WIX Generator` now produces WiX MSI installers
+  that create start menu and uninstall entries for all users by default,
+  as documented by the :variable:`CPACK_WIX_INSTALL_SCOPE` variable
+  ``perMachine`` value.  Previously, without a custom WiX template,
+  it produced installers that would only create start menu and uninstall
+  entries for the current user, even though they install for all users.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst b/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst
index b27a3d9..73bef87 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR.rst
@@ -12,7 +12,7 @@
 :command:`find_package` and :command:`FetchContent_MakeAvailable`.  The latter
 command may create files in the ``CMAKE_FIND_PACKAGE_REDIRECTS_DIR`` directory
 when it populates a dependency.  This allows subsequent calls to
-:command:`find_package` for the same dependency to re-use the populated
+:command:`find_package` for the same dependency to reuse the populated
 contents instead of trying to satisfy the dependency from somewhere external
 to the build.  Projects may also want to write files into this directory in
 some situations (see :ref:`FetchContent-find_package-integration-examples`
diff --git a/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst
new file mode 100644
index 0000000..5e55d8c
--- /dev/null
+++ b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst
@@ -0,0 +1,32 @@
+CMAKE_Swift_COMPILATION_MODE
+----------------------------
+
+.. versionadded:: 3.29
+
+Specify how Swift compiles a target. This variable is used to initialize the
+:prop_tgt:`Swift_COMPILATION_MODE` property on targets as they are created.
+
+The allowed values are:
+
+.. include:: ../prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
+
+Use :manual:`generator expressions <cmake-generator-expressions(7)>` to support
+per-configuration specification. For example, the code:
+
+.. code-block:: cmake
+
+   set(CMAKE_Swift_COMPILATION_MODE
+     "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
+
+sets the default Swift compilation mode to wholemodule mode when building a
+release configuration and to incremental mode in other configurations.
+
+If this variable is not set then the :prop_tgt:`Swift_COMPILATION_MODE` target
+property will not be set automatically. If that property is unset then CMake
+uses the default value ``incremental`` to build the Swift source files.
+
+.. note::
+
+   This property only has effect when policy :policy:`CMP0157` is set to ``NEW``
+   prior to the first :command:`project` or :command:`enable_language` command
+   that enables the Swift language.
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 665f309..998e476 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -67,7 +67,7 @@
 endif ()
 
 if(CMAKE_C_SIZEOF_DATA_PTR)
-  foreach(f ${CMAKE_C_ABI_FILES})
+  foreach(f IN LISTS CMAKE_C_ABI_FILES)
     include(${f})
   endforeach()
   unset(CMAKE_C_ABI_FILES)
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 0957d9b..4459898 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -46,7 +46,7 @@
 set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m)
 set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
 
-foreach (lang C OBJC OBJCXX)
+foreach (lang IN ITEMS C OBJC OBJCXX)
   if (CMAKE_${lang}_COMPILER_ID_RUN)
     foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
       list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 53abf37..3753d18 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -66,7 +66,7 @@
 endif ()
 
 if(CMAKE_CXX_SIZEOF_DATA_PTR)
-  foreach(f ${CMAKE_CXX_ABI_FILES})
+  foreach(f IN LISTS CMAKE_CXX_ABI_FILES)
     include(${f})
   endforeach()
   unset(CMAKE_CXX_ABI_FILES)
@@ -182,7 +182,7 @@
 endif()
 
 # Initialize CXX link type selection flags from C versions.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+foreach(type IN ITEMS SHARED_LIBRARY SHARED_MODULE EXE)
   if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
     set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
       ${CMAKE_${type}_LINK_STATIC_C_FLAGS})
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 3156ca9..0e41829 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -15,7 +15,7 @@
     set(_${lang}_COMPILER_LIST "${CMAKE_${lang}_COMPILER_LIST}")
     set(CMAKE_${lang}_COMPILER_LIST "")
     # Prefer vendors of compilers from reference languages.
-    foreach(l ${_languages})
+    foreach(l IN LISTS _languages)
       list(APPEND CMAKE_${lang}_COMPILER_LIST
         ${_${lang}_COMPILER_NAMES_${CMAKE_${l}_COMPILER_ID}})
     endforeach()
@@ -33,7 +33,7 @@
 
   # Look for directories containing compilers of reference languages.
   set(_${lang}_COMPILER_HINTS "${CMAKE_${lang}_COMPILER_HINTS}")
-  foreach(l ${_languages})
+  foreach(l IN LISTS _languages)
     if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}")
       get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH)
       if(IS_DIRECTORY "${_hint}")
@@ -99,7 +99,7 @@
     if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$")
       _query_xcrun("${CMAKE_MATCH_1}" RESULT_VAR xcrun_result)
     elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND")
-      foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
+      foreach(comp IN LISTS CMAKE_${lang}_COMPILER_LIST)
         _query_xcrun("${comp}" RESULT_VAR xcrun_result)
         if(xcrun_result)
           break()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 2c9b5b0..3ed7d58 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -140,11 +140,11 @@
   set(CMAKE_Fortran_COMPILER_ID_TOOL_MATCH_INDEX 2)
 
   set(_version_info "")
-  foreach(m MAJOR MINOR PATCH TWEAK)
+  foreach(m IN ITEMS MAJOR MINOR PATCH TWEAK)
     set(_COMP "_${m}")
     string(APPEND _version_info "
 #if defined(COMPILER_VERSION${_COMP})")
-    foreach(d 1 2 3 4 5 6 7 8)
+    foreach(d RANGE 1 8)
       string(APPEND _version_info "
 # undef DEC
 # undef HEX
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 0f71c6f..e364755 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -43,7 +43,7 @@
 endif ()
 
 if(CMAKE_Fortran_SIZEOF_DATA_PTR)
-  foreach(f ${CMAKE_Fortran_ABI_FILES})
+  foreach(f IN LISTS CMAKE_Fortran_ABI_FILES)
     include(${f})
   endforeach()
   unset(CMAKE_Fortran_ABI_FILES)
diff --git a/Modules/CMakeOBJCInformation.cmake b/Modules/CMakeOBJCInformation.cmake
index 4c697da..8b8f10e 100644
--- a/Modules/CMakeOBJCInformation.cmake
+++ b/Modules/CMakeOBJCInformation.cmake
@@ -67,7 +67,7 @@
 endif ()
 
 if(CMAKE_OBJC_SIZEOF_DATA_PTR)
-  foreach(f ${CMAKE_OBJC_ABI_FILES})
+  foreach(f IN LISTS CMAKE_OBJC_ABI_FILES)
     include(${f})
   endforeach()
   unset(CMAKE_OBJC_ABI_FILES)
diff --git a/Modules/CMakeOBJCXXCompiler.cmake.in b/Modules/CMakeOBJCXXCompiler.cmake.in
index d8b6ef0..6a80d50 100644
--- a/Modules/CMakeOBJCXXCompiler.cmake.in
+++ b/Modules/CMakeOBJCXXCompiler.cmake.in
@@ -50,7 +50,7 @@
   endforeach()
 endif()
 
-foreach (lang C CXX OBJC)
+foreach (lang IN ITEMS C CXX OBJC)
   foreach(extension IN LISTS CMAKE_OBJCXX_SOURCE_FILE_EXTENSIONS)
     if (CMAKE_${lang}_COMPILER_ID_RUN)
       list(REMOVE_ITEM CMAKE_${lang}_SOURCE_FILE_EXTENSIONS ${extension})
diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake
index a6d824f..da1d6c6 100644
--- a/Modules/CMakeOBJCXXInformation.cmake
+++ b/Modules/CMakeOBJCXXInformation.cmake
@@ -62,7 +62,7 @@
 endif ()
 
 if(CMAKE_OBJCXX_SIZEOF_DATA_PTR)
-  foreach(f ${CMAKE_OBJCXX_ABI_FILES})
+  foreach(f IN LISTS CMAKE_OBJCXX_ABI_FILES)
     include(${f})
   endforeach()
   unset(CMAKE_OBJCXX_ABI_FILES)
@@ -178,7 +178,7 @@
 endif()
 
 # Initialize OBJCXX link type selection flags from OBJC versions.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
+foreach(type IN ITEMS SHARED_LIBRARY SHARED_MODULE EXE)
   if(NOT CMAKE_${type}_LINK_STATIC_OBJCXX_FLAGS)
     set(CMAKE_${type}_LINK_STATIC_OBJCXX_FLAGS
       ${CMAKE_${type}_LINK_STATIC_OBJC_FLAGS})
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 1c6f0df..9f4ed34 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -68,30 +68,42 @@
 set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug -libc MTd)
 set(CMAKE_Swift_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -libc MDd)
 
+set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g")
+set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
+set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
+set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
+
 if(CMAKE_GENERATOR STREQUAL "Xcode")
+  string(APPEND CMAKE_Swift_FLAGS_DEBUG_INIT " ${CMAKE_Swift_FLAGS_DEBUG_LINKER_FLAGS}")
+  string(APPEND CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT " ${CMAKE_Swift_FLAGS_RELWITHDEBINFO_LINKER_FLAGS}")
+endif()
+
+# Warns if unset and uses old policy.
+# Old policy flag-smashes the wmo and incremental flags onto the compiler flags.
+# New policy respects the Swift_COMPILATION_MODE target property to add
+# incremental and wholemodule optimization flags as appropriate.
+cmake_policy(GET CMP0157 __SWIFT_COMP_MODE_CMP0157)
+if(__SWIFT_COMP_MODE_CMP0157 STREQUAL "NEW")
+  set(CMAKE_Swift_COMPILATION_MODE_DEFAULT "incremental")
+else()
   # Xcode has a separate Xcode project option (SWIFT_COMPILATION_MODE) used to set
   # whether compiling with whole-module optimizations or incrementally. Setting
   # these options here will have no effect when compiling with the built-in driver,
   # and will explode violently, leaving build products in the source directory, when
-  # using the old swift driver.
-  set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g ${CMAKE_Swift_FLAGS_DEBUG_LINKER_FLAGS}")
-  set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
-  set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g ${CMAKE_Swift_FLAGS_RELWITHDEBINFO_LINKER_FLAGS}")
-  set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
-else()
-  set(CMAKE_Swift_FLAGS_DEBUG_INIT "-Onone -g -incremental")
-  set(CMAKE_Swift_FLAGS_RELEASE_INIT "-O")
-  set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT "-O -g")
-  set(CMAKE_Swift_FLAGS_MINSIZEREL_INIT "-Osize")
-
-  # Enable Whole Module Optimization by default unless the old
-  # C++ driver is being used, which behaves differently under WMO.
-  if(NOT CMAKE_Swift_COMPILER_USE_OLD_DRIVER)
-    string(APPEND CMAKE_Swift_FLAGS_RELEASE_INIT " -wmo")
-    string(APPEND CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT " -wmo")
-    string(APPEND CMAKE_Swift_FLAGS_MINSIZEREL_INIT " -wmo")
+  # using the old swift driver. Don't append `-incremental` or `-wmo` to the
+  # flags in the Xcode generator.
+  if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+    # Enable Whole Module Optimization by default unless the old
+    # C++ driver is being used, which behaves differently under WMO.
+    if(NOT CMAKE_Swift_COMPILER_USE_OLD_DRIVER)
+      string(APPEND CMAKE_Swift_FLAGS_RELEASE_INIT " -wmo")
+      string(APPEND CMAKE_Swift_FLAGS_RELWITHDEBINFO_INIT " -wmo")
+      string(APPEND CMAKE_Swift_FLAGS_MINSIZEREL_INIT " -wmo")
+    endif()
+    string(APPEND CMAKE_Swift_FLAGS_DEBUG_INIT " -incremental")
   endif()
 endif()
+unset(__SWIFT_COMP_MODE_CMP0157)
 
 if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
   if(NOT DEFINED CMAKE_Swift_LINK_WHAT_YOU_USE_FLAG)
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 12b0976..27b7ae8 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -22,7 +22,7 @@
 effect or even a specific one is beyond the scope of this module.
 
 The check is only performed once, with the result cached in the variable named
-by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
 rather than performing the check again, even if the ``<code>`` changes. In
 order to force the check to be re-evaluated, the variable named by
 ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index ce4719a..79aca93 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -23,7 +23,7 @@
   expressions.
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index d5a8fda..e06bcca 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -22,7 +22,7 @@
   false (e.g. an empty string or an error message).
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index 4b33aa8..7531236 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -23,7 +23,7 @@
   expressions.
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 3402715..eb643eb 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -22,7 +22,7 @@
   false (e.g. an empty string or an error message).
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckCompilerFlag.cmake b/Modules/CheckCompilerFlag.cmake
index a18435b..0f2ec4c 100644
--- a/Modules/CheckCompilerFlag.cmake
+++ b/Modules/CheckCompilerFlag.cmake
@@ -23,7 +23,7 @@
 effect or even a specific one is beyond the scope of this module.
 
 The check is only performed once, with the result cached in the variable named
-by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
 rather than performing the check again, even if the ``<code>`` changes. In
 order to force the check to be re-evaluated, the variable named by
 ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index 9164565..81a2345 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -24,7 +24,7 @@
 effect or even a specific one is beyond the scope of this module.
 
 The check is only performed once, with the result cached in the variable named
-by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
 rather than performing the check again, even if the ``<code>`` changes. In
 order to force the check to be re-evaluated, the variable named by
 ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index 5158b7e..ed374ef 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -48,7 +48,7 @@
   ``.F90`` is a typical choice.
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index f996749..9bf9fb2 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -44,7 +44,7 @@
   ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead.
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckOBJCCompilerFlag.cmake b/Modules/CheckOBJCCompilerFlag.cmake
index 24bf0db..f6d259e 100644
--- a/Modules/CheckOBJCCompilerFlag.cmake
+++ b/Modules/CheckOBJCCompilerFlag.cmake
@@ -24,7 +24,7 @@
 effect or even a specific one is beyond the scope of this module.
 
 The check is only performed once, with the result cached in the variable named
-by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
 rather than performing the check again, even if the ``<code>`` changes. In
 order to force the check to be re-evaluated, the variable named by
 ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake
index 7663054..bc0cac1 100644
--- a/Modules/CheckOBJCSourceCompiles.cmake
+++ b/Modules/CheckOBJCSourceCompiles.cmake
@@ -25,7 +25,7 @@
   expressions.
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake
index a23a0c7..511cac6 100644
--- a/Modules/CheckOBJCSourceRuns.cmake
+++ b/Modules/CheckOBJCSourceRuns.cmake
@@ -24,7 +24,7 @@
   false (e.g. an empty string or an error message).
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckOBJCXXCompilerFlag.cmake b/Modules/CheckOBJCXXCompilerFlag.cmake
index ae2d907..32d50c9 100644
--- a/Modules/CheckOBJCXXCompilerFlag.cmake
+++ b/Modules/CheckOBJCXXCompilerFlag.cmake
@@ -24,7 +24,7 @@
 effect or even a specific one is beyond the scope of this module.
 
 The check is only performed once, with the result cached in the variable named
-by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
 rather than performing the check again, even if the ``<code>`` changes. In
 order to force the check to be re-evaluated, the variable named by
 ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake
index cfbda3a..366d7d5 100644
--- a/Modules/CheckOBJCXXSourceCompiles.cmake
+++ b/Modules/CheckOBJCXXSourceCompiles.cmake
@@ -25,7 +25,7 @@
   expressions.
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake
index b2831b6..49db3cb 100644
--- a/Modules/CheckOBJCXXSourceRuns.cmake
+++ b/Modules/CheckOBJCXXSourceRuns.cmake
@@ -24,7 +24,7 @@
   false (e.g. an empty string or an error message).
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckSourceCompiles.cmake b/Modules/CheckSourceCompiles.cmake
index 041b59c..af905a4 100644
--- a/Modules/CheckSourceCompiles.cmake
+++ b/Modules/CheckSourceCompiles.cmake
@@ -48,7 +48,7 @@
     HAVE_ERROR_STOP)
 
   The check is only performed once, with the result cached in the variable
-  named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+  named by ``<resultVar>``. Every subsequent CMake run will reuse this cached
   value rather than performing the check again, even if the ``<code>`` changes.
   In order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/CheckSourceRuns.cmake b/Modules/CheckSourceRuns.cmake
index 822ee07..75636f4 100644
--- a/Modules/CheckSourceRuns.cmake
+++ b/Modules/CheckSourceRuns.cmake
@@ -48,7 +48,7 @@
     HAVE_COARRAY)
 
   The check is only performed once, with the result cached in the variable named
-  by ``<resultVar>``. Every subsequent CMake run will re-use this cached value
+  by ``<resultVar>``. Every subsequent CMake run will reuse this cached value
   rather than performing the check again, even if the ``<code>`` changes. In
   order to force the check to be re-evaluated, the variable named by
   ``<resultVar>`` must be manually removed from the cache.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 45c5470..a9663d6 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -54,7 +54,7 @@
 # NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
 # release following that (March 2012), and the first minor release to
 # support -std=c++11. Prior to that, support for C++11 features is technically
-# experiemental and possibly incomplete (see for example the note below about
+# experimental and possibly incomplete (see for example the note below about
 # cxx_variadic_template_template_parameters)
 # GNU does not define __cplusplus correctly before version 4.7.
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773
diff --git a/Modules/Compiler/LCC-CXX-FeatureTests.cmake b/Modules/Compiler/LCC-CXX-FeatureTests.cmake
index 45c5470..a9663d6 100644
--- a/Modules/Compiler/LCC-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/LCC-CXX-FeatureTests.cmake
@@ -54,7 +54,7 @@
 # NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
 # release following that (March 2012), and the first minor release to
 # support -std=c++11. Prior to that, support for C++11 features is technically
-# experiemental and possibly incomplete (see for example the note below about
+# experimental and possibly incomplete (see for example the note below about
 # cxx_variadic_template_template_parameters)
 # GNU does not define __cplusplus correctly before version 4.7.
 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=1773
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 801a8de..b2816a5 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -522,7 +522,7 @@
   use the same generator as the main project, but the ``CMAKE_GENERATOR``
   option can be given to override this.  The project is responsible for
   adding any toolchain details, flags or other settings it wants to
-  re-use from the main project or otherwise specify (see ``CMAKE_ARGS``,
+  reuse from the main project or otherwise specify (see ``CMAKE_ARGS``,
   ``CMAKE_CACHE_ARGS`` and ``CMAKE_CACHE_DEFAULT_ARGS`` below).
 
   For non-CMake external projects, the ``CONFIGURE_COMMAND`` option must
@@ -593,7 +593,7 @@
   as initial defaults only and will not override any variables already set
   from a previous run. Use this option with care, as it can lead to
   different behavior depending on whether the build starts from a fresh
-  build directory or re-uses previous build contents.
+  build directory or reuses previous build contents.
 
   .. versionadded:: 3.15
     If the CMake generator is the ``Green Hills MULTI`` and not overridden,
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 0d7f1a4..203a473 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1423,7 +1423,7 @@
   # Only deal with CMake style paths from here on out
   file(TO_CMAKE_PATH "${path}" bpath)
   if (IS_ABSOLUTE "${bpath}")
-    # Absolute paths are generally unnessary, especially if something like
+    # Absolute paths are generally unnecessary, especially if something like
     # file(GLOB_RECURSE) is used to pick up the files.
 
     string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos)
diff --git a/Modules/FindEnvModules.cmake b/Modules/FindEnvModules.cmake
index dab97ac..5337e4f 100644
--- a/Modules/FindEnvModules.cmake
+++ b/Modules/FindEnvModules.cmake
@@ -81,7 +81,7 @@
 
 .. command:: env_module
 
-  Execute an aribitrary module command:
+  Execute an arbitrary module command:
 
   .. code-block:: cmake
 
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index e3246c6..a25f113 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -436,7 +436,7 @@
   # a particular MPICH derivate might check compiler interoperability.
   # Intel MPI in particular does this with I_MPI_CHECK_COMPILER.
   file(TO_NATIVE_PATH "${CMAKE_${LANG}_COMPILER}" _MPI_UNDERLAYING_COMPILER)
-  # On Windows, the Intel MPI batch scripts can only work with filnames - Full paths will break them.
+  # On Windows, the Intel MPI batch scripts can only work with filenames - Full paths will break them.
   # Due to the lack of other MPICH-based wrappers for Visual C++, we may treat this as default.
   if(MSVC)
     get_filename_component(_MPI_UNDERLAYING_COMPILER "${_MPI_UNDERLAYING_COMPILER}" NAME)
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index c68e18d..7691eb7 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -181,7 +181,7 @@
 
   # For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
   # CMake doesn't display the -framework Cocoa string in the UI even
-  # though it actually is there if I modify a pre-used variable.
+  # though it actually is there if I modify a preused variable.
   # I think it has something to do with the CACHE STRING.
   # So I use a temporary variable until the end so I can set the
   # "real" variable in one-shot.
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index d863e3c..3443959 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -196,7 +196,7 @@
 
     # I expect that MPGLIB, VOC, WAV, AIFF, and SHN are compiled in statically.
     # I think Timidity is also compiled in statically.
-    # I've never had to explcitly link against Quicktime, so I'll skip that for now.
+    # I've never had to explicitly link against Quicktime, so I'll skip that for now.
 
     set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARY})
 
diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake
index 40e767b..a01c010 100644
--- a/Modules/FindXCTest.cmake
+++ b/Modules/FindXCTest.cmake
@@ -74,7 +74,7 @@
   # platform directory which is not added to the CMAKE_FIND_ROOT_PATH
   # (only to CMAKE_SYSTEM_FRAMEWORK_PATH) and therefore not searched.
   #
-  # Until this is properly addressed, temporaily add the platform
+  # Until this is properly addressed, temporarily add the platform
   # directory to CMAKE_FIND_ROOT_PATH.
   list(APPEND CMAKE_FIND_ROOT_PATH "${_CMAKE_OSX_SYSROOT_PATH}/../..")
 endif()
diff --git a/Modules/Internal/CPack/CPackFreeBSD.cmake b/Modules/Internal/CPack/CPackFreeBSD.cmake
index c35089c..46a7bf7 100644
--- a/Modules/Internal/CPack/CPackFreeBSD.cmake
+++ b/Modules/Internal/CPack/CPackFreeBSD.cmake
@@ -66,7 +66,7 @@
     )
 
 # There's really only one homepage for a project, so
-# re-use the Debian setting if it's there.
+# reuse the Debian setting if it's there.
 _cpack_freebsd_fallback_var("CPACK_FREEBSD_PACKAGE_WWW"
     "CPACK_PACKAGE_HOMEPAGE_URL"
     "CPACK_DEBIAN_PACKAGE_HOMEPAGE"
diff --git a/Modules/Internal/CPack/CPackWIX.cmake b/Modules/Internal/CPack/CPackWIX.cmake
index d1875f2..5fe772e 100644
--- a/Modules/Internal/CPack/CPackWIX.cmake
+++ b/Modules/Internal/CPack/CPackWIX.cmake
@@ -18,3 +18,7 @@
 if(NOT CPACK_WIX_LIGHT_EXECUTABLE)
   message(FATAL_ERROR "Could not find the WiX light executable.")
 endif()
+
+if(NOT DEFINED CPACK_WIX_INSTALL_SCOPE)
+  set(CPACK_WIX_INSTALL_SCOPE "perMachine")
+endif()
diff --git a/Modules/Internal/CPack/WIX.template.in b/Modules/Internal/CPack/WIX.template.in
index c0bf935..fdd8278 100644
--- a/Modules/Internal/CPack/WIX.template.in
+++ b/Modules/Internal/CPack/WIX.template.in
@@ -12,7 +12,12 @@
         Manufacturer="$(var.CPACK_PACKAGE_VENDOR)"
         UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)">
 
+
+        <?if $(var.CPACK_WIX_INSTALL_SCOPE) = "NONE" ?>
         <Package InstallerVersion="301" Compressed="yes"/>
+        <?else?>
+        <Package InstallerVersion="301" Compressed="yes" InstallScope="$(var.CPACK_WIX_INSTALL_SCOPE)"/>
+        <?endif?>
 
         <Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/>
 
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 99fd617..1724c3a 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -1521,7 +1521,7 @@
       "CLASSES;CLASSPATH;DEPENDS"
       ${ARGN})
 
-    # ckeck parameters
+    # check parameters
     if (NOT _create_javah_TARGET AND NOT _create_javah_GENERATED_FILES)
       message (FATAL_ERROR "create_javah: TARGET or GENERATED_FILES must be specified.")
     endif()
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 13eade3..eafb3b8 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -450,7 +450,6 @@
   cmUVProcessChain.h
   cmUVStream.h
   cmUVStreambuf.h
-  cmUVSignalHackRAII.h
   cmVariableWatch.cxx
   cmVariableWatch.h
   cmVersion.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index aa65ea7..e21c3cb 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 28)
-set(CMake_VERSION_PATCH 20231117)
+set(CMake_VERSION_PATCH 20231120)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 5077596..6918b5e 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -359,6 +359,7 @@
                     GetOption("CPACK_PACKAGE_NAME"));
   CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER");
   CopyDefinition(includeFile, "CPACK_WIX_UI_REF");
+  CopyDefinition(includeFile, "CPACK_WIX_INSTALL_SCOPE");
 }
 
 void cmCPackWIXGenerator::CreateWiXPropertiesIncludeFile()
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index b51de84..b1afdc0 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -962,15 +962,15 @@
     "== .*[0-9,]+ bytes in [0-9,]+ blocks are still reachable"
     " in loss record [0-9,]+ of [0-9,]+");
   cmsys::RegularExpression vgUMC(
-    "== .*Conditional jump or move depends on uninitialised value\\(s\\)");
+    "== .*Conditional jump or move depends on uninitiali[sz]ed value\\(s\\)");
   cmsys::RegularExpression vgUMR1(
-    "== .*Use of uninitialised value of size [0-9,]+");
+    "== .*Use of uninitiali[sz]ed value of size [0-9,]+");
   cmsys::RegularExpression vgUMR2("== .*Invalid read of size [0-9,]+");
   cmsys::RegularExpression vgUMR3("== .*Jump to the invalid address ");
   cmsys::RegularExpression vgUMR4(
     "== .*Syscall param .* contains "
-    "uninitialised or unaddressable byte\\(s\\)");
-  cmsys::RegularExpression vgUMR5("== .*Syscall param .* uninitialised");
+    "uninitiali[sz]ed or unaddressable byte\\(s\\)");
+  cmsys::RegularExpression vgUMR5("== .*Syscall param .* uninitiali[sz]ed");
   cmsys::RegularExpression vgIPW("== .*Invalid write of size [0-9,]+");
   cmsys::RegularExpression vgABR("== .*pthread_mutex_unlock: mutex is "
                                  "locked by a different thread");
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index b91f07c..bfdec9f 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -40,7 +40,6 @@
 #include "cmRange.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
-#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
 #include "cmWorkingDirectory.h"
 
 namespace cmsys {
@@ -132,9 +131,6 @@
   if (this->HasCycles || this->HasInvalidGeneratedResourceSpec) {
     return;
   }
-#ifdef CMAKE_UV_SIGNAL_HACK
-  cmUVSignalHackRAII hackRAII;
-#endif
   this->TestHandler->SetMaxIndex(this->FindMaxIndex());
 
   this->Loop.init();
diff --git a/Source/Modules/CMakeBuildUtilities.cmake b/Source/Modules/CMakeBuildUtilities.cmake
index 94896ab..4e7f0fe 100644
--- a/Source/Modules/CMakeBuildUtilities.cmake
+++ b/Source/Modules/CMakeBuildUtilities.cmake
@@ -4,7 +4,7 @@
 # Originally it was a macro in the root `CMakeLists.txt` with the comment
 # "Simply to improve readability...".
 # However, as part of the modernization refactoring it was moved into a
-# separate file cuz adding library alises wasn't possible inside the
+# separate file cuz adding library aliases wasn't possible inside the
 # macro.
 #-----------------------------------------------------------------------
 
@@ -170,7 +170,7 @@
   CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
   CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
   if(NOT CMAKE_USE_SYSTEM_NGHTTP2)
-    # Configure after curl to re-use some check results.
+    # Configure after curl to reuse some check results.
     add_subdirectory(Utilities/cmnghttp2)
     CMAKE_SET_TARGET_FOLDER(cmnghttp2 "Utilities/3rdParty")
   endif()
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 655f4bc..2e6cd40 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -549,7 +549,7 @@
       sf->SourceExtension =
         cmSystemTools::GetFilenameLastExtension(sf->FullPath);
 
-      // Store the proxy in the map so it can be re-used and deleted later.
+      // Store the proxy in the map so it can be reused and deleted later.
       i = cmCPluginAPISourceFiles.emplace(rsf, std::move(sf)).first;
     }
     return i->second.get();
@@ -584,7 +584,7 @@
   sf->SourceName = osf->SourceName;
   sf->SourceExtension = osf->SourceExtension;
 
-  // Store the proxy in the map so it can be re-used and deleted later.
+  // Store the proxy in the map so it can be reused and deleted later.
   auto* value = sf.get();
   cmCPluginAPISourceFiles[rsf] = std::move(sf);
   return value;
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index ea9e51d..8a8f8bd 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -181,7 +181,7 @@
 The final list of items produced by this procedure consists of the
 original user link line followed by minimal additional items needed to
 satisfy dependencies.  The final list is then filtered to de-duplicate
-items that we know the linker will re-use automatically (shared libs).
+items that we know the linker will reuse automatically (shared libs).
 
 */
 
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index f54f550..297ae1d 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -2591,7 +2591,7 @@
   // If the rpath will be replaced at install time, prepare space.
   if (!for_install && this->RuntimeUseChrpath) {
     if (!rpath.empty()) {
-      // Add one trailing separator so the linker does not re-use the
+      // Add one trailing separator so the linker does not reuse the
       // rpath .dynstr entry for a symbol name that happens to match
       // the end of the rpath string.
       rpath += this->GetRuntimeSep();
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 7f7c747..fa30b06 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -904,6 +904,14 @@
               ? "NEW"
               : "OLD");
 
+    /* Set the appropriate policy information for Swift compilation mode */
+    fprintf(
+      fout, "cmake_policy(SET CMP0157 %s)\n",
+      this->Makefile->GetDefinition("CMAKE_Swift_COMPILATION_MODE_DEFAULT")
+          .IsEmpty()
+        ? "OLD"
+        : "NEW");
+
     // Workaround for -Wl,-headerpad_max_install_names issue until we can avoid
     // adding that flag in the platform and compiler language files
     fprintf(fout,
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 7538a7f..5d2b045 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -59,7 +59,7 @@
     this->GlobalGenerator->GetProjectMap();
 
   // loop projects and locate the root project.
-  // and extract the information for creating the worspace
+  // and extract the information for creating the workspace
   // root makefile
   for (auto const& it : projectMap) {
     cmLocalGenerator* lg = it.second[0];
diff --git a/Source/cmFileTimes.cxx b/Source/cmFileTimes.cxx
index bd896f5..0aaab1d 100644
--- a/Source/cmFileTimes.cxx
+++ b/Source/cmFileTimes.cxx
@@ -70,7 +70,7 @@
 {
   std::unique_ptr<Times> ptr;
   if (this->IsValid()) {
-    // Invalidate this and re-use times
+    // Invalidate this and reuse times
     ptr.swap(this->times);
   } else {
     ptr = cm::make_unique<Times>();
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index adca9ce..8c46124 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -7014,7 +7014,7 @@
   cmHeadToLinkInterfaceMap& hm = this->GetHeadToLinkInterfaceMap(config);
 
   // If the link interface does not depend on the head target
-  // then re-use the one from the head we computed first.
+  // then reuse the one from the head we computed first.
   if (!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) {
     head = hm.begin()->first;
   }
@@ -7142,7 +7142,7 @@
        : this->GetHeadToLinkInterfaceMap(config));
 
   // If the link interface does not depend on the head target
-  // then re-use the one from the head we computed first.
+  // then reuse the one from the head we computed first.
   if (!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) {
     head = hm.begin()->first;
   }
@@ -7664,7 +7664,7 @@
        : this->GetHeadToLinkInterfaceMap(config));
 
   // If the link interface does not depend on the head target
-  // then re-use the one from the head we computed first.
+  // then reuse the one from the head we computed first.
   if (!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) {
     headTarget = hm.begin()->first;
   }
@@ -8224,7 +8224,7 @@
        : this->GetHeadToLinkImplementationMap(config));
 
   // If the link implementation does not depend on the head target
-  // then re-use the one from the head we computed first.
+  // then reuse the one from the head we computed first.
   if (!hm.empty() && !hm.begin()->second.HadHeadSensitiveCondition) {
     head = hm.begin()->first;
   }
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 3f9bcd5..b659c9b 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1884,7 +1884,7 @@
       }
       lg->AddUnityBuild(gt.get());
       lg->AddISPCDependencies(gt.get());
-      // Targets that re-use a PCH are handled below.
+      // Targets that reuse a PCH are handled below.
       if (!gt->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) {
         lg->AddPchDependencies(gt.get());
       }
@@ -1896,7 +1896,7 @@
       if (!gt->CanCompileSources()) {
         continue;
       }
-      // Handle targets that re-use a PCH from an above-handled target.
+      // Handle targets that reuse a PCH from an above-handled target.
       if (gt->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) {
         lg->AddPchDependencies(gt.get());
       }
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 2e6ed37..1429ee3 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2479,6 +2479,25 @@
       buildSettings->AddAttribute("SWIFT_ACTIVE_COMPILATION_CONDITIONS",
                                   swiftDefs.CreateList());
     }
+
+    if (cm::optional<cmSwiftCompileMode> swiftCompileMode =
+          this->CurrentLocalGenerator->GetSwiftCompileMode(gtgt, configName)) {
+      switch (*swiftCompileMode) {
+        case cmSwiftCompileMode::Wholemodule:
+          buildSettings->AddAttribute("SWIFT_COMPILATION_MODE",
+                                      this->CreateString("wholemodule"));
+          break;
+        case cmSwiftCompileMode::Incremental:
+        case cmSwiftCompileMode::Singlefile:
+          break;
+        case cmSwiftCompileMode::Unknown:
+          this->CurrentLocalGenerator->IssueMessage(
+            MessageType::AUTHOR_WARNING,
+            cmStrCat("Unknown Swift_COMPILATION_MODE on target '",
+                     gtgt->GetName(), "'"));
+          break;
+      }
+    }
   }
 
   std::string extraLinkOptionsVar;
@@ -4610,6 +4629,10 @@
     buildSettings->AddAttribute("CODE_SIGNING_ALLOWED",
                                 this->CreateString("NO"));
   }
+
+  // This code supports the OLD behavior of CMP0157. We should be able to
+  // remove computing the debug configuration set once the old behavior is
+  // removed.
   auto debugConfigs = this->GetCMakeInstance()->GetDebugConfigs();
   std::set<std::string> debugConfigSet(debugConfigs.begin(),
                                        debugConfigs.end());
@@ -4619,9 +4642,16 @@
 
     cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);
 
-    if (debugConfigSet.count(cmSystemTools::UpperCase(config.first)) == 0) {
-      buildSettingsForCfg->AddAttribute("SWIFT_COMPILATION_MODE",
-                                        this->CreateString("wholemodule"));
+    // Supports the OLD behavior of CMP0157. CMP0157 OLD behavior globally set
+    // wholemodule compilation for all non-debug configurations, for all
+    // targets.
+    if (this->CurrentMakefile
+          ->GetDefinition("CMAKE_Swift_COMPILATION_MODE_DEFAULT")
+          .IsEmpty()) {
+      if (debugConfigSet.count(cmSystemTools::UpperCase(config.first)) == 0) {
+        buildSettingsForCfg->AddAttribute("SWIFT_COMPILATION_MODE",
+                                          this->CreateString("wholemodule"));
+      }
     }
 
     // Put this last so it can override existing settings
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index be18c29..eaf38d4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1651,6 +1651,39 @@
   if (lang == "Fortran") {
     this->AppendFlags(compileFlags,
                       this->GetTargetFortranFlags(target, config));
+  } else if (lang == "Swift") {
+    // Only set the compile mode if CMP0157 is set
+    if (cm::optional<cmSwiftCompileMode> swiftCompileMode =
+          this->GetSwiftCompileMode(target, config)) {
+      std::string swiftCompileModeFlag;
+      switch (*swiftCompileMode) {
+        case cmSwiftCompileMode::Incremental: {
+          swiftCompileModeFlag = "-incremental";
+          if (cmValue flag =
+                mf->GetDefinition("CMAKE_Swift_COMPILE_OPTIONS_INCREMENTAL")) {
+            swiftCompileModeFlag = *flag;
+          }
+          break;
+        }
+        case cmSwiftCompileMode::Wholemodule: {
+          swiftCompileModeFlag = "-wmo";
+          if (cmValue flag =
+                mf->GetDefinition("CMAKE_Swift_COMPILE_OPTIONS_WMO")) {
+            swiftCompileModeFlag = *flag;
+          }
+          break;
+        }
+        case cmSwiftCompileMode::Singlefile:
+          break;
+        case cmSwiftCompileMode::Unknown: {
+          this->IssueMessage(
+            MessageType::AUTHOR_WARNING,
+            cmStrCat("Unknown Swift_COMPILATION_MODE on target '",
+                     target->GetName(), "'"));
+        }
+      }
+      this->AppendFlags(compileFlags, swiftCompileModeFlag);
+    }
   }
 
   this->AddCMP0018Flags(compileFlags, target, lang, config);
@@ -2955,6 +2988,34 @@
   return msvcDebugInformationFormat;
 }
 
+cm::optional<cmSwiftCompileMode> cmLocalGenerator::GetSwiftCompileMode(
+  cmGeneratorTarget const* target, std::string const& config)
+{
+  cmMakefile const* mf = this->GetMakefile();
+  cmValue const swiftCompileModeDefault =
+    mf->GetDefinition("CMAKE_Swift_COMPILATION_MODE_DEFAULT");
+  if (!cmNonempty(swiftCompileModeDefault)) {
+    return {};
+  }
+  cmValue swiftCompileMode = target->GetProperty("Swift_COMPILATION_MODE");
+  if (!swiftCompileMode) {
+    swiftCompileMode = swiftCompileModeDefault;
+  }
+
+  std::string const expandedCompileMode =
+    cmGeneratorExpression::Evaluate(*swiftCompileMode, this, config, target);
+  if (expandedCompileMode == "wholemodule") {
+    return cmSwiftCompileMode::Wholemodule;
+  }
+  if (expandedCompileMode == "singlefile") {
+    return cmSwiftCompileMode::Singlefile;
+  }
+  if (expandedCompileMode == "incremental") {
+    return cmSwiftCompileMode::Incremental;
+  }
+  return cmSwiftCompileMode::Unknown;
+}
+
 namespace {
 
 inline void RegisterUnitySources(cmGeneratorTarget* target, cmSourceFile* sf,
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index a61def9..af5b35e 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -67,6 +67,15 @@
   Link
 };
 
+/** What compilation mode the swift files are in */
+enum class cmSwiftCompileMode
+{
+  Wholemodule,
+  Incremental,
+  Singlefile,
+  Unknown,
+};
+
 /** Target and source file which have a specific output.  */
 struct cmSourcesWithOutput
 {
@@ -549,6 +558,10 @@
                               const std::string& prop,
                               const std::string& config);
 
+  // Return Swift_COMPILATION_MODE value if CMP0157 is NEW.
+  cm::optional<cmSwiftCompileMode> GetSwiftCompileMode(
+    cmGeneratorTarget const* target, std::string const& config);
+
 protected:
   // The default implementation converts to a Windows shortpath to
   // help older toolchains handle spaces and such.  A generator may
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e055a34..aafef44 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3728,7 +3728,7 @@
 
   // make sure the same generator is used
   // use this program as the cmake to be run, it should not
-  // be run that way but the cmake object requires a vailid path
+  // be run that way but the cmake object requires a valid path
   cmake cm(cmake::RoleProject, cmState::Project,
            cmState::ProjectKind::TryCompile);
   auto gg = cm.CreateGlobalGenerator(this->GetGlobalGenerator()->GetName());
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 8aace68..7964f32 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -477,7 +477,10 @@
   SELECT(                                                                     \
     POLICY, CMP0156,                                                          \
     "De-duplicate libraries on link lines based on linker capabilities.", 3,  \
-    29, 0, cmPolicies::WARN)
+    29, 0, cmPolicies::WARN)                                                  \
+  SELECT(POLICY, CMP0157,                                                     \
+         "Swift compilation mode selected by an abstraction.", 3, 29, 0,      \
+         cmPolicies::WARN)
 
 #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
 #define CM_FOR_EACH_POLICY_ID(POLICY)                                         \
@@ -518,7 +521,8 @@
   F(CMP0142)                                                                  \
   F(CMP0154)                                                                  \
   F(CMP0155)                                                                  \
-  F(CMP0156)
+  F(CMP0156)                                                                  \
+  F(CMP0157)
 
 #define CM_FOR_EACH_CUSTOM_COMMAND_POLICY(F)                                  \
   F(CMP0116)                                                                  \
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 663c9d4..169d808 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -439,6 +439,7 @@
   // ---- Swift
   { "Swift_LANGUAGE_VERSION"_s, IC::CanCompileSources },
   { "Swift_MODULE_DIRECTORY"_s, IC::CanCompileSources },
+  { "Swift_COMPILATION_MODE"_s, IC::CanCompileSources },
   // ---- moc
   { "AUTOMOC"_s, IC::CanCompileSources },
   { "AUTOMOC_COMPILER_PREDEFINES"_s, IC::CanCompileSources },
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index 34e6a70..951ef3b 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -44,7 +44,7 @@
   this->loop.reset();
 }
 
-uv_loop_ptr::operator uv_loop_t*()
+uv_loop_ptr::operator uv_loop_t*() const
 {
   return this->loop.get();
 }
@@ -97,13 +97,19 @@
 }
 
 template <typename T>
+uv_handle_ptr_base_<T>::operator bool() const
+{
+  return this->handle.get();
+}
+
+template <typename T>
 void uv_handle_ptr_base_<T>::reset()
 {
   this->handle.reset();
 }
 
 template <typename T>
-uv_handle_ptr_base_<T>::operator uv_handle_t*()
+uv_handle_ptr_base_<T>::operator uv_handle_t*() const
 {
   return reinterpret_cast<uv_handle_t*>(this->handle.get());
 }
@@ -248,12 +254,20 @@
 }
 #endif
 
+int uv_idle_ptr::init(uv_loop_t& loop, void* data)
+{
+  this->allocate(data);
+  return uv_idle_init(&loop, *this);
+}
+
 template class uv_handle_ptr_base_<uv_handle_t>;
 
 #define UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(NAME)                              \
   template class uv_handle_ptr_base_<uv_##NAME##_t>;                          \
   template class uv_handle_ptr_<uv_##NAME##_t>;
 
+UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(idle)
+
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(signal)
 
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(pipe)
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index 027d690..e1bf0d0 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -61,7 +61,7 @@
    * Allow less verbose calling of uv_loop_* functions
    * @return reinterpreted handle
    */
-  operator uv_loop_t*();
+  operator uv_loop_t*() const;
 
   uv_loop_t* get() const;
   uv_loop_t* operator->() const noexcept;
@@ -130,6 +130,8 @@
   uv_handle_ptr_base_(std::nullptr_t) {}
   ~uv_handle_ptr_base_() { this->reset(); }
 
+  explicit operator bool() const;
+
   /**
    * Properly close the handle if needed and sets the inner handle to nullptr
    */
@@ -139,7 +141,7 @@
    * Allow less verbose calling of uv_handle_* functions
    * @return reinterpreted handle
    */
-  operator uv_handle_t*();
+  operator uv_handle_t*() const;
 
   T* get() const;
   T* operator->() const noexcept;
@@ -194,6 +196,13 @@
   void send();
 };
 
+struct uv_idle_ptr : public uv_handle_ptr_<uv_idle_t>
+{
+  CM_INHERIT_CTOR(uv_idle_ptr, uv_handle_ptr_, <uv_idle_t>);
+
+  int init(uv_loop_t& loop, void* data = nullptr);
+};
+
 struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t>
 {
   CM_INHERIT_CTOR(uv_signal_ptr, uv_handle_ptr_, <uv_signal_t>);
@@ -253,6 +262,8 @@
 
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(async)
 
+UV_HANDLE_PTR_INSTANTIATE_EXTERN(idle)
+
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(signal)
 
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(pipe)
diff --git a/Source/cmUVSignalHackRAII.h b/Source/cmUVSignalHackRAII.h
deleted file mode 100644
index 60e4ca8..0000000
--- a/Source/cmUVSignalHackRAII.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file Copyright.txt or https://cmake.org/licensing for details.  */
-#pragma once
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include <cm3p/uv.h>
-
-#if defined(CMAKE_USE_SYSTEM_LIBUV) && !defined(_WIN32) &&                    \
-  UV_VERSION_MAJOR == 1 && UV_VERSION_MINOR < 19
-#  define CMAKE_UV_SIGNAL_HACK
-#  include "cmUVHandlePtr.h"
-/*
-   libuv does not use SA_RESTART on its signal handler, but C++ streams
-   depend on it for reliable i/o operations.  This RAII helper convinces
-   libuv to install its handler, and then revises the handler to add the
-   SA_RESTART flag.  We use a distinct uv loop that never runs to avoid
-   ever really getting a callback.  libuv may fill the hack loop's signal
-   pipe and then stop writing, but that won't break any real loops.
- */
-class cmUVSignalHackRAII
-{
-  uv_loop_t HackLoop;
-  cm::uv_signal_ptr HackSignal;
-  static void HackCB(uv_signal_t*, int) {}
-
-public:
-  cmUVSignalHackRAII()
-  {
-    uv_loop_init(&this->HackLoop);
-    this->HackSignal.init(this->HackLoop);
-    this->HackSignal.start(HackCB, SIGCHLD);
-    struct sigaction hack_sa;
-    sigaction(SIGCHLD, nullptr, &hack_sa);
-    if (!(hack_sa.sa_flags & SA_RESTART)) {
-      hack_sa.sa_flags |= SA_RESTART;
-      sigaction(SIGCHLD, &hack_sa, nullptr);
-    }
-  }
-  ~cmUVSignalHackRAII()
-  {
-    this->HackSignal.stop();
-    uv_loop_close(&this->HackLoop);
-  }
-};
-#endif
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
index 27cdbba..dd8f459 100644
--- a/Source/cmWorkerPool.cxx
+++ b/Source/cmWorkerPool.cxx
@@ -18,7 +18,6 @@
 #include "cmRange.h"
 #include "cmStringAlgorithms.h"
 #include "cmUVHandlePtr.h"
-#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
 
 /**
  * @brief libuv pipe buffer class
@@ -516,9 +515,6 @@
   static void UVSlotEnd(uv_async_t* handle);
 
   // -- UV loop
-#ifdef CMAKE_UV_SIGNAL_HACK
-  std::unique_ptr<cmUVSignalHackRAII> UVHackRAII;
-#endif
   std::unique_ptr<uv_loop_t> UVLoop;
   cm::uv_async_ptr UVRequestBegin;
   cm::uv_async_ptr UVRequestEnd;
@@ -563,9 +559,6 @@
 {
   // Initialize libuv loop
   uv_disable_stdio_inheritance();
-#ifdef CMAKE_UV_SIGNAL_HACK
-  UVHackRAII = cm::make_unique<cmUVSignalHackRAII>();
-#endif
   this->UVLoop = cm::make_unique<uv_loop_t>();
   uv_loop_init(this->UVLoop.get());
 }
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 2b7f2cc..562d5e6 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -298,14 +298,6 @@
 set(KWSYS_HEADER_INSTALL_DIR)
 set(KWSYS_LIBRARY_INSTALL_DIR)
 
-# Generated source files will need this header.
-string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}"
-  KWSYS_IN_SOURCE_BUILD)
-if(NOT KWSYS_IN_SOURCE_BUILD)
-  configure_file(${PROJECT_SOURCE_DIR}/kwsysPrivate.h
-    ${PROJECT_BINARY_DIR}/kwsysPrivate.h COPYONLY IMMEDIATE)
-endif()
-
 # Select plugin module file name convention.
 if(NOT KWSYS_DynamicLoader_PREFIX)
   set(KWSYS_DynamicLoader_PREFIX ${CMAKE_SHARED_MODULE_PREFIX})
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 3bb7869..cefb922 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -412,18 +412,6 @@
 }
 #endif
 
-#if !defined(_WIN32) && defined(__COMO__)
-// Hack for como strict mode to avoid defining _SVID_SOURCE or _BSD_SOURCE.
-extern "C" {
-extern FILE* popen(__const char* __command, __const char* __modes) __THROW;
-extern int pclose(FILE* __stream) __THROW;
-extern char* realpath(__const char* __restrict __name,
-                      char* __restrict __resolved) __THROW;
-extern char* strdup(__const char* __s) __THROW;
-extern int putenv(char* __string) __THROW;
-}
-#endif
-
 namespace KWSYS_NAMESPACE {
 
 double SystemTools::GetTime()
@@ -777,12 +765,16 @@
 bool SystemTools::GetEnv(const char* key, std::string& result)
 {
 #if defined(_WIN32)
-  const std::wstring wkey = Encoding::ToWide(key);
-  const wchar_t* wv = _wgetenv(wkey.c_str());
-  if (wv) {
-    result = Encoding::ToNarrow(wv);
-    return true;
+  auto wide_key = Encoding::ToWide(key);
+  auto result_size = GetEnvironmentVariableW(wide_key.data(), nullptr, 0);
+  if (result_size <= 0) {
+    return false;
   }
+  std::wstring wide_result;
+  wide_result.resize(result_size - 1);
+  GetEnvironmentVariableW(wide_key.data(), &wide_result[0], result_size);
+  result = Encoding::ToNarrow(wide_result);
+  return true;
 #else
   const char* v = getenv(key);
   if (v) {
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index 0bdd44c..1b08778 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -37,7 +37,7 @@
       return false;
     }
 
-    if (signal.get()) {
+    if (signal) {
       std::cerr << "Loop exited with signal not being cleaned up" << std::endl;
       return false;
     }
@@ -125,13 +125,13 @@
     pipe.init(Loop, 0);
 
     cm::uv_stream_ptr stream = std::move(pipe);
-    if (pipe.get()) {
+    if (pipe) {
       std::cerr << "Move should be sure to invalidate the previous ptr"
                 << std::endl;
       return false;
     }
     cm::uv_handle_ptr handle = std::move(stream);
-    if (stream.get()) {
+    if (stream) {
       std::cerr << "Move should be sure to invalidate the previous ptr"
                 << std::endl;
       return false;
@@ -162,6 +162,7 @@
     uv_async_ptr _13;
     uv_signal_ptr _14;
     uv_handle_ptr _15;
+    uv_idle_ptr _16;
   };
 
   allTypes a;
@@ -218,6 +219,30 @@
   return true;
 }
 
+static bool testIdle()
+{
+  bool idled = false;
+
+  cm::uv_loop_ptr loop;
+  loop.init();
+
+  cm::uv_idle_ptr idle;
+  idle.init(*loop, &idled);
+  uv_idle_start(idle, [](uv_idle_t* handle) {
+    auto idledPtr = static_cast<bool*>(handle->data);
+    *idledPtr = true;
+    uv_idle_stop(handle);
+  });
+  uv_run(loop, UV_RUN_DEFAULT);
+
+  if (!idled) {
+    std::cerr << "uv_idle_ptr did not trigger callback" << std::endl;
+    return false;
+  }
+
+  return true;
+}
+
 int testUVRAII(int, char** const)
 {
   if (!testAsyncShutdown()) {
@@ -230,5 +255,6 @@
   passed = testAllMoves() && passed;
   passed = testLoopReset() && passed;
   passed = testLoopDestructor() && passed;
+  passed = testIdle() && passed;
   return passed ? 0 : -1;
 }
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
index b61e62d..64a8885 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
@@ -1,4 +1,4 @@
-# prevent older policies from interfearing with this script
+# prevent older policies from interfering with this script
 cmake_policy(PUSH)
 cmake_policy(VERSION ${CMAKE_VERSION})
 
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
index 260a0f8..07281ed 100644
--- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake
@@ -1,4 +1,4 @@
-# prevent older policies from interfearing with this script
+# prevent older policies from interfering with this script
 cmake_policy(PUSH)
 cmake_policy(VERSION ${CMAKE_VERSION})
 
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index 8e0b611..d3263c3 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -17,7 +17,7 @@
 set(CVS "@CVS_EXECUTABLE@")
 message(" cvs = ${CVS}")
 
-# Pre-pending :local: prevents cvs from trying to interpret Windows drive
+# Prepending :local: prevents cvs from trying to interpret Windows drive
 # letters, like "C:", as host names.
 set(REPO ":local:${TOP}/repo")
 
diff --git a/Tests/HIP/MathFunctions/main.hip b/Tests/HIP/MathFunctions/main.hip
index 8a6e77f..dae89fc 100644
--- a/Tests/HIP/MathFunctions/main.hip
+++ b/Tests/HIP/MathFunctions/main.hip
@@ -18,11 +18,15 @@
 {
   std::unique_ptr<T> cpu_T(new T);
   T* gpu_T = nullptr;
-  hipMalloc((void**)&gpu_T, sizeof(T));
+  if (hipMalloc((void**)&gpu_T, sizeof(T)) != hipSuccess) {
+    return false;
+  }
+  bool result = true;
   hipLaunchKernelGGL(global_entry_point, 1, 1, 0, 0, f, gpu_T);
-  hipMemcpy(cpu_T.get(), gpu_T, sizeof(T), hipMemcpyDeviceToHost);
-  hipFree(gpu_T);
-  return (*cpu_T == expected);
+  result = hipMemcpy(cpu_T.get(), gpu_T, sizeof(T), hipMemcpyDeviceToHost) == hipSuccess && result;
+  result = hipFree(gpu_T) == hipSuccess && result;
+  result = *cpu_T == expected && result;
+  return result;
 }
 }
 
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 9f8a459..6cdb241 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -87,10 +87,6 @@
 # Some tests use python for extra checks.
 find_package(Python QUIET)
 
-if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1)
-  set(Swift_ARGS -DXCODE_BELOW_6_1=1)
-endif()
-
 # Test MSVC for older host CMake versions, and test
 # WIN32/CMAKE_C_COMPILER_ID to fix check on Intel for Windows.
 if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel")
@@ -435,7 +431,9 @@
   add_RunCMake_test(RuntimePath)
 endif()
 add_RunCMake_test(ScriptMode)
-add_RunCMake_test(Swift -DCMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
+add_RunCMake_test(Swift -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+                        -DCMake_TEST_Swift=${CMake_TEST_Swift}
+                        -DXCODE_VERSION=${XCODE_VERSION})
 add_RunCMake_test(TargetArtifacts -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
 add_RunCMake_test(TargetObjects)
 add_RunCMake_test(TargetProperties)
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake
index 23b3006..c85783d 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
 enable_language (Swift)
 include(CheckCompilerFlag)
 
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake
index 767fa69..8edff2c 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
 enable_language(Swift)
 include(CheckSourceCompiles)
 
diff --git a/Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt b/Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt
new file mode 100644
index 0000000..82adcda
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt
@@ -0,0 +1,3 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+  Unknown Swift_COMPILATION_MODE on target 'greetings_who_knows'
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Swift/CMP0157-NEW.cmake b/Tests/RunCMake/Swift/CMP0157-NEW.cmake
new file mode 100644
index 0000000..96c2ff4
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-NEW.cmake
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.28)
+
+cmake_policy(SET CMP0157 NEW)
+include(CMP0157-common.cmake)
diff --git a/Tests/RunCMake/Swift/CMP0157-OLD.cmake b/Tests/RunCMake/Swift/CMP0157-OLD.cmake
new file mode 100644
index 0000000..6b0ec94
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-OLD.cmake
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.28)
+
+cmake_policy(SET CMP0157 OLD)
+include(CMP0157-common.cmake)
diff --git a/Tests/RunCMake/Swift/CMP0157-WARN.cmake b/Tests/RunCMake/Swift/CMP0157-WARN.cmake
new file mode 100644
index 0000000..7d8c01d
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-WARN.cmake
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+
+include(CMP0157-common.cmake)
diff --git a/Tests/RunCMake/Swift/CMP0157-common.cmake b/Tests/RunCMake/Swift/CMP0157-common.cmake
new file mode 100644
index 0000000..53f14f6
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-common.cmake
@@ -0,0 +1,19 @@
+enable_language(Swift)
+
+add_executable(greetings_default hello.swift)
+
+add_executable(greetings_wmo hello.swift)
+set_target_properties(greetings_wmo PROPERTIES
+  Swift_COMPILATION_MODE "wholemodule")
+
+add_executable(greetings_incremental hello.swift)
+set_target_properties(greetings_incremental PROPERTIES
+  Swift_COMPILATION_MODE "incremental")
+
+add_executable(greetings_singlefile hello.swift)
+set_target_properties(greetings_singlefile PROPERTIES
+  Swift_COMPILATION_MODE "singlefile")
+
+add_executable(greetings_who_knows hello.swift)
+set_target_properties(greetings_who_knows PROPERTIES
+  Swift_COMPILATION_MODE "not-a-real-mode")
diff --git a/Tests/RunCMake/Swift/IncrementalSwift.cmake b/Tests/RunCMake/Swift/IncrementalSwift.cmake
index 092269f..08f3fff 100644
--- a/Tests/RunCMake/Swift/IncrementalSwift.cmake
+++ b/Tests/RunCMake/Swift/IncrementalSwift.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
 enable_language(Swift)
 
 # Write initial files to build directory
diff --git a/Tests/RunCMake/Swift/NoWorkToDo.cmake b/Tests/RunCMake/Swift/NoWorkToDo.cmake
index 51c2ff3..02b9195 100644
--- a/Tests/RunCMake/Swift/NoWorkToDo.cmake
+++ b/Tests/RunCMake/Swift/NoWorkToDo.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
 enable_language(Swift)
 add_executable(hello1 hello.swift)
 set_target_properties(hello1 PROPERTIES ENABLE_EXPORTS TRUE)
diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake
index 5537c01..68d10ea 100644
--- a/Tests/RunCMake/Swift/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake
@@ -1,11 +1,15 @@
 include(RunCMake)
 
 if(RunCMake_GENERATOR STREQUAL Xcode)
-  if(XCODE_BELOW_6_1)
+  if(XCODE_VERSION VERSION_LESS 6.1)
     run_cmake(XcodeTooOld)
+  elseif(CMake_TEST_Swift)
+    run_cmake(CMP0157-NEW)
+    run_cmake(CMP0157-OLD)
+    run_cmake(CMP0157-WARN)
   endif()
 elseif(RunCMake_GENERATOR STREQUAL Ninja)
-  if(CMAKE_Swift_COMPILER)
+  if(CMake_TEST_Swift)
     if (CMAKE_SYSTEM_NAME MATCHES "Windows")
       run_cmake_with_options(Win32ExecutableDisallowed)
     else()
@@ -45,11 +49,19 @@
       run_cmake_command(IncrementalSwift-second ${CMAKE_COMMAND} --build ${IncrementalSwift_TEST_BINARY_DIR} -- -d explain)
     endblock()
 
+    run_cmake(CMP0157-NEW)
+    run_cmake(CMP0157-OLD)
+    run_cmake(CMP0157-WARN)
+
   endif()
 elseif(RunCMake_GENERATOR STREQUAL "Ninja Multi-Config")
-  if(CMAKE_Swift_COMPILER)
+  if(CMake_TEST_Swift)
     set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release")
     run_cmake(SwiftSimple)
+
+    run_cmake(CMP0157-NEW)
+    run_cmake(CMP0157-OLD)
+    run_cmake(CMP0157-WARN)
     unset(RunCMake_TEST_OPTIONS)
   endif()
 else()
diff --git a/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake b/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake
index 02d5447..5e52911 100644
--- a/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake
+++ b/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
 enable_language(Swift)
 add_executable(E E.swift)
 set_target_properties(E PROPERTIES
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 389a63e..11d59b7 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -40,6 +40,7 @@
    \* CMP0154
    \* CMP0155
    \* CMP0156
+   \* CMP0157
 
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake
index 6612375..c177447 100644
--- a/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake
@@ -12,7 +12,7 @@
 # clear the log file
 file(REMOVE "${LOG_FILE}.2343")
 
-# create an example error from address santizer
+# create an example error from address sanitizer
 
 file(APPEND "${LOG_FILE}.2343"
 "=================================================================
diff --git a/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake
index 4b5ef7e..9030009 100644
--- a/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake
@@ -12,7 +12,7 @@
 # clear the log file
 file(REMOVE "${LOG_FILE}.2343")
 
-# create an error of each type of thread santizer
+# create an error of each type of thread sanitizer
 # these names come from tsan_report.cc in llvm
 
 file(APPEND "${LOG_FILE}.2343"
diff --git a/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake
index 96251c3..29244b2 100644
--- a/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake
@@ -23,7 +23,7 @@
 # clear the log file
 file(REMOVE "${LOG_FILE}.2343")
 
-# create an error of each type of thread santizer
+# create an error of each type of thread sanitizer
 # these names come from tsan_report.cc in llvm
 foreach(error_type ${error_types} )
 
diff --git a/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake
index 7160280..77481b1 100644
--- a/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake
@@ -12,7 +12,7 @@
 # clear the log file
 file(REMOVE "${LOG_FILE}.2343")
 
-# create an error like undefined behavior santizer creates;
+# create an error like undefined behavior sanitizer creates;
 # these names come from ubsan_diag.cc and ubsan_handlers.cc
 # in llvm
 
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index 13cf2b1..7de1e04 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -2,6 +2,9 @@
 if(POLICY CMP0126)
   cmake_policy(SET CMP0126 NEW)
 endif()
+if(POLICY CMP0157)
+  cmake_policy(SET CMP0157 NEW)
+endif()
 
 # NOTE: Force the Release mode configuration as there are some issues with the
 # debug information handling on macOS on certain Xcode builds.
@@ -54,3 +57,20 @@
 if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.2)
   add_subdirectory("SwiftPlugin")
 endif()
+
+function(test_cmp0157_default mode)
+
+  cmake_policy(GET CMP0157 cmp0157_wmo)
+  if(cmp0157_wmo STREQUAL "NEW")
+    set(CMAKE_Swift_COMPILATION_MODE "${mode}")
+    add_executable(hi_${mode} main.swift)
+    get_target_property(${mode}_swift_comp_mode hi_${mode} "Swift_COMPILATION_MODE")
+    if(NOT ${mode}_swift_comp_mode STREQUAL ${mode})
+      message(SEND_ERROR "expected ${mode} -- found ${${mode}_swift_comp_mode}")
+    endif()
+  endif()
+endfunction()
+
+test_cmp0157_default("wholemodule")
+test_cmp0157_default("incremental")
+test_cmp0157_default("singlefile")
diff --git a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt
index 317ed47..ded6b23 100644
--- a/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt
+++ b/Tests/UseSWIG/ModuleVersion2/CMakeLists.txt
@@ -39,7 +39,7 @@
     COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_PROPERTY:example1,SWIG_SUPPORT_FILES_DIRECTORY>${PS}$<TARGET_FILE_DIR:example1>"
     "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py")
 
-  # re-use sample interface file for another plugin
+  # reuse sample interface file for another plugin
   swig_add_library(example2
                    LANGUAGE python
                    SOURCES ../example.i ../example.cxx)
@@ -73,7 +73,7 @@
     "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py")
 
 
-  # re-use sample interface file for another plugin
+  # reuse sample interface file for another plugin
   swig_add_library(example4
                    LANGUAGE python
                    SOURCES ../example.i ../example.cxx)
diff --git a/Tests/UseSWIG/MultipleModules/CMakeLists.txt b/Tests/UseSWIG/MultipleModules/CMakeLists.txt
index 4380080..4db28d7 100644
--- a/Tests/UseSWIG/MultipleModules/CMakeLists.txt
+++ b/Tests/UseSWIG/MultipleModules/CMakeLists.txt
@@ -38,7 +38,7 @@
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python")
 target_link_libraries(example1 PRIVATE Python::Module)
 
-# re-use sample interface file for another plugin
+# reuse sample interface file for another plugin
 set_property(SOURCE "../example.i" APPEND PROPERTY
   GENERATED_INCLUDE_DIRECTORIES ${PERL_INCLUDE_PATH})
 separate_arguments(c_flags UNIX_COMMAND "${PERL_EXTRA_C_FLAGS}")
diff --git a/Tests/UseSWIG/MultiplePython/CMakeLists.txt b/Tests/UseSWIG/MultiplePython/CMakeLists.txt
index cf6c80e..0cb6f19 100644
--- a/Tests/UseSWIG/MultiplePython/CMakeLists.txt
+++ b/Tests/UseSWIG/MultiplePython/CMakeLists.txt
@@ -36,7 +36,7 @@
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Python2")
 target_link_libraries(example1 PRIVATE Python2::Module)
 
-# re-use sample interface file for another plugin
+# reuse sample interface file for another plugin
 swig_add_library(example2
                  LANGUAGE python
                  OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Python3"
diff --git a/Utilities/ClangTidyModule/Tests/RunClangTidy.cmake b/Utilities/ClangTidyModule/Tests/RunClangTidy.cmake
index 98770d7..813d184 100644
--- a/Utilities/ClangTidyModule/Tests/RunClangTidy.cmake
+++ b/Utilities/ClangTidyModule/Tests/RunClangTidy.cmake
@@ -47,6 +47,7 @@
   string(APPEND RunClangTidy_TEST_FAILED "Expected result: 0, actual result: ${result}\n")
 endif()
 
+string(REGEX REPLACE " +\n" "\n" actual_stdout "${actual_stdout}")
 string(REGEX REPLACE "\n+$" "" actual_stdout "${actual_stdout}")
 if(NOT actual_stdout STREQUAL expect_stdout)
   string(REPLACE "\n" "\n  " expect_stdout_formatted "  ${expect_stdout}")
diff --git a/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat-stdout.txt b/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat-stdout.txt
index 1b2d6e7..9c4108c 100644
--- a/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat-stdout.txt
+++ b/Utilities/ClangTidyModule/Tests/cmake-ostringstream-use-cmstrcat-stdout.txt
@@ -1,6 +1,6 @@
 cmake-ostringstream-use-cmstrcat.cxx:5:3: warning: use strings and cmStrCat() instead of std::ostringstream [cmake-ostringstream-use-cmstrcat]
-  std::ostringstream test;
-  ^
+    5 |   std::ostringstream test;
+      |   ^
 cmake-ostringstream-use-cmstrcat.cxx:8:13: warning: use strings and cmStrCat() instead of std::ostringstream [cmake-ostringstream-use-cmstrcat]
-void check2(std::ostringstream& test2)
-            ^
+    8 | void check2(std::ostringstream& test2)
+      |             ^
diff --git a/Utilities/ClangTidyModule/Tests/cmake-string-concatenation-use-cmstrcat-stdout.txt b/Utilities/ClangTidyModule/Tests/cmake-string-concatenation-use-cmstrcat-stdout.txt
index 83b8d83..749ad45 100644
--- a/Utilities/ClangTidyModule/Tests/cmake-string-concatenation-use-cmstrcat-stdout.txt
+++ b/Utilities/ClangTidyModule/Tests/cmake-string-concatenation-use-cmstrcat-stdout.txt
@@ -1,124 +1,124 @@
 cmake-string-concatenation-use-cmstrcat.cxx:17:12: warning: use cmStrCat() instead of string concatenation [cmake-string-concatenation-use-cmstrcat]
-  concat = a + b;
-           ^ ~
-           cmStrCat( , )
+   17 |   concat = a + b;
+      |            ^ ~
+      |            cmStrCat( , )
 cmake-string-concatenation-use-cmstrcat.cxx:17:12: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:17:14: note: FIX-IT applied suggested code changes
-  concat = a + b;
-             ^
+   17 |   concat = a + b;
+      |              ^
 cmake-string-concatenation-use-cmstrcat.cxx:17:17: note: FIX-IT applied suggested code changes
-  concat = a + b;
-                ^
+   17 |   concat = a + b;
+      |                 ^
 cmake-string-concatenation-use-cmstrcat.cxx:18:12: warning: use cmStrCat() instead of string concatenation [cmake-string-concatenation-use-cmstrcat]
-  concat = a + " and this is a string literal";
-           ^ ~
-           cmStrCat( ,                        )
+   18 |   concat = a + " and this is a string literal";
+      |            ^ ~
+      |            cmStrCat( ,                        )
 cmake-string-concatenation-use-cmstrcat.cxx:18:12: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:18:14: note: FIX-IT applied suggested code changes
-  concat = a + " and this is a string literal";
-             ^
+   18 |   concat = a + " and this is a string literal";
+      |              ^
 cmake-string-concatenation-use-cmstrcat.cxx:18:47: note: FIX-IT applied suggested code changes
-  concat = a + " and this is a string literal";
-                                              ^
+   18 |   concat = a + " and this is a string literal";
+      |                                               ^
 cmake-string-concatenation-use-cmstrcat.cxx:19:12: warning: use cmStrCat() instead of string concatenation [cmake-string-concatenation-use-cmstrcat]
-  concat = a + 'O';
-           ^ ~
-           cmStrCat( , )
+   19 |   concat = a + 'O';
+      |            ^ ~
+      |            cmStrCat( , )
 cmake-string-concatenation-use-cmstrcat.cxx:19:12: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:19:14: note: FIX-IT applied suggested code changes
-  concat = a + 'O';
-             ^
+   19 |   concat = a + 'O';
+      |              ^
 cmake-string-concatenation-use-cmstrcat.cxx:19:19: note: FIX-IT applied suggested code changes
-  concat = a + 'O';
-                  ^
+   19 |   concat = a + 'O';
+      |                   ^
 cmake-string-concatenation-use-cmstrcat.cxx:20:12: warning: use cmStrCat() instead of string concatenation [cmake-string-concatenation-use-cmstrcat]
-  concat = "This is a string literal" + b;
-           ^                          ~
-           cmStrCat(                  ,  )
+   20 |   concat = "This is a string literal" + b;
+      |            ^                          ~
+      |            cmStrCat(                  ,  )
 cmake-string-concatenation-use-cmstrcat.cxx:20:12: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:20:39: note: FIX-IT applied suggested code changes
-  concat = "This is a string literal" + b;
-                                      ^
+   20 |   concat = "This is a string literal" + b;
+      |                                       ^
 cmake-string-concatenation-use-cmstrcat.cxx:20:42: note: FIX-IT applied suggested code changes
-  concat = "This is a string literal" + b;
-                                         ^
+   20 |   concat = "This is a string literal" + b;
+      |                                          ^
 cmake-string-concatenation-use-cmstrcat.cxx:21:12: warning: use cmStrCat() instead of string concatenation [cmake-string-concatenation-use-cmstrcat]
-  concat = 'O' + a;
-           ^   ~
-           cmStrCat( , )
+   21 |   concat = 'O' + a;
+      |            ^   ~
+      |            cmStrCat( , )
 cmake-string-concatenation-use-cmstrcat.cxx:21:12: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:21:16: note: FIX-IT applied suggested code changes
-  concat = 'O' + a;
-               ^
+   21 |   concat = 'O' + a;
+      |                ^
 cmake-string-concatenation-use-cmstrcat.cxx:21:19: note: FIX-IT applied suggested code changes
-  concat = 'O' + a;
-                  ^
+   21 |   concat = 'O' + a;
+      |                   ^
 cmake-string-concatenation-use-cmstrcat.cxx:22:12: warning: use cmStrCat() instead of string concatenation [cmake-string-concatenation-use-cmstrcat]
-  concat = a + " and this is a string literal" + 'O' + b;
-           ^ ~                                 ~     ~
-           cmStrCat( ,                         ,     ,  )
+   22 |   concat = a + " and this is a string literal" + 'O' + b;
+      |            ^ ~                                 ~     ~
+      |            cmStrCat( ,                         ,     ,  )
 cmake-string-concatenation-use-cmstrcat.cxx:22:12: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:22:14: note: FIX-IT applied suggested code changes
-  concat = a + " and this is a string literal" + 'O' + b;
-             ^
+   22 |   concat = a + " and this is a string literal" + 'O' + b;
+      |              ^
 cmake-string-concatenation-use-cmstrcat.cxx:22:48: note: FIX-IT applied suggested code changes
-  concat = a + " and this is a string literal" + 'O' + b;
-                                               ^
+   22 |   concat = a + " and this is a string literal" + 'O' + b;
+      |                                                ^
 cmake-string-concatenation-use-cmstrcat.cxx:22:54: note: FIX-IT applied suggested code changes
-  concat = a + " and this is a string literal" + 'O' + b;
-                                                     ^
+   22 |   concat = a + " and this is a string literal" + 'O' + b;
+      |                                                      ^
 cmake-string-concatenation-use-cmstrcat.cxx:22:57: note: FIX-IT applied suggested code changes
-  concat = a + " and this is a string literal" + 'O' + b;
-                                                        ^
+   22 |   concat = a + " and this is a string literal" + 'O' + b;
+      |                                                         ^
 cmake-string-concatenation-use-cmstrcat.cxx:24:10: warning: use cmStrCat() instead of string append [cmake-string-concatenation-use-cmstrcat]
-  concat += b;
-         ^~
-         = cmStrCat(concat, )
+   24 |   concat += b;
+      |          ^~
+      |          = cmStrCat(concat, )
 cmake-string-concatenation-use-cmstrcat.cxx:24:10: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:24:14: note: FIX-IT applied suggested code changes
-  concat += b;
-             ^
+   24 |   concat += b;
+      |              ^
 cmake-string-concatenation-use-cmstrcat.cxx:25:10: warning: use cmStrCat() instead of string append [cmake-string-concatenation-use-cmstrcat]
-  concat += " and this is a string literal";
-         ^~
-         = cmStrCat(concat,                )
+   25 |   concat += " and this is a string literal";
+      |          ^~
+      |          = cmStrCat(concat,                )
 cmake-string-concatenation-use-cmstrcat.cxx:25:10: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:25:44: note: FIX-IT applied suggested code changes
-  concat += " and this is a string literal";
-                                           ^
+   25 |   concat += " and this is a string literal";
+      |                                            ^
 cmake-string-concatenation-use-cmstrcat.cxx:26:10: warning: use cmStrCat() instead of string append [cmake-string-concatenation-use-cmstrcat]
-  concat += 'o';
-         ^~
-         = cmStrCat(concat, )
+   26 |   concat += 'o';
+      |          ^~
+      |          = cmStrCat(concat, )
 cmake-string-concatenation-use-cmstrcat.cxx:26:10: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:26:16: note: FIX-IT applied suggested code changes
-  concat += 'o';
-               ^
+   26 |   concat += 'o';
+      |                ^
 cmake-string-concatenation-use-cmstrcat.cxx:27:10: warning: use cmStrCat() instead of string append [cmake-string-concatenation-use-cmstrcat]
-  concat += b + " and this is a string literal " + 'o' + b;
-         ^~   ~                                  ~     ~
-         = cmStrCat(concat, ,                    ,     ,  )
+   27 |   concat += b + " and this is a string literal " + 'o' + b;
+      |          ^~   ~                                  ~     ~
+      |          = cmStrCat(concat, ,                    ,     ,  )
 cmake-string-concatenation-use-cmstrcat.cxx:27:10: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:27:15: note: FIX-IT applied suggested code changes
-  concat += b + " and this is a string literal " + 'o' + b;
-              ^
+   27 |   concat += b + " and this is a string literal " + 'o' + b;
+      |               ^
 cmake-string-concatenation-use-cmstrcat.cxx:27:50: note: FIX-IT applied suggested code changes
-  concat += b + " and this is a string literal " + 'o' + b;
-                                                 ^
+   27 |   concat += b + " and this is a string literal " + 'o' + b;
+      |                                                  ^
 cmake-string-concatenation-use-cmstrcat.cxx:27:56: note: FIX-IT applied suggested code changes
-  concat += b + " and this is a string literal " + 'o' + b;
-                                                       ^
+   27 |   concat += b + " and this is a string literal " + 'o' + b;
+      |                                                        ^
 cmake-string-concatenation-use-cmstrcat.cxx:27:59: note: FIX-IT applied suggested code changes
-  concat += b + " and this is a string literal " + 'o' + b;
-                                                          ^
+   27 |   concat += b + " and this is a string literal " + 'o' + b;
+      |                                                           ^
 cmake-string-concatenation-use-cmstrcat.cxx:30:12: warning: use cmStrCat() instead of string concatenation [cmake-string-concatenation-use-cmstrcat]
-  concat = p.first + p.second;
-           ^       ~
-           cmStrCat( ,       )
+   30 |   concat = p.first + p.second;
+      |            ^       ~
+      |            cmStrCat( ,       )
 cmake-string-concatenation-use-cmstrcat.cxx:30:12: note: FIX-IT applied suggested code changes
 cmake-string-concatenation-use-cmstrcat.cxx:30:20: note: FIX-IT applied suggested code changes
-  concat = p.first + p.second;
-                   ^
+   30 |   concat = p.first + p.second;
+      |                    ^
 cmake-string-concatenation-use-cmstrcat.cxx:30:30: note: FIX-IT applied suggested code changes
-  concat = p.first + p.second;
-                             ^
+   30 |   concat = p.first + p.second;
+      |                              ^
diff --git a/Utilities/ClangTidyModule/Tests/cmake-use-bespoke-enum-class-stdout.txt b/Utilities/ClangTidyModule/Tests/cmake-use-bespoke-enum-class-stdout.txt
index 5e0acdd..cc72402 100644
--- a/Utilities/ClangTidyModule/Tests/cmake-use-bespoke-enum-class-stdout.txt
+++ b/Utilities/ClangTidyModule/Tests/cmake-use-bespoke-enum-class-stdout.txt
@@ -1,18 +1,18 @@
 cmake-use-bespoke-enum-class.cxx:3:16: warning: use a bespoke enum class instead of booleans as parameters [cmake-use-bespoke-enum-class]
-bool function1(bool i)
-               ^
+    3 | bool function1(bool i)
+      |                ^
 cmake-use-bespoke-enum-class.cxx:8:15: warning: use a bespoke enum class instead of booleans as parameters [cmake-use-bespoke-enum-class]
-int function2(bool i)
-              ^
+    8 | int function2(bool i)
+      |               ^
 cmake-use-bespoke-enum-class.cxx:13:16: warning: use a bespoke enum class instead of booleans as parameters [cmake-use-bespoke-enum-class]
-char function3(bool i)
-               ^
+   13 | char function3(bool i)
+      |                ^
 cmake-use-bespoke-enum-class.cxx:18:16: warning: use a bespoke enum class instead of booleans as parameters [cmake-use-bespoke-enum-class]
-void function4(bool i)
-               ^
+   18 | void function4(bool i)
+      |                ^
 cmake-use-bespoke-enum-class.cxx:22:17: warning: use a bespoke enum class instead of booleans as parameters [cmake-use-bespoke-enum-class]
-float function5(bool i)
-                ^
+   22 | float function5(bool i)
+      |                 ^
 cmake-use-bespoke-enum-class.cxx:27:18: warning: use a bespoke enum class instead of booleans as parameters [cmake-use-bespoke-enum-class]
-double function6(bool i)
-                 ^
+   27 | double function6(bool i)
+      |                  ^
diff --git a/Utilities/ClangTidyModule/Tests/cmake-use-cmstrlen-stdout.txt b/Utilities/ClangTidyModule/Tests/cmake-use-cmstrlen-stdout.txt
index d18822a..dada356 100644
--- a/Utilities/ClangTidyModule/Tests/cmake-use-cmstrlen-stdout.txt
+++ b/Utilities/ClangTidyModule/Tests/cmake-use-cmstrlen-stdout.txt
@@ -1,52 +1,52 @@
 cmake-use-cmstrlen.cxx:26:9: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)strlen("Hello");
-        ^~~~~~
-        cmStrLen
+   26 |   (void)strlen("Hello");
+      |         ^~~~~~
+      |         cmStrLen
 cmake-use-cmstrlen.cxx:26:9: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:27:9: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)::strlen("Goodbye");
-        ^~~~~~~~
-        cmStrLen
+   27 |   (void)::strlen("Goodbye");
+      |         ^~~~~~~~
+      |         cmStrLen
 cmake-use-cmstrlen.cxx:27:9: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:28:9: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)std::strlen("Hola");
-        ^~~~~~~~~~~
-        cmStrLen
+   28 |   (void)std::strlen("Hola");
+      |         ^~~~~~~~~~~
+      |         cmStrLen
 cmake-use-cmstrlen.cxx:28:9: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:29:9: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)ns1::strlen("Bonjour");
-        ^~~~~~~~~~~
-        cmStrLen
+   29 |   (void)ns1::strlen("Bonjour");
+      |         ^~~~~~~~~~~
+      |         cmStrLen
 cmake-use-cmstrlen.cxx:29:9: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:30:10: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)(sizeof("Hallo") - 1);
-         ^~~~~~          ~~~
-         cmStrLen
+   30 |   (void)(sizeof("Hallo") - 1);
+      |          ^~~~~~          ~~~
+      |          cmStrLen
 cmake-use-cmstrlen.cxx:30:10: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:30:26: note: FIX-IT applied suggested code changes
-  (void)(sizeof("Hallo") - 1);
-                         ^
+   30 |   (void)(sizeof("Hallo") - 1);
+      |                          ^
 cmake-use-cmstrlen.cxx:31:14: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)(4 + sizeof("Hallo") - 1);
-             ^~~~~~          ~~~
-             cmStrLen
+   31 |   (void)(4 + sizeof("Hallo") - 1);
+      |              ^~~~~~          ~~~
+      |              cmStrLen
 cmake-use-cmstrlen.cxx:31:14: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:31:30: note: FIX-IT applied suggested code changes
-  (void)(4 + sizeof("Hallo") - 1);
-                             ^
+   31 |   (void)(4 + sizeof("Hallo") - 1);
+      |                              ^
 cmake-use-cmstrlen.cxx:32:10: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)(sizeof "Hallo" - 1);
-         ^~~~~~         ~~~
-         cmStrLen(      )
+   32 |   (void)(sizeof "Hallo" - 1);
+      |          ^~~~~~         ~~~
+      |          cmStrLen(      )
 cmake-use-cmstrlen.cxx:32:10: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:32:25: note: FIX-IT applied suggested code changes
-  (void)(sizeof "Hallo" - 1);
-                        ^
+   32 |   (void)(sizeof "Hallo" - 1);
+      |                         ^
 cmake-use-cmstrlen.cxx:33:14: warning: use cmStrLen() for string literals [cmake-use-cmstrlen]
-  (void)(4 + sizeof "Hallo" - 1);
-             ^~~~~~         ~~~
-             cmStrLen(      )
+   33 |   (void)(4 + sizeof "Hallo" - 1);
+      |              ^~~~~~         ~~~
+      |              cmStrLen(      )
 cmake-use-cmstrlen.cxx:33:14: note: FIX-IT applied suggested code changes
 cmake-use-cmstrlen.cxx:33:29: note: FIX-IT applied suggested code changes
-  (void)(4 + sizeof "Hallo" - 1);
-                            ^
+   33 |   (void)(4 + sizeof "Hallo" - 1);
+      |                             ^
diff --git a/Utilities/ClangTidyModule/Tests/cmake-use-cmsys-fstream-stdout.txt b/Utilities/ClangTidyModule/Tests/cmake-use-cmsys-fstream-stdout.txt
index d2c45f2..edf79bc 100644
--- a/Utilities/ClangTidyModule/Tests/cmake-use-cmsys-fstream-stdout.txt
+++ b/Utilities/ClangTidyModule/Tests/cmake-use-cmsys-fstream-stdout.txt
@@ -1,155 +1,155 @@
 cmake-use-cmsys-fstream.cxx:24:20: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  using ifstream = std::ifstream;
-                   ^~~~~~~~~~~~~
-                   cmsys::ifstream
+   24 |   using ifstream = std::ifstream;
+      |                    ^~~~~~~~~~~~~
+      |                    cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:24:20: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:25:20: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-  using ofstream = std::ofstream;
-                   ^~~~~~~~~~~~~
-                   cmsys::ofstream
+   25 |   using ofstream = std::ofstream;
+      |                    ^~~~~~~~~~~~~
+      |                    cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:25:20: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:26:19: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-  using fstream = std::fstream;
-                  ^~~~~~~~~~~~
-                  cmsys::fstream
+   26 |   using fstream = std::fstream;
+      |                   ^~~~~~~~~~~~
+      |                   cmsys::fstream
 cmake-use-cmsys-fstream.cxx:26:19: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:29:13: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-using ifs = std::ifstream;
-            ^~~~~~~~~~~~~
-            cmsys::ifstream
+   29 | using ifs = std::ifstream;
+      |             ^~~~~~~~~~~~~
+      |             cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:29:13: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:30:13: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-using ofs = std::ofstream;
-            ^~~~~~~~~~~~~
-            cmsys::ofstream
+   30 | using ofs = std::ofstream;
+      |             ^~~~~~~~~~~~~
+      |             cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:30:13: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:31:12: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-using fs = std::fstream;
-           ^~~~~~~~~~~~
-           cmsys::fstream
+   31 | using fs = std::fstream;
+      |            ^~~~~~~~~~~~
+      |            cmsys::fstream
 cmake-use-cmsys-fstream.cxx:31:12: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:41:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ifstream ifsUnqual;
-  ^~~~~~~~
-  cmsys::ifstream
+   41 |   ifstream ifsUnqual;
+      |   ^~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:41:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:42:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  std::ifstream ifsQual;
-  ^~~~~~~~~~~~~
-  cmsys::ifstream
+   42 |   std::ifstream ifsQual;
+      |   ^~~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:42:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:43:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::ifstream ifsNS;
-  ^~~~~~~~~~~~
-  cmsys::ifstream
+   43 |   ns::ifstream ifsNS;
+      |   ^~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:43:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:44:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::ns::ifstream ifsNested;
-  ^~~~~~~~~~~~~~~~
-  cmsys::ifstream
+   44 |   ns::ns::ifstream ifsNested;
+      |   ^~~~~~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:44:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:45:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::cl::ifstream ifsClass;
-  ^~~~~~~~~~~~~~~~
-  cmsys::ifstream
+   45 |   ns::cl::ifstream ifsClass;
+      |   ^~~~~~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:45:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:46:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::ifs ifsRenamed;
-  ^~~~~~~
-  cmsys::ifstream
+   46 |   ns::ifs ifsRenamed;
+      |   ^~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:46:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:48:3: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-  ofstream ofsUnqual;
-  ^~~~~~~~
-  cmsys::ofstream
+   48 |   ofstream ofsUnqual;
+      |   ^~~~~~~~
+      |   cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:48:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:49:3: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-  std::ofstream ofsQual;
-  ^~~~~~~~~~~~~
-  cmsys::ofstream
+   49 |   std::ofstream ofsQual;
+      |   ^~~~~~~~~~~~~
+      |   cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:49:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:50:3: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-  ns::ofstream ofsNS;
-  ^~~~~~~~~~~~
-  cmsys::ofstream
+   50 |   ns::ofstream ofsNS;
+      |   ^~~~~~~~~~~~
+      |   cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:50:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:51:3: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-  ns::ns::ofstream ofsNested;
-  ^~~~~~~~~~~~~~~~
-  cmsys::ofstream
+   51 |   ns::ns::ofstream ofsNested;
+      |   ^~~~~~~~~~~~~~~~
+      |   cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:51:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:52:3: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-  ns::cl::ofstream ofsClass;
-  ^~~~~~~~~~~~~~~~
-  cmsys::ofstream
+   52 |   ns::cl::ofstream ofsClass;
+      |   ^~~~~~~~~~~~~~~~
+      |   cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:52:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:53:3: warning: use cmsys::ofstream [cmake-use-cmsys-fstream]
-  ns::ofs ofsRenamed;
-  ^~~~~~~
-  cmsys::ofstream
+   53 |   ns::ofs ofsRenamed;
+      |   ^~~~~~~
+      |   cmsys::ofstream
 cmake-use-cmsys-fstream.cxx:53:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:55:3: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-  fstream fsUnqual;
-  ^~~~~~~
-  cmsys::fstream
+   55 |   fstream fsUnqual;
+      |   ^~~~~~~
+      |   cmsys::fstream
 cmake-use-cmsys-fstream.cxx:55:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:56:3: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-  std::fstream fsQual;
-  ^~~~~~~~~~~~
-  cmsys::fstream
+   56 |   std::fstream fsQual;
+      |   ^~~~~~~~~~~~
+      |   cmsys::fstream
 cmake-use-cmsys-fstream.cxx:56:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:57:3: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-  ns::fstream fsNS;
-  ^~~~~~~~~~~
-  cmsys::fstream
+   57 |   ns::fstream fsNS;
+      |   ^~~~~~~~~~~
+      |   cmsys::fstream
 cmake-use-cmsys-fstream.cxx:57:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:58:3: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-  ns::ns::fstream fsNested;
-  ^~~~~~~~~~~~~~~
-  cmsys::fstream
+   58 |   ns::ns::fstream fsNested;
+      |   ^~~~~~~~~~~~~~~
+      |   cmsys::fstream
 cmake-use-cmsys-fstream.cxx:58:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:59:3: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-  ns::ns::fstream fsClass;
-  ^~~~~~~~~~~~~~~
-  cmsys::fstream
+   59 |   ns::ns::fstream fsClass;
+      |   ^~~~~~~~~~~~~~~
+      |   cmsys::fstream
 cmake-use-cmsys-fstream.cxx:59:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:60:3: warning: use cmsys::fstream [cmake-use-cmsys-fstream]
-  ns::fs fsRenamed;
-  ^~~~~~
-  cmsys::fstream
+   60 |   ns::fs fsRenamed;
+      |   ^~~~~~
+      |   cmsys::fstream
 cmake-use-cmsys-fstream.cxx:60:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:62:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  std::ifstream::off_type offsetQual = 0;
-  ^~~~~~~~~~~~~
-  cmsys::ifstream
+   62 |   std::ifstream::off_type offsetQual = 0;
+      |   ^~~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:62:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:63:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ifstream::off_type offsetUnqual = 0;
-  ^~~~~~~~
-  cmsys::ifstream
+   63 |   ifstream::off_type offsetUnqual = 0;
+      |   ^~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:63:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:64:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::ifstream::off_type offsetNS = 0;
-  ^~~~~~~~~~~~
-  cmsys::ifstream
+   64 |   ns::ifstream::off_type offsetNS = 0;
+      |   ^~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:64:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:65:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::ns::ifstream::off_type offsetNested = 0;
-  ^~~~~~~~~~~~~~~~
-  cmsys::ifstream
+   65 |   ns::ns::ifstream::off_type offsetNested = 0;
+      |   ^~~~~~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:65:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:66:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::ns::ifstream::traits_type::off_type offsetTraitsNested = 0;
-  ^~~~~~~~~~~~~~~~
-  cmsys::ifstream
+   66 |   ns::ns::ifstream::traits_type::off_type offsetTraitsNested = 0;
+      |   ^~~~~~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:66:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:67:3: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  ns::cl::ifstream::traits_type::off_type offsetTraitsClass = 0;
-  ^~~~~~~~~~~~~~~~
-  cmsys::ifstream
+   67 |   ns::cl::ifstream::traits_type::off_type offsetTraitsClass = 0;
+      |   ^~~~~~~~~~~~~~~~
+      |   cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:67:3: note: FIX-IT applied suggested code changes
 cmake-use-cmsys-fstream.cxx:69:15: warning: use cmsys::ifstream [cmake-use-cmsys-fstream]
-  std::vector<ifstream> ifsVectorUnqual;
-              ^~~~~~~~
-              cmsys::ifstream
+   69 |   std::vector<ifstream> ifsVectorUnqual;
+      |               ^~~~~~~~
+      |               cmsys::ifstream
 cmake-use-cmsys-fstream.cxx:69:15: note: FIX-IT applied suggested code changes
diff --git a/Utilities/ClangTidyModule/Tests/cmake-use-pragma-once-stdout.txt b/Utilities/ClangTidyModule/Tests/cmake-use-pragma-once-stdout.txt
index e80e4a4..17c1345 100644
--- a/Utilities/ClangTidyModule/Tests/cmake-use-pragma-once-stdout.txt
+++ b/Utilities/ClangTidyModule/Tests/cmake-use-pragma-once-stdout.txt
@@ -1,25 +1,46 @@
 cmake-use-pragma-once/cmake-use-pragma-once-both.h:1:1: warning: use #pragma once [cmake-use-pragma-once]
-#ifndef BOTH_H
-^~~~~~~~~~~~~~
+    1 | #ifndef BOTH_H
+      | ^~~~~~~~~~~~~~
+    2 | #define BOTH_H
+      | ~~~~~~~~~~~~~~
+    3 | #pragma once
+    4 |
+    5 | int both()
+    6 | {
+    7 |   return 0;
+    8 | }
+    9 |
+   10 | #endif
+      | ~~~~~~
 cmake-use-pragma-once/cmake-use-pragma-once-both.h:1:1: note: FIX-IT applied suggested code changes
 cmake-use-pragma-once/cmake-use-pragma-once-both.h:2:1: note: FIX-IT applied suggested code changes
-#define BOTH_H
-^
+    2 | #define BOTH_H
+      | ^
 cmake-use-pragma-once/cmake-use-pragma-once-both.h:10:1: note: FIX-IT applied suggested code changes
-#endif
-^
+   10 | #endif
+      | ^
 cmake-use-pragma-once/cmake-use-pragma-once-include-guards.h:1:1: warning: use #pragma once [cmake-use-pragma-once]
-#ifndef INCLUDE_GUARDS_H
-^~~~~~~~~~~~~~~~~~~~~~~~
-#pragma once
+    1 | #ifndef INCLUDE_GUARDS_H
+      | ^~~~~~~~~~~~~~~~~~~~~~~~
+      | #pragma once
+    2 | #define INCLUDE_GUARDS_H
+      | ~~~~~~~~~~~~~~~~~~~~~~~~
+    3 |
+    4 | int includeGuards()
+    5 | {
+    6 |   return 0;
+    7 | }
+    8 |
+    9 | #endif
+      | ~~~~~~
 cmake-use-pragma-once/cmake-use-pragma-once-include-guards.h:1:1: note: FIX-IT applied suggested code changes
 cmake-use-pragma-once/cmake-use-pragma-once-include-guards.h:2:1: note: FIX-IT applied suggested code changes
-#define INCLUDE_GUARDS_H
-^
+    2 | #define INCLUDE_GUARDS_H
+      | ^
 cmake-use-pragma-once/cmake-use-pragma-once-include-guards.h:9:1: note: FIX-IT applied suggested code changes
-#endif
-^
+    9 | #endif
+      | ^
 cmake-use-pragma-once/cmake-use-pragma-once-neither.h:1:1: warning: use #pragma once [cmake-use-pragma-once]
-int neither()
-^
+    1 | int neither()
+      | ^
 cmake-use-pragma-once/cmake-use-pragma-once-neither.h:1:1: note: FIX-IT applied suggested code changes
diff --git a/Utilities/ClangTidyModule/UsePragmaOnceCheck.h b/Utilities/ClangTidyModule/UsePragmaOnceCheck.h
index 08c2099..325f643 100644
--- a/Utilities/ClangTidyModule/UsePragmaOnceCheck.h
+++ b/Utilities/ClangTidyModule/UsePragmaOnceCheck.h
@@ -18,6 +18,16 @@
 #include <clang-tidy/ClangTidyCheck.h>
 #include <clang-tidy/utils/FileExtensionsUtils.h>
 
+#if LLVM_VERSION_MAJOR >= 17
+#  include <clang-tidy/FileExtensionsSet.h>
+#else
+namespace clang {
+namespace tidy {
+using utils::FileExtensionsSet;
+} // namespace tidy
+} // namespace clang
+#endif
+
 namespace clang {
 namespace tidy {
 namespace cmake {
@@ -52,7 +62,7 @@
 
 private:
   std::string RawStringHeaderFileExtensions;
-  utils::FileExtensionsSet HeaderFileExtensions;
+  FileExtensionsSet HeaderFileExtensions;
 };
 
 } // namespace cmake
diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in
index 0d9ad91..20e1340 100644
--- a/Utilities/Sphinx/conf.py.in
+++ b/Utilities/Sphinx/conf.py.in
@@ -32,7 +32,7 @@
 smartquotes = False
 
 cmake_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst'))
-cmake_manual_description = re.compile('^\.\. cmake-manual-description:(.*)$')
+cmake_manual_description = re.compile(r'^\.\. cmake-manual-description:(.*)$')
 man_pages = []
 for fpath in cmake_manuals:
     try: