Merge branch 'release-4.0' into release-4.1
diff --git a/.gitattributes b/.gitattributes
index 0e7ab06..3cf1b86 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -6,6 +6,7 @@
 .editorconfig    export-ignore
 .pre-commit-config.yaml export-ignore
 .typos.toml      export-ignore
+sgconfig.yml     export-ignore
 
 # Custom attribute to mark sources as using our C code style.
 [attr]our-c-style  whitespace=tab-in-indent  format.clang-format=18
@@ -60,6 +61,7 @@
 *.H              our-c-style
 *.h              our-c-style
 *.hh             our-c-style
+*.hip            our-c-style
 *.hpp            our-c-style
 *.hxx            our-c-style
 *.notcu          our-c-style
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8660d3c..cccd68c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,6 +16,7 @@
     - build
     - test
     - test-ext
+    - package
     - upload
 
 variables:
@@ -40,6 +41,7 @@
 
 # Job prefixes:
 #   - `b:` build
+#   - `k:` package
 #   - `l:` lint
 #   - `p:` prep
 #   - `t:` test
@@ -59,7 +61,7 @@
 
 p:doc-package:
     extends:
-        - .fedora41_sphinx_package
+        - .fedora42_sphinx_package
         - .cmake_prep_doc_linux
         - .linux_x86_64_tags
         - .cmake_doc_artifacts
@@ -109,18 +111,18 @@
         - .cmake_cdash_artifacts
         - .run_automatically
 
-l:tidy-fedora41:
+l:tidy-fedora42:
     extends:
-        - .fedora41_tidy
+        - .fedora42_tidy
         - .cmake_build_linux
         - .cmake_tidy_artifacts
         - .linux_x86_64_tags
         - .cmake_cdash_artifacts
         - .run_automatically
 
-l:sphinx-fedora41:
+l:sphinx-fedora42:
     extends:
-        - .fedora41_sphinx
+        - .fedora42_sphinx
         - .cmake_build_linux
         - .cmake_sphinx_artifacts
         - .linux_x86_64_tags
@@ -129,9 +131,9 @@
         CMAKE_CI_JOB_CONTINUOUS: "true"
         CMAKE_CI_JOB_HELP: "true"
 
-l:clang-analyzer-fedora41:
+l:clang-analyzer-fedora42:
     extends:
-        - .fedora41_clang_analyzer
+        - .fedora42_clang_analyzer
         - .cmake_build_linux
         - .linux_x86_64_tags
         - .run_automatically
@@ -219,25 +221,25 @@
     extends:
         - .debian12_hip_radeon
         - .cmake_test_linux_release
-        - .linux_x86_64_tags_radeon
+        - .linux_x86_64_tags_rocm5.2
         - .run_dependent
         - .needs_centos7_x86_64
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-hip-radeon:
+t:fedora42-hip-radeon:
     extends:
-        - .fedora41_hip_radeon
+        - .fedora42_hip_radeon
         - .cmake_test_linux_release
-        - .linux_x86_64_tags_radeon
+        - .linux_x86_64_tags_rocm6.2
         - .run_dependent
         - .needs_centos7_x86_64
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-makefiles-lfortran:
+t:fedora42-makefiles-lfortran:
     extends:
-        - .fedora41_makefiles_lfortran
+        - .fedora42_makefiles_lfortran
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -245,9 +247,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-ninja-lfortran:
+t:fedora42-ninja-lfortran:
     extends:
-        - .fedora41_ninja_lfortran
+        - .fedora42_ninja_lfortran
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -255,9 +257,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-ninja-clang:
+t:fedora42-ninja-clang:
     extends:
-        - .fedora41_ninja_clang
+        - .fedora42_ninja_clang
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -265,9 +267,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-ninja-multi-clang:
+t:fedora42-ninja-multi-clang:
     extends:
-        - .fedora41_ninja_multi_clang
+        - .fedora42_ninja_multi_clang
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -275,9 +277,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-makefiles-clang:
+t:fedora42-makefiles-clang:
     extends:
-        - .fedora41_makefiles_clang
+        - .fedora42_makefiles_clang
         - .cmake_test_linux_release
         - .linux_x86_64_tags
         - .run_dependent
@@ -285,17 +287,17 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-makefiles:
+t:fedora42-makefiles:
     extends:
-        - .fedora41_makefiles
+        - .fedora42_makefiles
         - .cmake_test_linux_release
         - .linux_x86_64_v3_tags
         - .run_dependent
         - .needs_centos7_x86_64
 
-t:fedora41-makefiles-nospace:
+t:fedora42-makefiles-nospace:
     extends:
-        - .fedora41_makefiles
+        - .fedora42_makefiles
         - .cmake_test_linux_release
         - .linux_x86_64_v3_tags
         - .cmake_junit_artifacts
@@ -303,7 +305,7 @@
         - .needs_centos7_x86_64
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci"
-        CMAKE_CI_BUILD_NAME: fedora41_makefiles_nospace
+        CMAKE_CI_BUILD_NAME: fedora42_makefiles_nospace
         CMAKE_CI_JOB_NIGHTLY: "true"
 
 t:nvhpc24.9-ninja:
@@ -453,7 +455,7 @@
     extends:
         - .hip6.3_radeon
         - .cmake_test_linux_release
-        - .linux_x86_64_tags_radeon
+        - .linux_x86_64_tags_rocm6.3
         - .run_dependent
         - .needs_centos7_x86_64
     variables:
@@ -490,9 +492,9 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-b:fedora41-ninja:
+b:fedora42-ninja:
     extends:
-        - .fedora41_ninja
+        - .fedora42_ninja
         - .cmake_build_linux
         - .cmake_build_artifacts
         - .linux_x86_64_tags
@@ -500,9 +502,9 @@
     variables:
         CMAKE_CI_JOB_CONTINUOUS: "true"
 
-b:fedora41-makefiles-symlinked:
+b:fedora42-makefiles-symlinked:
     extends:
-        - .fedora41_makefiles_symlinked
+        - .fedora42_makefiles_symlinked
         - .cmake_build_linux
         - .cmake_build_artifacts
         - .linux_x86_64_tags
@@ -537,48 +539,48 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-b:fedora41-extdeps:
+b:fedora42-extdeps:
     extends:
-        - .fedora41_extdeps
+        - .fedora42_extdeps
         - .cmake_build_linux_standalone
         - .linux_x86_64_tags
         - .run_manually
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-ninja:
+t:fedora42-ninja:
     extends:
-        - .fedora41_ninja
+        - .fedora42_ninja
         - .cmake_test_linux
         - .linux_x86_64_tags_x11
         - .cmake_test_artifacts
         - .run_dependent
     needs:
-        - b:fedora41-ninja
+        - b:fedora42-ninja
     variables:
         CMAKE_CI_JOB_CONTINUOUS: "true"
 
-t:fedora41-makefiles-symlinked:
+t:fedora42-makefiles-symlinked:
     extends:
-        - .fedora41_makefiles_symlinked
+        - .fedora42_makefiles_symlinked
         - .cmake_test_linux
         - .linux_x86_64_tags_x11
         - .cmake_test_artifacts
         - .run_dependent
     needs:
-        - b:fedora41-makefiles-symlinked
+        - b:fedora42-makefiles-symlinked
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-ninja-multi:
+t:fedora42-ninja-multi:
     extends:
-        - .fedora41_ninja_multi
+        - .fedora42_ninja_multi
         - .cmake_test_linux_external
         - .linux_x86_64_tags
         - .cmake_junit_artifacts
         - .run_dependent
     needs:
-        - t:fedora41-ninja
+        - t:fedora42-ninja
 
 t:intel2016u2-makefiles:
     extends:
@@ -790,6 +792,20 @@
         CMAKE_CI_BUILD_NAME: oneapi2024.2.0_makefiles
         CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2024.2.0-rocky9
 
+t:oneapi2025.0.0-makefiles:
+    extends:
+        - .cmake_test_linux_inteloneapi_makefiles
+    variables:
+        CMAKE_CI_BUILD_NAME: oneapi2025.0.0_makefiles
+        CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2025.0.0-rocky9
+
+t:oneapi2025.1.0-makefiles:
+    extends:
+        - .cmake_test_linux_inteloneapi_makefiles
+    variables:
+        CMAKE_CI_BUILD_NAME: oneapi2025.1.0_makefiles
+        CMAKE_CI_INTELCOMPILER_IMAGE_TAG: 2025.1.0-rocky9
+
 b:linux-x86_64-package:
     extends:
         - .linux_package
@@ -872,9 +888,9 @@
 
 ## Sanitizer builds
 
-b:fedora41-asan:
+b:fedora42-asan:
     extends:
-        - .fedora41_asan
+        - .fedora42_asan
         - .cmake_build_linux
         - .cmake_build_artifacts
         - .linux_x86_64_tags
@@ -882,14 +898,14 @@
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:fedora41-asan:
+t:fedora42-asan:
     extends:
-        - .fedora41_asan
+        - .fedora42_asan
         - .cmake_memcheck_linux
         - .linux_x86_64_tags
         - .run_dependent
     needs:
-        - b:fedora41-asan
+        - b:fedora42-asan
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
@@ -1308,7 +1324,7 @@
         CMAKE_CI_BUILD_NAME: windows_clang19.1_gnu_nmake
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:windows-intel2021.9.0-ninja:
+t:windows-intel2021.9-ninja:
     extends:
         - .windows_intelclassic_ninja
         - .cmake_test_windows_external
@@ -1318,20 +1334,20 @@
     needs:
         - t:windows-vs2022-x64-ninja
     variables:
-        CMAKE_CI_BUILD_NAME: windows_intel2021.9.0_ninja
+        CMAKE_CI_BUILD_NAME: windows_intel2021.9_ninja
         CMAKE_CI_JOB_NIGHTLY: "true"
 
-t:windows-oneapi2024.1.0-ninja:
+t:windows-oneapi2025.1-ninja:
     extends:
         - .windows_inteloneapi_ninja
         - .cmake_test_windows_external
-        - .windows_x86_64_tags_concurrent_vs2022_msvc14.43
+        - .windows_x86_64_tags_concurrent_vs2022
         - .cmake_junit_artifacts
         - .run_dependent
     needs:
         - t:windows-vs2022-x64-ninja
     variables:
-        CMAKE_CI_BUILD_NAME: windows_oneapi2024.1.0_ninja
+        CMAKE_CI_BUILD_NAME: windows_oneapi2025.1_ninja
         CMAKE_CI_JOB_NIGHTLY: "true"
 
 t:mingw_osdn_io-mingw_makefiles:
@@ -1436,12 +1452,24 @@
     extends:
         - .windows_x86_64_package
         - .cmake_build_windows
-        - .cmake_release_artifacts
+        - .cmake_build_package_artifacts
         - .windows_x86_64_tags_nonconcurrent_vs2022
         - .run_only_for_package
     needs:
         - p:doc-package
     variables:
+        CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64-build"
+
+k:windows-x86_64-package:
+    extends:
+        - .windows_x86_64_package
+        - .cmake_package_windows
+        - .cmake_release_artifacts
+        - .windows_x86_64_tags_nonconcurrent_sign
+        - .run_only_for_package
+    needs:
+        - b:windows-x86_64-package
+    variables:
         CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64"
 
 u:windows-x86_64-package:
@@ -1449,18 +1477,30 @@
         - .rsync_upload_package
         - .run_only_for_package
     needs:
-        - b:windows-x86_64-package
+        - k:windows-x86_64-package
 
 b:windows-i386-package:
     extends:
         - .windows_i386_package
         - .cmake_build_windows
-        - .cmake_release_artifacts
+        - .cmake_build_package_artifacts
         - .windows_x86_64_tags_nonconcurrent_vs2022
         - .run_only_for_package
     needs:
         - p:doc-package
     variables:
+        CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386-build"
+
+k:windows-i386-package:
+    extends:
+        - .windows_i386_package
+        - .cmake_package_windows
+        - .cmake_release_artifacts
+        - .windows_x86_64_tags_nonconcurrent_sign
+        - .run_only_for_package
+    needs:
+        - b:windows-i386-package
+    variables:
         CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386"
 
 u:windows-i386-package:
@@ -1468,18 +1508,30 @@
         - .rsync_upload_package
         - .run_only_for_package
     needs:
-        - b:windows-i386-package
+        - k:windows-i386-package
 
 b:windows-arm64-package:
     extends:
         - .windows_arm64_package
         - .cmake_build_windows
-        - .cmake_release_artifacts
+        - .cmake_build_package_artifacts
         - .windows_x86_64_tags_nonconcurrent_vs2022_arm64
         - .run_only_for_package
     needs:
         - p:doc-package
     variables:
+        CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64-build"
+
+k:windows-arm64-package:
+    extends:
+        - .windows_arm64_package
+        - .cmake_package_windows
+        - .cmake_release_artifacts
+        - .windows_x86_64_tags_nonconcurrent_sign
+        - .run_only_for_package
+    needs:
+        - b:windows-arm64-package
+    variables:
         CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64"
 
 u:windows-arm64-package:
@@ -1487,4 +1539,4 @@
         - .rsync_upload_package
         - .run_only_for_package
     needs:
-        - b:windows-arm64-package
+        - k:windows-arm64-package
diff --git a/.gitlab/artifacts.yml b/.gitlab/artifacts.yml
index 97b8f38..f11706c 100644
--- a/.gitlab/artifacts.yml
+++ b/.gitlab/artifacts.yml
@@ -39,7 +39,6 @@
             - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*Lib/*LibTests
             - ${CMAKE_CI_BUILD_DIR}/Tests/CMake*Lib/*LibTests.exe
             - ${CMAKE_CI_BUILD_DIR}/Source/kwsys/cmsysTest*
-            - ${CMAKE_CI_BUILD_DIR}/Source/kwsys/testConsoleBufChild.exe
             - ${CMAKE_CI_BUILD_DIR}/Utilities/cmcurl/curltest
             - ${CMAKE_CI_BUILD_DIR}/Utilities/cmcurl/curltest.exe
             - ${CMAKE_CI_BUILD_DIR}/Utilities/KWIML/test/kwiml_test
@@ -67,6 +66,36 @@
             annotations:
                 - ${CMAKE_CI_BUILD_DIR}/annotations.json
 
+.cmake_build_package_artifacts:
+    artifacts:
+        expire_in: 1d
+        name: "$CMAKE_CI_ARTIFACTS_NAME"
+        paths:
+            # Allow CPack to find CMAKE_ROOT and license text.
+            - build/CMakeFiles/CMakeSourceDir.txt
+            - build/CMakeFiles/LICENSE.txt
+
+            # Install rules.
+            - build/**/cmake_install.cmake
+
+            # We need the main binaries.
+            - build/bin/
+
+            # Pass through the documentation.
+            - build/install-doc/
+
+            # CPack configuration.
+            - build/CPackConfig.cmake
+            - build/CMakeCPackOptions.cmake
+            - build/Source/QtDialog/QtDialogCPack.cmake
+
+            # CPack/IFW packaging files.
+            - build/CMake*.qs
+
+            # CPack/WIX packaging files.
+            - build/Utilities/Release/WiX/custom_action_dll*.wxs
+            - build/Utilities/Release/WiX/CustomAction/CMakeWiXCustomActions.*
+
 .cmake_release_artifacts:
     artifacts:
         expire_in: 5d
diff --git a/.gitlab/ci/CMakeCPack.cmake b/.gitlab/ci/CMakeCPack.cmake
deleted file mode 100644
index 971fe54..0000000
--- a/.gitlab/ci/CMakeCPack.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-if(NOT "$ENV{CMAKE_CI_PACKAGE}" MATCHES "^(dev)?$")
-  configure_file(${CMAKE_CURRENT_LIST_DIR}/package_info.cmake.in ${CMake_BINARY_DIR}/ci_package_info.cmake @ONLY)
-endif()
diff --git a/.gitlab/ci/configure_debian12_aarch64_ninja.cmake b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
index d2a401e..b533822 100644
--- a/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
+++ b/.gitlab/ci/configure_debian12_aarch64_ninja.cmake
@@ -1,13 +1,23 @@
 set(CMake_TEST_C_STANDARDS "90;99;11;17;23" CACHE STRING "")
 set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23" CACHE STRING "")
 
+set(blas_lapack_cases
+  All
+  static=1 Generic
+  model=lp64
+    static=0 thread=SEQ NVPL thread=OMP NVPL thread= NVPL
+  model=ilp64
+    static=0 thread=SEQ NVPL thread=OMP NVPL thread= NVPL
+  )
+
 set(CMake_TEST_CTestUpdate_BZR "ON" CACHE BOOL "")
 set(CMake_TEST_CTestUpdate_CVS "ON" CACHE BOOL "")
 set(CMake_TEST_CTestUpdate_GIT "ON" CACHE BOOL "")
 set(CMake_TEST_CTestUpdate_HG "ON" CACHE BOOL "")
 set(CMake_TEST_CTestUpdate_SVN "ON" CACHE BOOL "")
 set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
-set(CMake_TEST_FindBLAS "All;static=1;Generic" CACHE STRING "")
+set(CMake_TEST_FindASPELL "ON" CACHE BOOL "")
+set(CMake_TEST_FindBLAS "${blas_lapack_cases}" CACHE STRING "")
 set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
 set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "")
 set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "")
@@ -51,7 +61,7 @@
 set(CMake_TEST_FindJNI "ON" CACHE BOOL "")
 set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
 set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")
-set(CMake_TEST_FindLAPACK "All;static=1;Generic" CACHE STRING "")
+set(CMake_TEST_FindLAPACK "${blas_lapack_cases}" CACHE STRING "")
 set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "")
 set(CMake_TEST_FindLibinput "ON" CACHE BOOL "")
 set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_debian12_ninja_common.cmake b/.gitlab/ci/configure_debian12_ninja_common.cmake
index 3912daa..3022725 100644
--- a/.gitlab/ci/configure_debian12_ninja_common.cmake
+++ b/.gitlab/ci/configure_debian12_ninja_common.cmake
@@ -11,6 +11,7 @@
 endif()
 
 set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
+set(CMake_TEST_FindASPELL "ON" CACHE BOOL "")
 set(CMake_TEST_FindBacktrace "ON" CACHE BOOL "")
 set(CMake_TEST_FindBLAS "All;static=1;Generic" CACHE STRING "")
 set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
diff --git a/.gitlab/ci/configure_fedora41_asan.cmake b/.gitlab/ci/configure_fedora41_asan.cmake
deleted file mode 100644
index df9f46d..0000000
--- a/.gitlab/ci/configure_fedora41_asan.cmake
+++ /dev/null
@@ -1,4 +0,0 @@
-set(CMAKE_C_FLAGS "-fsanitize=address" CACHE STRING "")
-set(CMAKE_CXX_FLAGS "-fsanitize=address" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_clang_analyzer.cmake b/.gitlab/ci/configure_fedora41_clang_analyzer.cmake
deleted file mode 100644
index cdeaab4..0000000
--- a/.gitlab/ci/configure_fedora41_clang_analyzer.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(configure_no_sccache 1)
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_common.cmake b/.gitlab/ci/configure_fedora41_common.cmake
deleted file mode 100644
index 4484e26..0000000
--- a/.gitlab/ci/configure_fedora41_common.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-set(BUILD_CursesDialog ON CACHE BOOL "")
-set(BUILD_QtDialog ON CACHE BOOL "")
-set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
-set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
-set(CMake_TEST_JSON_SCHEMA ON CACHE BOOL "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_makefiles.cmake b/.gitlab/ci/configure_fedora41_makefiles.cmake
deleted file mode 100644
index 2a57087..0000000
--- a/.gitlab/ci/configure_fedora41_makefiles.cmake
+++ /dev/null
@@ -1,116 +0,0 @@
-set(CMake_TEST_C_STANDARDS "90;99;11;17;23" CACHE STRING "")
-set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23;26" CACHE STRING "")
-
-set(CMake_TEST_CTestUpdate_BZR "ON" CACHE BOOL "")
-set(CMake_TEST_CTestUpdate_GIT "ON" CACHE BOOL "")
-set(CMake_TEST_CTestUpdate_HG "ON" CACHE BOOL "")
-set(CMake_TEST_CTestUpdate_SVN "ON" CACHE BOOL "")
-if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
-  set(CMake_TEST_CTestUpdate_P4 "ON" CACHE BOOL "")
-endif()
-
-set(CMake_TEST_ASM_NASM "ON" CACHE BOOL "")
-set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
-set(CMake_TEST_FindBacktrace "ON" CACHE BOOL "")
-set(CMake_TEST_FindBLAS "All;static=1;Generic" CACHE STRING "")
-set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
-set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "")
-set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "")
-set(CMake_TEST_FindCups "ON" CACHE BOOL "")
-set(CMake_TEST_FindCURL "ON" CACHE BOOL "")
-set(CMake_TEST_FindDevIL "ON" CACHE BOOL "")
-set(CMake_TEST_FindDoxygen_Dot "ON" CACHE BOOL "")
-set(CMake_TEST_FindDoxygen "ON" CACHE BOOL "")
-set(CMake_TEST_FindEXPAT "ON" CACHE BOOL "")
-set(CMake_TEST_FindFontconfig "ON" CACHE BOOL "")
-set(CMake_TEST_FindFreetype "ON" CACHE BOOL "")
-set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
-set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
-set(CMake_TEST_FindGit "ON" CACHE BOOL "")
-set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
-set(CMake_TEST_FindGLUT "ON" CACHE BOOL "")
-set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
-set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
-set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
-set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "")
-set(CMake_TEST_FindHDF5 "ON" CACHE BOOL "")
-set(CMake_TEST_FindHDF5_MPICH_C_COMPILER "/usr/lib64/mpich/bin/h5pcc" CACHE FILEPATH "")
-# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/lib64/mpich/bin/h5pc++" CACHE FILEPATH "") # h5pc++ does not exist
-set(CMake_TEST_FindHDF5_MPICH_ENVMOD "PATH=path_list_prepend:/usr/lib64/mpich/bin;LD_LIBRARY_PATH=path_list_prepend:/usr/lib64/mpich/lib" CACHE STRING "")
-set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER "/usr/lib64/mpich/bin/h5pfc" CACHE FILEPATH "")
-set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER "/usr/lib64/openmpi/bin/h5pcc" CACHE FILEPATH "")
-set(CMake_TEST_FindHDF5_OpenMPI_ENVMOD "PATH=path_list_prepend:/usr/lib64/openmpi/bin;LD_LIBRARY_PATH=path_list_prepend:/usr/lib64/openmpi/lib" CACHE STRING "")
-# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/lib64/openmpi/bin/h5pc++" CACHE FILEPATH "") # h5pc++ does not exist
-set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER "/usr/lib64/openmpi/bin/h5pfc" CACHE FILEPATH "")
-set(CMake_TEST_FindHDF5_Serial_C_COMPILER "/usr/bin/h5cc" CACHE FILEPATH "")
-set(CMake_TEST_FindHDF5_Serial_CXX_COMPILER "/usr/bin/h5c++" CACHE FILEPATH "")
-set(CMake_TEST_FindHDF5_Serial_Fortran_COMPILER "/usr/bin/h5fc" CACHE FILEPATH "")
-set(CMake_TEST_FindIconv "ON" CACHE BOOL "")
-set(CMake_TEST_FindICU "ON" CACHE BOOL "")
-set(CMake_TEST_FindImageMagick "ON" CACHE BOOL "")
-set(CMake_TEST_FindIntl "ON" CACHE BOOL "")
-set(CMake_TEST_FindJasper "ON" CACHE BOOL "")
-set(CMake_TEST_FindJNI "ON" CACHE BOOL "")
-set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
-set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")
-set(CMake_TEST_FindLAPACK "All;static=1;Generic" CACHE STRING "")
-set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "")
-set(CMake_TEST_FindLibinput "ON" CACHE BOOL "")
-set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "")
-set(CMake_TEST_FindLibUV "ON" CACHE BOOL "")
-set(CMake_TEST_FindLibXml2 "ON" CACHE BOOL "")
-set(CMake_TEST_FindLibXslt "ON" CACHE BOOL "")
-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;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 "")
-set(CMake_TEST_FindOpenACC_C "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenACC_CXX "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenACC_Fortran "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenAL "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenSP "ON" CACHE BOOL "")
-set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
-set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
-set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
-set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "")
-set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "")
-set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "")
-set(CMake_TEST_FindPython3 "ON" CACHE BOOL "")
-set(CMake_TEST_FindPython3_NumPy "ON" CACHE BOOL "")
-set(CMake_TEST_FindPython2_PyPy "ON" CACHE BOOL "")
-set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "")
-set(CMake_TEST_FindRuby "ON" CACHE BOOL "")
-set(CMake_TEST_FindRuby_RBENV "ON" CACHE BOOL "")
-set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "")
-set(CMake_TEST_FindSDL "ON" CACHE BOOL "")
-set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "")
-set(CMake_TEST_FindTIFF "ON" CACHE BOOL "")
-set(CMake_TEST_FindwxWidgets "ON" CACHE BOOL "")
-set(CMake_TEST_FindX11 "ON" CACHE BOOL "")
-set(CMake_TEST_FindXalanC "ON" CACHE BOOL "")
-set(CMake_TEST_FindXercesC "ON" CACHE BOOL "")
-
-set(CMake_TEST_ELF_LARGE "ON" CACHE BOOL "")
-set(CMake_TEST_Fortran_SUBMODULES "ON" CACHE BOOL "")
-set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "")
-set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "")
-set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
-if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
-  set(CMake_TEST_ISPC "ON" CACHE STRING "")
-endif()
-set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
-set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
-set(CMake_TEST_TLS_VERIFY_URL_BAD "https://badtls-expired.kitware.com" CACHE STRING "")
-set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
-set(CMake_TEST_TLS_VERSION_URL_BAD "https://badtls-v1-1.kitware.com:8011" CACHE STRING "")
-set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora41_makefiles_clang.cmake b/.gitlab/ci/configure_fedora41_makefiles_clang.cmake
deleted file mode 100644
index 3d6614e..0000000
--- a/.gitlab/ci/configure_fedora41_makefiles_clang.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
-  set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "")
-endif()
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora41_makefiles_lfortran.cmake b/.gitlab/ci/configure_fedora41_makefiles_lfortran.cmake
deleted file mode 100644
index 951ce0d..0000000
--- a/.gitlab/ci/configure_fedora41_makefiles_lfortran.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common_lfortran.cmake")
diff --git a/.gitlab/ci/configure_fedora41_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora41_makefiles_symlinked.cmake
deleted file mode 100644
index e4434c1..0000000
--- a/.gitlab/ci/configure_fedora41_makefiles_symlinked.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake")
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_ninja.cmake b/.gitlab/ci/configure_fedora41_ninja.cmake
deleted file mode 100644
index 217d24a..0000000
--- a/.gitlab/ci/configure_fedora41_ninja.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-set(CMake_TEST_GUI "ON" CACHE BOOL "")
-if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
-  set(CMake_TEST_ISPC "ON" CACHE STRING "")
-endif()
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly,build_database" CACHE STRING "")
-set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
-set(CMake_TEST_TLS_VERIFY_URL_BAD "https://badtls-expired.kitware.com" CACHE STRING "")
-set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
-set(CMake_TEST_TLS_VERSION_URL_BAD "https://badtls-v1-1.kitware.com:8011" CACHE STRING "")
-
-# "Release" flags without "-DNDEBUG" so we get assertions.
-set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE STRING "")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "")
-
-# Cover compilation with C++11 only and not higher standards.
-set(CMAKE_CXX_STANDARD "11" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_ninja_clang.cmake b/.gitlab/ci/configure_fedora41_ninja_clang.cmake
deleted file mode 100644
index a6e7e2a..0000000
--- a/.gitlab/ci/configure_fedora41_ninja_clang.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly,build_database" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora41_ninja_lfortran.cmake b/.gitlab/ci/configure_fedora41_ninja_lfortran.cmake
deleted file mode 100644
index 951ce0d..0000000
--- a/.gitlab/ci/configure_fedora41_ninja_lfortran.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common_lfortran.cmake")
diff --git a/.gitlab/ci/configure_fedora41_ninja_multi_clang.cmake b/.gitlab/ci/configure_fedora41_ninja_multi_clang.cmake
deleted file mode 100644
index a6e7e2a..0000000
--- a/.gitlab/ci/configure_fedora41_ninja_multi_clang.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly,build_database" CACHE STRING "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora41_tidy.cmake b/.gitlab/ci/configure_fedora41_tidy.cmake
deleted file mode 100644
index 40bde10..0000000
--- a/.gitlab/ci/configure_fedora41_tidy.cmake
+++ /dev/null
@@ -1,6 +0,0 @@
-set(CMake_RUN_CLANG_TIDY ON CACHE BOOL "")
-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 "")
-set(CMake_CLANG_TIDY_EXPORT_FIXES_DIR "$ENV{CI_PROJECT_DIR}/.gitlab/clang-tidy-fixes" CACHE PATH "")
-
-include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora41_common.cmake")
diff --git a/.gitlab/ci/configure_fedora42_asan.cmake b/.gitlab/ci/configure_fedora42_asan.cmake
new file mode 100644
index 0000000..60a3cb1
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_asan.cmake
@@ -0,0 +1,5 @@
+set(CMAKE_C_FLAGS "-fsanitize=address" CACHE STRING "")
+set(CMAKE_CXX_FLAGS "-fsanitize=address" CACHE STRING "")
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common.cmake")
diff --git a/.gitlab/ci/configure_fedora42_clang_analyzer.cmake b/.gitlab/ci/configure_fedora42_clang_analyzer.cmake
new file mode 100644
index 0000000..c484570
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_clang_analyzer.cmake
@@ -0,0 +1,4 @@
+set(configure_no_sccache 1)
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common.cmake")
diff --git a/.gitlab/ci/configure_fedora42_common.cmake b/.gitlab/ci/configure_fedora42_common.cmake
new file mode 100644
index 0000000..dee78ab
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_common.cmake
@@ -0,0 +1,6 @@
+set(BUILD_CursesDialog ON CACHE BOOL "")
+set(BUILD_QtDialog ON CACHE BOOL "")
+set(CMake_TEST_JQ "/usr/bin/jq" CACHE PATH "")
+set(CMake_TEST_JSON_SCHEMA ON CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/configure_fedora41_common_clang.cmake b/.gitlab/ci/configure_fedora42_common_clang.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora41_common_clang.cmake
rename to .gitlab/ci/configure_fedora42_common_clang.cmake
diff --git a/.gitlab/ci/configure_fedora41_common_lfortran.cmake b/.gitlab/ci/configure_fedora42_common_lfortran.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora41_common_lfortran.cmake
rename to .gitlab/ci/configure_fedora42_common_lfortran.cmake
diff --git a/.gitlab/ci/configure_fedora41_extdeps.cmake b/.gitlab/ci/configure_fedora42_extdeps.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora41_extdeps.cmake
rename to .gitlab/ci/configure_fedora42_extdeps.cmake
diff --git a/.gitlab/ci/configure_fedora41_hip_radeon.cmake b/.gitlab/ci/configure_fedora42_hip_radeon.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora41_hip_radeon.cmake
rename to .gitlab/ci/configure_fedora42_hip_radeon.cmake
diff --git a/.gitlab/ci/configure_fedora42_makefiles.cmake b/.gitlab/ci/configure_fedora42_makefiles.cmake
new file mode 100644
index 0000000..e84dcbd
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_makefiles.cmake
@@ -0,0 +1,117 @@
+set(CMake_TEST_C_STANDARDS "90;99;11;17;23" CACHE STRING "")
+set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23;26" CACHE STRING "")
+
+set(CMake_TEST_CTestUpdate_BZR "ON" CACHE BOOL "")
+set(CMake_TEST_CTestUpdate_GIT "ON" CACHE BOOL "")
+set(CMake_TEST_CTestUpdate_HG "ON" CACHE BOOL "")
+set(CMake_TEST_CTestUpdate_SVN "ON" CACHE BOOL "")
+if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+  set(CMake_TEST_CTestUpdate_P4 "ON" CACHE BOOL "")
+endif()
+
+set(CMake_TEST_ASM_NASM "ON" CACHE BOOL "")
+set(CMake_TEST_FindALSA "ON" CACHE BOOL "")
+set(CMake_TEST_FindASPELL "ON" CACHE BOOL "")
+set(CMake_TEST_FindBacktrace "ON" CACHE BOOL "")
+set(CMake_TEST_FindBLAS "All;static=1;Generic" CACHE STRING "")
+set(CMake_TEST_FindBoost "ON" CACHE BOOL "")
+set(CMake_TEST_FindBoost_Python "ON" CACHE BOOL "")
+set(CMake_TEST_FindBZip2 "ON" CACHE BOOL "")
+set(CMake_TEST_FindCups "ON" CACHE BOOL "")
+set(CMake_TEST_FindCURL "ON" CACHE BOOL "")
+set(CMake_TEST_FindDevIL "ON" CACHE BOOL "")
+set(CMake_TEST_FindDoxygen_Dot "ON" CACHE BOOL "")
+set(CMake_TEST_FindDoxygen "ON" CACHE BOOL "")
+set(CMake_TEST_FindEXPAT "ON" CACHE BOOL "")
+set(CMake_TEST_FindFontconfig "ON" CACHE BOOL "")
+set(CMake_TEST_FindFreetype "ON" CACHE BOOL "")
+set(CMake_TEST_FindGDAL "ON" CACHE BOOL "")
+set(CMake_TEST_FindGIF "ON" CACHE BOOL "")
+set(CMake_TEST_FindGit "ON" CACHE BOOL "")
+set(CMake_TEST_FindGLEW "ON" CACHE BOOL "")
+set(CMake_TEST_FindGLUT "ON" CACHE BOOL "")
+set(CMake_TEST_FindGnuTLS "ON" CACHE BOOL "")
+set(CMake_TEST_FindGSL "ON" CACHE BOOL "")
+set(CMake_TEST_FindGTest "ON" CACHE BOOL "")
+set(CMake_TEST_FindGTK2 "ON" CACHE BOOL "")
+set(CMake_TEST_FindHDF5 "ON" CACHE BOOL "")
+set(CMake_TEST_FindHDF5_MPICH_C_COMPILER "/usr/lib64/mpich/bin/h5pcc" CACHE FILEPATH "")
+# set(CMake_TEST_FindHDF5_MPICH_CXX_COMPILER "/usr/lib64/mpich/bin/h5pc++" CACHE FILEPATH "") # h5pc++ does not exist
+set(CMake_TEST_FindHDF5_MPICH_ENVMOD "PATH=path_list_prepend:/usr/lib64/mpich/bin;LD_LIBRARY_PATH=path_list_prepend:/usr/lib64/mpich/lib" CACHE STRING "")
+set(CMake_TEST_FindHDF5_MPICH_Fortran_COMPILER "/usr/lib64/mpich/bin/h5pfc" CACHE FILEPATH "")
+set(CMake_TEST_FindHDF5_OpenMPI_C_COMPILER "/usr/lib64/openmpi/bin/h5pcc" CACHE FILEPATH "")
+set(CMake_TEST_FindHDF5_OpenMPI_ENVMOD "PATH=path_list_prepend:/usr/lib64/openmpi/bin;LD_LIBRARY_PATH=path_list_prepend:/usr/lib64/openmpi/lib" CACHE STRING "")
+# set(CMake_TEST_FindHDF5_OpenMPI_CXX_COMPILER "/usr/lib64/openmpi/bin/h5pc++" CACHE FILEPATH "") # h5pc++ does not exist
+set(CMake_TEST_FindHDF5_OpenMPI_Fortran_COMPILER "/usr/lib64/openmpi/bin/h5pfc" CACHE FILEPATH "")
+set(CMake_TEST_FindHDF5_Serial_C_COMPILER "/usr/bin/h5cc" CACHE FILEPATH "")
+set(CMake_TEST_FindHDF5_Serial_CXX_COMPILER "/usr/bin/h5c++" CACHE FILEPATH "")
+set(CMake_TEST_FindHDF5_Serial_Fortran_COMPILER "/usr/bin/h5fc" CACHE FILEPATH "")
+set(CMake_TEST_FindIconv "ON" CACHE BOOL "")
+set(CMake_TEST_FindICU "ON" CACHE BOOL "")
+set(CMake_TEST_FindImageMagick "ON" CACHE BOOL "")
+set(CMake_TEST_FindIntl "ON" CACHE BOOL "")
+set(CMake_TEST_FindJasper "ON" CACHE BOOL "")
+set(CMake_TEST_FindJNI "ON" CACHE BOOL "")
+set(CMake_TEST_FindJPEG "ON" CACHE BOOL "")
+set(CMake_TEST_FindJsonCpp "ON" CACHE BOOL "")
+set(CMake_TEST_FindLAPACK "All;static=1;Generic" CACHE STRING "")
+set(CMake_TEST_FindLibArchive "ON" CACHE BOOL "")
+set(CMake_TEST_FindLibinput "ON" CACHE BOOL "")
+set(CMake_TEST_FindLibLZMA "ON" CACHE BOOL "")
+set(CMake_TEST_FindLibUV "ON" CACHE BOOL "")
+set(CMake_TEST_FindLibXml2 "ON" CACHE BOOL "")
+set(CMake_TEST_FindLibXslt "ON" CACHE BOOL "")
+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;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 "")
+set(CMake_TEST_FindOpenACC_C "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenACC_CXX "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenACC_Fortran "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenAL "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenGL "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenMP_C "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenMP_CXX "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenMP_Fortran "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenMP "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenSP "ON" CACHE BOOL "")
+set(CMake_TEST_FindOpenSSL "ON" CACHE BOOL "")
+set(CMake_TEST_FindPatch "ON" CACHE BOOL "")
+set(CMake_TEST_FindPNG "ON" CACHE BOOL "")
+set(CMake_TEST_FindPostgreSQL "ON" CACHE BOOL "")
+set(CMake_TEST_FindProtobuf "ON" CACHE BOOL "")
+set(CMake_TEST_FindProtobuf_gRPC "ON" CACHE BOOL "")
+set(CMake_TEST_FindPython3 "ON" CACHE BOOL "")
+set(CMake_TEST_FindPython3_NumPy "ON" CACHE BOOL "")
+set(CMake_TEST_FindPython2_PyPy "ON" CACHE BOOL "")
+set(CMake_TEST_FindPython3_PyPy "ON" CACHE BOOL "")
+set(CMake_TEST_FindRuby "ON" CACHE BOOL "")
+set(CMake_TEST_FindRuby_RBENV "ON" CACHE BOOL "")
+set(CMake_TEST_FindRuby_RVM "ON" CACHE BOOL "")
+set(CMake_TEST_FindSDL "ON" CACHE BOOL "")
+set(CMake_TEST_FindSQLite3 "ON" CACHE BOOL "")
+set(CMake_TEST_FindTIFF "ON" CACHE BOOL "")
+set(CMake_TEST_FindwxWidgets "ON" CACHE BOOL "")
+set(CMake_TEST_FindX11 "ON" CACHE BOOL "")
+set(CMake_TEST_FindXalanC "ON" CACHE BOOL "")
+set(CMake_TEST_FindXercesC "ON" CACHE BOOL "")
+
+set(CMake_TEST_ELF_LARGE "ON" CACHE BOOL "")
+set(CMake_TEST_Fortran_SUBMODULES "ON" CACHE BOOL "")
+set(CMake_TEST_IPO_WORKS_C "ON" CACHE BOOL "")
+set(CMake_TEST_IPO_WORKS_CXX "ON" CACHE BOOL "")
+set(CMake_TEST_IPO_WORKS_Fortran "ON" CACHE BOOL "")
+if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+  set(CMake_TEST_ISPC "ON" CACHE STRING "")
+endif()
+set(CMake_TEST_Qt5 "ON" CACHE BOOL "")
+set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERIFY_URL_BAD "https://badtls-expired.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION_URL_BAD "https://badtls-v1-1.kitware.com:8011" CACHE STRING "")
+set(CMake_TEST_UseSWIG "ON" CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_external_test.cmake")
diff --git a/.gitlab/ci/configure_fedora42_makefiles_clang.cmake b/.gitlab/ci/configure_fedora42_makefiles_clang.cmake
new file mode 100644
index 0000000..36588a5
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_makefiles_clang.cmake
@@ -0,0 +1,5 @@
+if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+  set(CMAKE_TESTS_CDASH_SERVER "https://open.cdash.org" CACHE STRING "")
+endif()
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora42_makefiles_lfortran.cmake b/.gitlab/ci/configure_fedora42_makefiles_lfortran.cmake
new file mode 100644
index 0000000..ae32c04
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_makefiles_lfortran.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common_lfortran.cmake")
diff --git a/.gitlab/ci/configure_fedora42_makefiles_symlinked.cmake b/.gitlab/ci/configure_fedora42_makefiles_symlinked.cmake
new file mode 100644
index 0000000..e498a48
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_makefiles_symlinked.cmake
@@ -0,0 +1,5 @@
+set(CMake_QT_MAJOR_VERSION "6" CACHE STRING "")
+set(CMake_TEST_GUI "ON" CACHE BOOL "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_symlinked_common.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common.cmake")
diff --git a/.gitlab/ci/configure_fedora42_ninja.cmake b/.gitlab/ci/configure_fedora42_ninja.cmake
new file mode 100644
index 0000000..07ce93b
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_ninja.cmake
@@ -0,0 +1,20 @@
+set(CMake_TEST_GUI "ON" CACHE BOOL "")
+if (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+  set(CMake_TEST_ISPC "ON" CACHE STRING "")
+endif()
+set(CMake_TEST_MODULE_COMPILATION "named,compile_commands,collation,partitions,internal_partitions,export_bmi,install_bmi,shared,bmionly,build_database" CACHE STRING "")
+set(CMake_TEST_TLS_VERIFY_URL "https://gitlab.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERIFY_URL_BAD "https://badtls-expired.kitware.com" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION "1.3" CACHE STRING "")
+set(CMake_TEST_TLS_VERSION_URL_BAD "https://badtls-v1-1.kitware.com:8011" CACHE STRING "")
+
+# "Release" flags without "-DNDEBUG" so we get assertions.
+set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE STRING "")
+set(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "")
+
+# Cover compilation with C++11 only and not higher standards.
+set(CMAKE_CXX_STANDARD "11" CACHE STRING "")
+# Qt 6 requires C++17, so use Qt 5.
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common.cmake")
diff --git a/.gitlab/ci/configure_fedora42_ninja_clang.cmake b/.gitlab/ci/configure_fedora42_ninja_clang.cmake
new file mode 100644
index 0000000..c95388f
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_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,build_database,import_std23" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora42_ninja_lfortran.cmake b/.gitlab/ci/configure_fedora42_ninja_lfortran.cmake
new file mode 100644
index 0000000..ae32c04
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_ninja_lfortran.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common_lfortran.cmake")
diff --git a/.gitlab/ci/configure_fedora41_ninja_multi.cmake b/.gitlab/ci/configure_fedora42_ninja_multi.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora41_ninja_multi.cmake
rename to .gitlab/ci/configure_fedora42_ninja_multi.cmake
diff --git a/.gitlab/ci/configure_fedora42_ninja_multi_clang.cmake b/.gitlab/ci/configure_fedora42_ninja_multi_clang.cmake
new file mode 100644
index 0000000..a1c7fc0
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_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,build_database" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common_clang.cmake")
diff --git a/.gitlab/ci/configure_fedora41_sphinx.cmake b/.gitlab/ci/configure_fedora42_sphinx.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora41_sphinx.cmake
rename to .gitlab/ci/configure_fedora42_sphinx.cmake
diff --git a/.gitlab/ci/configure_fedora41_sphinx_package.cmake b/.gitlab/ci/configure_fedora42_sphinx_package.cmake
similarity index 100%
rename from .gitlab/ci/configure_fedora41_sphinx_package.cmake
rename to .gitlab/ci/configure_fedora42_sphinx_package.cmake
diff --git a/.gitlab/ci/configure_fedora42_tidy.cmake b/.gitlab/ci/configure_fedora42_tidy.cmake
new file mode 100644
index 0000000..f5dbe06
--- /dev/null
+++ b/.gitlab/ci/configure_fedora42_tidy.cmake
@@ -0,0 +1,7 @@
+set(CMake_RUN_CLANG_TIDY ON CACHE BOOL "")
+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 "")
+set(CMake_CLANG_TIDY_EXPORT_FIXES_DIR "$ENV{CI_PROJECT_DIR}/.gitlab/clang-tidy-fixes" CACHE PATH "")
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common.cmake")
diff --git a/.gitlab/ci/configure_windows_clang_common.cmake b/.gitlab/ci/configure_windows_clang_common.cmake
index 738477e..0d00285 100644
--- a/.gitlab/ci/configure_windows_clang_common.cmake
+++ b/.gitlab/ci/configure_windows_clang_common.cmake
@@ -2,8 +2,8 @@
   set(CMake_TEST_C_STANDARDS "90;99;11;17;23" CACHE STRING "")
   set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23;26" CACHE STRING "")
 else()
-  # FIXME: Implement C23 support for clang-cl.
-  set(CMake_TEST_C_STANDARDS "90;99;11;17" CACHE STRING "")
+  # Testing for clang-cl.
+  set(CMake_TEST_C_STANDARDS "90;99;11;17;23" CACHE STRING "")
   set(CMake_TEST_CXX_STANDARDS "98;11;14;17;20;23" CACHE STRING "")
 endif()
 
diff --git a/.gitlab/ci/configure_windows_package_common.cmake b/.gitlab/ci/configure_windows_package_common.cmake
index 11bfad5..70fca72 100644
--- a/.gitlab/ci/configure_windows_package_common.cmake
+++ b/.gitlab/ci/configure_windows_package_common.cmake
@@ -21,6 +21,4 @@
 
 set(CMake_BUILD_WIX_CUSTOM_ACTION ON CACHE BOOL "")
 
-set(CMake_CPACK_CUSTOM_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/CMakeCPack.cmake" CACHE FILEPATH "")
-
 include("${CMAKE_CURRENT_LIST_DIR}/configure_common.cmake")
diff --git a/.gitlab/ci/ctest_exclusions.cmake b/.gitlab/ci/ctest_exclusions.cmake
index f21a68d..89a5ace 100644
--- a/.gitlab/ci/ctest_exclusions.cmake
+++ b/.gitlab/ci/ctest_exclusions.cmake
@@ -2,9 +2,6 @@
   # This test hits global resources and can be handled by nightly testing.
   # https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4769
   "^BundleGeneratorTest$"
-
-  # This test fails on Windows Terminal 1.22 and above.
-  "^kwsys.testConsoleBuf$"
 )
 
 if (CTEST_CMAKE_GENERATOR MATCHES "Visual Studio")
diff --git a/.gitlab/ci/ctest_memcheck_fedora41_asan.lsan.supp b/.gitlab/ci/ctest_memcheck_fedora42_asan.lsan.supp
similarity index 100%
rename from .gitlab/ci/ctest_memcheck_fedora41_asan.lsan.supp
rename to .gitlab/ci/ctest_memcheck_fedora42_asan.lsan.supp
diff --git a/.gitlab/ci/docker/debian12-aarch64/Dockerfile b/.gitlab/ci/docker/debian12-aarch64/Dockerfile
index 58b5e0e..2344ce5 100644
--- a/.gitlab/ci/docker/debian12-aarch64/Dockerfile
+++ b/.gitlab/ci/docker/debian12-aarch64/Dockerfile
@@ -2,7 +2,15 @@
 
 ARG BASE_IMAGE=arm64v8/debian:12
 
-FROM ${BASE_IMAGE} AS apt-cache
+FROM ${BASE_IMAGE} AS cuda-keyring
+ADD https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/sbsa/cuda-keyring_1.1-1_all.deb /root/
+RUN --mount=type=tmpfs,target=/var/log \
+    apt-get update \
+ && apt-get -y install ca-certificates \
+ && dpkg -i /root/cuda-keyring_1.1-1_all.deb \
+ && rm /root/cuda-keyring_1.1-1_all.deb
+
+FROM cuda-keyring AS apt-cache
 # Populate APT cache w/ the fresh metadata and prefetch packages.
 # Use an empty `docker-clean` file to "hide" the image-provided
 # file to disallow removing packages after `apt-get` operations.
@@ -12,7 +20,7 @@
     apt-get update \
  && apt-get --download-only -y install $(grep -h '^[^#]\+$' /root/*.lst)
 
-FROM ${BASE_IMAGE}
+FROM cuda-keyring
 LABEL maintainer="Brad King <brad.king@kitware.com>"
 
 RUN --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \
diff --git a/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst
index c92c715..2328194 100644
--- a/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst
+++ b/.gitlab/ci/docker/debian12-aarch64/deps_packages.lst
@@ -34,10 +34,13 @@
 
 # Packages needed to test find modules.
 alsa-utils
+aspell
+aspell-en
 doxygen graphviz
 freeglut3-dev
 gnutls-dev
 libarchive-dev
+libaspell-dev
 libblas-dev
 libboost-dev
 libboost-filesystem-dev
@@ -69,6 +72,9 @@
 liblapack-dev
 liblzma-dev
 libmagick++-dev
+libnvpl-blas-dev
+libnvpl-common-dev
+libnvpl-lapack-dev
 libopenal-dev
 libopenmpi-dev openmpi-bin
 libosp-dev
diff --git a/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst
index d92f38d..e6f1188 100644
--- a/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst
+++ b/.gitlab/ci/docker/debian12-x86_64/deps_packages.lst
@@ -48,10 +48,13 @@
 
 # Packages needed to test find modules.
 alsa-utils
+aspell
+aspell-en
 doxygen graphviz
 freeglut3-dev
 gnutls-dev
 libarchive-dev
+libaspell-dev
 libblas-dev
 libboost-dev
 libboost-filesystem-dev
diff --git a/.gitlab/ci/docker/fedora41-hip/Dockerfile b/.gitlab/ci/docker/fedora41-hip/Dockerfile
deleted file mode 100644
index ac7a0ff..0000000
--- a/.gitlab/ci/docker/fedora41-hip/Dockerfile
+++ /dev/null
@@ -1,12 +0,0 @@
-# syntax=docker/dockerfile:1
-
-ARG BASE_IMAGE=fedora:41
-
-FROM ${BASE_IMAGE} AS dnf-cache
-LABEL maintainer="Brad King <brad.king@kitware.com>"
-RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
-    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
-    --mount=type=cache,target=/var/lib/dnf \
-    --mount=type=tmpfs,target=/var/log \
-    --mount=type=tmpfs,target=/tmp \
-    dnf install -y $(grep -h '^[^#]\+$' /root/*.lst)
diff --git a/.gitlab/ci/docker/fedora41-hip/deps_packages.lst b/.gitlab/ci/docker/fedora41-hip/deps_packages.lst
deleted file mode 100644
index 70b114c..0000000
--- a/.gitlab/ci/docker/fedora41-hip/deps_packages.lst
+++ /dev/null
@@ -1,15 +0,0 @@
-# Install development tools.
-clang
-clang-tools-extra
-compiler-rt
-gcc-c++
-git-core
-make
-
-# Install HIP language toolchain.
-hsakmt-devel
-lld
-llvm
-rocm-comgr-devel
-rocm-hip-devel
-rocm-runtime-devel
diff --git a/.gitlab/ci/docker/fedora41/Dockerfile b/.gitlab/ci/docker/fedora41/Dockerfile
deleted file mode 100644
index 67bcbbc..0000000
--- a/.gitlab/ci/docker/fedora41/Dockerfile
+++ /dev/null
@@ -1,135 +0,0 @@
-# syntax=docker/dockerfile:1
-
-ARG BASE_IMAGE=fedora:41
-
-FROM ${BASE_IMAGE} AS dnf-cache
-# Populate DNF cache w/ the fresh metadata and prefetch packages.
-RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
-    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
-    --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
-    --mount=type=bind,source=rbenv_packages.lst,target=/root/rbenv_packages.lst \
-    --mount=type=bind,source=rust_packages.lst,target=/root/rust_packages.lst \
-    --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
-    --mount=type=tmpfs,target=/var/log \
-    --mount=type=tmpfs,target=/tmp \
-    dnf install --downloadonly -y $(grep -h '^[^#]\+$' /root/*.lst)
-
-
-FROM ${BASE_IMAGE} AS rust-build-env
-LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
-# Pre-install prerequisites to build Rust projects.
-RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
-    --mount=type=bind,source=rust_packages.lst,target=/root/rust_packages.lst \
-    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
-    --mount=type=tmpfs,target=/var/log \
-    --mount=type=tmpfs,target=/tmp \
-    dnf install -y $(grep '^[^#]\+$' /root/rust_packages.lst)
-
-
-FROM rust-build-env AS rust-build
-LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
-# Build the needed Rust packages.
-# https://doc.rust-lang.org/cargo/guide/cargo-home.html?highlight=.cargo#caching-the-cargo-home-in-ci
-RUN --mount=type=bind,source=build_rust.sh,target=/root/build_rust.sh \
-    --mount=type=cache,target=/root/.cargo/registry/index \
-    --mount=type=cache,target=/root/.cargo/registry/cache \
-    --mount=type=tmpfs,target=/tmp \
-    sh /root/build_rust.sh
-
-
-FROM ${BASE_IMAGE} AS rvm-build-env
-LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
-# Pre-install prerequisites for RVM.
-RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
-    --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
-    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
-    --mount=type=tmpfs,target=/var/log \
-    --mount=type=tmpfs,target=/tmp \
-    dnf install -y $(grep '^[^#]\+$' /root/rvm_packages.lst)
-
-
-FROM rvm-build-env AS rvm-build
-LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
-# Build Ruby with RVM.
-RUN --mount=type=bind,source=build_rvm.sh,target=/root/build_rvm.sh \
-    --mount=type=cache,target=/usr/local/rvm/archives \
-    --mount=type=cache,target=/usr/local/rvm/gem-cache   \
-    --mount=type=cache,target=/usr/local/rvm/src \
-    --mount=type=tmpfs,target=/tmp \
-    sh /root/build_rvm.sh
-
-
-FROM ${BASE_IMAGE} AS rbenv
-# Pre-install prerequisites for `rbenv`.
-RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
-    --mount=type=bind,source=rbenv_packages.lst,target=/root/rbenv_packages.lst \
-    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
-    --mount=type=tmpfs,target=/var/log \
-    --mount=type=tmpfs,target=/tmp \
-    dnf install -y $(grep '^[^#]\+$' /root/rbenv_packages.lst)
-
-
-FROM rbenv AS rbenv-build
-ENV RBENV_ROOT=/opt/rbenv
-ENV RBENV_BUILD_ROOT=/root/.cache/rbenv-build
-ENV RUBY_BUILD_CACHE_PATH=/root/.cache/rbenv
-# Build Ruby with `rbenv`.
-RUN --mount=type=cache,target=/root/.cache \
-    --mount=type=bind,source=build_rbenv.sh,target=/root/build_rbenv.sh \
-    --mount=type=tmpfs,target=/tmp \
-    sh /root/build_rbenv.sh
-
-
-FROM ${BASE_IMAGE} AS iwyu-build-env
-LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"
-# Pre-install prerequisites to build IWYU.
-RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
-    --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
-    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
-    --mount=type=tmpfs,target=/var/log \
-    --mount=type=tmpfs,target=/tmp \
-    dnf install -y $(grep '^[^#]\+$' /root/iwyu_packages.lst)
-
-
-FROM iwyu-build-env AS iwyu-build
-LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"
-# Build IWYU.
-RUN --mount=type=bind,source=build_iwyu.sh,target=/root/build_iwyu.sh \
-    --mount=type=cache,target=/root/include-what-you-use \
-    --mount=type=tmpfs,target=/tmp \
-    sh /root/build_iwyu.sh
-
-
-FROM ${BASE_IMAGE} AS p4-dl
-# Download Perforce.
-# NOTE `curl` is pre-installed in the base image.
-RUN curl -C- -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz \
-  | tar -C /usr/local/bin -xvzf - -- p4 p4d
-
-
-FROM ${BASE_IMAGE}
-LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
-
-ENV RBENV_ROOT=/opt/rbenv
-
-COPY --from=p4-dl --chown=root:root /usr/local/bin/p4 /usr/local/bin/p4d /usr/local/bin
-
-RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
-    --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \
-    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
-    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
-    --mount=type=tmpfs,target=/var/log \
-    --mount=type=tmpfs,target=/tmp \
-    sh /root/install_deps.sh
-
-RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \
-    tar -C / -xf /root/iwyu.tar
-
-RUN --mount=type=bind,from=rust-build,source=/root,target=/root \
-    tar -C /usr/local -xf /root/rust.tar
-
-RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \
-    tar -C /usr/local -xf /root/rvm.tar
-
-RUN --mount=type=bind,from=rbenv-build,source=/root,target=/root \
-    tar -C / -xf /root/rbenv.tar && rbenv global 3.1.2
diff --git a/.gitlab/ci/docker/fedora41/build_rbenv.sh b/.gitlab/ci/docker/fedora41/build_rbenv.sh
deleted file mode 100755
index 3ed0033..0000000
--- a/.gitlab/ci/docker/fedora41/build_rbenv.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-set -e
-
-echo "gem: --no-document" > ~/.gemrc
-
-# Ruby rbenv
-export RUBY_CONFIGURE_OPTS=--disable-install-doc
-export RUBY_BUILD_CURL_OPTS=-C-
-rbenv install 3.1.2 -k -s -v
-
-cat <<EOF >/tmp/exclude.lst
-*LICENSE*
-*/doc/*
-*/man/*
-*.md
-BSDL
-CONTRIBUTING.*
-COPYING
-LEGAL
-PSFL
-README.rdoc
-History.rdoc
-gem_make.out
-test-unit-*/test
-rss-*/test
-EOF
-tar -cf /root/rbenv.tar --exclude-from=/tmp/exclude.lst ${RBENV_ROOT}
diff --git a/.gitlab/ci/docker/fedora41/build_rvm.sh b/.gitlab/ci/docker/fedora41/build_rvm.sh
deleted file mode 100755
index a62e9a7..0000000
--- a/.gitlab/ci/docker/fedora41/build_rvm.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-
-set -e
-
-echo "gem: --no-document" > ~/.gemrc
-
-gpg2 --keyserver hkps://keyserver.ubuntu.com \
-     --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
-                 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
-
-curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles
-
-export rvm_silence_banner=1
-
-# keep version in sync with `env_fedora*_makefiles.cmake`
-/usr/local/rvm/bin/rvm install ruby-3.0.4 --no-docs --disable-binary
-
-for p in archives docs examples gem-cache log src; do
-    touch /usr/local/rvm/${p}/.tar_exclude
-done
-
-cat <<EOF >/tmp/exclude.lst
-*LICENSE*
-*/doc/*
-*/man/*
-*.md
-BSDL
-CONTRIBUTING.*
-COPYING
-LEGAL
-PSFL
-README.rdoc
-History.rdoc
-gem_make.out
-test-unit-*/test
-rss-*/test
-EOF
-tar -C /usr/local \
-    --exclude-tag-under=.tar_exclude \
-    --exclude-from=/tmp/exclude.lst \
-    -cf /root/rvm.tar rvm
diff --git a/.gitlab/ci/docker/fedora41/deps_packages.lst b/.gitlab/ci/docker/fedora41/deps_packages.lst
deleted file mode 100644
index e311d51..0000000
--- a/.gitlab/ci/docker/fedora41/deps_packages.lst
+++ /dev/null
@@ -1,138 +0,0 @@
-# Install build requirements.
-ncurses-devel
-openssl-devel
-qt5-qtbase-devel
-qt6-qtbase-devel
-
-# Install development tools.
-clang
-clang-devel
-clang-tools-extra
-clang-tools-extra-devel
-compiler-rt
-flang
-gcc-c++
-git-core
-lfortran
-llvm-devel
-make
-
-# Install optional external build dependencies.
-bzip2-devel
-expat-devel
-jsoncpp-devel
-libarchive-devel
-libcurl-devel
-libuv-devel
-libzstd-devel
-rhash-devel
-xz-devel
-zlib-devel
-
-# Install documentation tools.
-python3-sphinx
-python3-sphinxcontrib-qthelp
-qt5-qttools-devel
-qt6-qttools-devel
-texinfo
-
-# Install lint tools.
-clang-analyzer
-codespell
-
-# Tools needed for the test suite.
-file
-findutils
-jq
-which
-
-# Install ASM_NASM language toolchain.
-nasm
-
-# Packages needed to test CTest.
-breezy
-mercurial
-subversion
-
-# Packages needed to test CPack.
-rpm-build
-
-# Packages needed to test find modules.
-alsa-lib-devel
-blas-devel
-boost-devel
-boost-python3-devel
-bzip2-devel
-cups-devel
-DevIL-devel
-doxygen
-expat-devel
-fontconfig-devel
-freeglut-devel
-freetype-devel
-gdal-devel
-gettext
-giflib-devel
-glew-devel
-gmock
-gnutls-devel
-grpc-devel
-grpc-plugins
-gsl-devel
-gtest-devel
-gtk2-devel
-hdf5-devel
-hdf5-mpich-devel
-hdf5-openmpi-devel
-ImageMagick-c++-devel
-jasper-devel
-java-11-openjdk-devel
-jsoncpp-devel
-lapack-devel
-libarchive-devel
-libcurl-devel
-libicu-devel
-libinput-devel
-libjpeg-turbo-devel
-libomp-devel
-libpng-devel
-libtiff-devel
-libuv-devel
-libxml2-devel
-libxslt-devel
-mpich-devel
-openal-soft-devel
-openmpi-devel
-opensp-devel
-patch
-perl
-postgresql-server-devel
-protobuf-c-devel
-protobuf-devel
-protobuf-lite-devel
-pypy2
-pypy2-devel
-pypy3
-pypy3-devel
-python3
-python3-devel
-python3-jsmin
-python3-jsonschema
-python3-numpy
-rbenv
-ruby
-ruby-build-rbenv
-ruby-devel
-rubygems
-SDL-devel
-sqlite-devel
-swig
-systemd-devel
-unixODBC-devel
-wxGTK-devel
-xalan-c-devel
-xerces-c-devel
-xz-devel
-
-# Packages needed to test third-party binaries.
-ncurses-compat-libs
diff --git a/.gitlab/ci/docker/fedora41/rvm_packages.lst b/.gitlab/ci/docker/fedora41/rvm_packages.lst
deleted file mode 100644
index dc9f981..0000000
--- a/.gitlab/ci/docker/fedora41/rvm_packages.lst
+++ /dev/null
@@ -1,19 +0,0 @@
-autoconf
-automake
-bison
-bzip2
-findutils
-gcc-c++
-glibc-devel
-gnupg2
-libffi-devel
-libtool
-libyaml-devel
-make
-openssl-devel
-patch
-procps
-readline-devel
-sqlite-devel
-which
-zlib-devel
diff --git a/.gitlab/ci/docker/fedora42-hip/Dockerfile b/.gitlab/ci/docker/fedora42-hip/Dockerfile
new file mode 100644
index 0000000..22e5e2f
--- /dev/null
+++ b/.gitlab/ci/docker/fedora42-hip/Dockerfile
@@ -0,0 +1,12 @@
+# syntax=docker/dockerfile:1
+
+ARG BASE_IMAGE=fedora:42
+
+FROM ${BASE_IMAGE} AS dnf-cache
+LABEL maintainer="Brad King <brad.king@kitware.com>"
+RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
+    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
+    --mount=type=cache,target=/var/lib/dnf \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    dnf install -y $(grep -h '^[^#]\+$' /root/*.lst)
diff --git a/.gitlab/ci/docker/fedora42-hip/deps_packages.lst b/.gitlab/ci/docker/fedora42-hip/deps_packages.lst
new file mode 100644
index 0000000..abae13a
--- /dev/null
+++ b/.gitlab/ci/docker/fedora42-hip/deps_packages.lst
@@ -0,0 +1,16 @@
+# Install development tools.
+clang
+clang-tools-extra
+compiler-rt
+gcc-c++
+git-core
+make
+
+# Install HIP language toolchain.
+hsakmt-devel
+lld
+llvm
+rocm-comgr-devel
+rocm-hip-devel
+rocm-runtime-devel
+rocminfo
diff --git a/.gitlab/ci/docker/fedora41-hip/dnf.conf b/.gitlab/ci/docker/fedora42-hip/dnf.conf
similarity index 100%
rename from .gitlab/ci/docker/fedora41-hip/dnf.conf
rename to .gitlab/ci/docker/fedora42-hip/dnf.conf
diff --git a/.gitlab/ci/docker/fedora42/Dockerfile b/.gitlab/ci/docker/fedora42/Dockerfile
new file mode 100644
index 0000000..e78b76b
--- /dev/null
+++ b/.gitlab/ci/docker/fedora42/Dockerfile
@@ -0,0 +1,135 @@
+# syntax=docker/dockerfile:1
+
+ARG BASE_IMAGE=fedora:42
+
+FROM ${BASE_IMAGE} AS dnf-cache
+# Populate DNF cache w/ the fresh metadata and prefetch packages.
+RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
+    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
+    --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
+    --mount=type=bind,source=rbenv_packages.lst,target=/root/rbenv_packages.lst \
+    --mount=type=bind,source=rust_packages.lst,target=/root/rust_packages.lst \
+    --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    dnf install --downloadonly -y $(grep -h '^[^#]\+$' /root/*.lst)
+
+
+FROM ${BASE_IMAGE} AS rust-build-env
+LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
+# Pre-install prerequisites to build Rust projects.
+RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
+    --mount=type=bind,source=rust_packages.lst,target=/root/rust_packages.lst \
+    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    dnf install -y $(grep '^[^#]\+$' /root/rust_packages.lst)
+
+
+FROM rust-build-env AS rust-build
+LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
+# Build the needed Rust packages.
+# https://doc.rust-lang.org/cargo/guide/cargo-home.html?highlight=.cargo#caching-the-cargo-home-in-ci
+RUN --mount=type=bind,source=build_rust.sh,target=/root/build_rust.sh \
+    --mount=type=cache,target=/root/.cargo/registry/index \
+    --mount=type=cache,target=/root/.cargo/registry/cache \
+    --mount=type=tmpfs,target=/tmp \
+    sh /root/build_rust.sh
+
+
+FROM ${BASE_IMAGE} AS rvm-build-env
+LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
+# Pre-install prerequisites for RVM.
+RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
+    --mount=type=bind,source=rvm_packages.lst,target=/root/rvm_packages.lst \
+    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    dnf install -y $(grep '^[^#]\+$' /root/rvm_packages.lst)
+
+
+FROM rvm-build-env AS rvm-build
+LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
+# Build Ruby with RVM.
+RUN --mount=type=bind,source=build_rvm.sh,target=/root/build_rvm.sh \
+    --mount=type=cache,target=/usr/local/rvm/archives \
+    --mount=type=cache,target=/usr/local/rvm/gem-cache   \
+    --mount=type=cache,target=/usr/local/rvm/src \
+    --mount=type=tmpfs,target=/tmp \
+    sh /root/build_rvm.sh
+
+
+FROM ${BASE_IMAGE} AS rbenv
+# Pre-install prerequisites for `rbenv`.
+RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
+    --mount=type=bind,source=rbenv_packages.lst,target=/root/rbenv_packages.lst \
+    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    dnf install -y $(grep '^[^#]\+$' /root/rbenv_packages.lst)
+
+
+FROM rbenv AS rbenv-build
+ENV RBENV_ROOT=/opt/rbenv
+ENV RBENV_BUILD_ROOT=/root/.cache/rbenv-build
+ENV RUBY_BUILD_CACHE_PATH=/root/.cache/rbenv
+# Build Ruby with `rbenv`.
+RUN --mount=type=cache,target=/root/.cache \
+    --mount=type=bind,source=build_rbenv.sh,target=/root/build_rbenv.sh \
+    --mount=type=tmpfs,target=/tmp \
+    sh /root/build_rbenv.sh
+
+
+FROM ${BASE_IMAGE} AS iwyu-build-env
+LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"
+# Pre-install prerequisites to build IWYU.
+RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
+    --mount=type=bind,source=iwyu_packages.lst,target=/root/iwyu_packages.lst \
+    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    dnf install -y $(grep '^[^#]\+$' /root/iwyu_packages.lst)
+
+
+FROM iwyu-build-env AS iwyu-build
+LABEL maintainer="Kyle Edwards <kyle.edwards@kitware.com>"
+# Build IWYU.
+RUN --mount=type=bind,source=build_iwyu.sh,target=/root/build_iwyu.sh \
+    --mount=type=cache,target=/root/include-what-you-use \
+    --mount=type=tmpfs,target=/tmp \
+    sh /root/build_iwyu.sh
+
+
+FROM ${BASE_IMAGE} AS p4-dl
+# Download Perforce.
+# NOTE `curl` is pre-installed in the base image.
+RUN curl -C- -L https://www.perforce.com/downloads/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz \
+  | tar -C /usr/local/bin -xvzf - -- p4 p4d
+
+
+FROM ${BASE_IMAGE}
+LABEL maintainer="Ben Boeckel <ben.boeckel@kitware.com>"
+
+ENV RBENV_ROOT=/opt/rbenv
+
+COPY --from=p4-dl --chown=root:root /usr/local/bin/p4 /usr/local/bin/p4d /usr/local/bin
+
+RUN --mount=type=bind,source=dnf.conf,target=/etc/dnf/dnf.conf \
+    --mount=type=bind,source=install_deps.sh,target=/root/install_deps.sh \
+    --mount=type=bind,source=deps_packages.lst,target=/root/deps_packages.lst \
+    --mount=type=cache,from=dnf-cache,source=/var/cache/libdnf5,target=/var/cache/libdnf5,sharing=private \
+    --mount=type=tmpfs,target=/var/log \
+    --mount=type=tmpfs,target=/tmp \
+    sh /root/install_deps.sh
+
+RUN --mount=type=bind,from=iwyu-build,source=/root,target=/root \
+    tar -C / -xf /root/iwyu.tar
+
+RUN --mount=type=bind,from=rust-build,source=/root,target=/root \
+    tar -C /usr/local -xf /root/rust.tar
+
+RUN --mount=type=bind,from=rvm-build,source=/root,target=/root \
+    tar -C /usr/local -xf /root/rvm.tar
+
+RUN --mount=type=bind,from=rbenv-build,source=/root,target=/root \
+    tar -C / -xf /root/rbenv.tar && rbenv global 3.4.3
diff --git a/.gitlab/ci/docker/fedora41/build_iwyu.sh b/.gitlab/ci/docker/fedora42/build_iwyu.sh
similarity index 100%
rename from .gitlab/ci/docker/fedora41/build_iwyu.sh
rename to .gitlab/ci/docker/fedora42/build_iwyu.sh
diff --git a/.gitlab/ci/docker/fedora42/build_rbenv.sh b/.gitlab/ci/docker/fedora42/build_rbenv.sh
new file mode 100755
index 0000000..feb574f
--- /dev/null
+++ b/.gitlab/ci/docker/fedora42/build_rbenv.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+echo "gem: --no-document" > ~/.gemrc
+
+# Ruby rbenv
+export RUBY_CONFIGURE_OPTS=--disable-install-doc
+export RUBY_BUILD_CURL_OPTS=-C-
+rbenv install 3.4.3 -k -s -v
+
+cat <<EOF >/tmp/exclude.lst
+*LICENSE*
+*/doc/*
+*/man/*
+*.md
+BSDL
+CONTRIBUTING.*
+COPYING
+LEGAL
+PSFL
+README.rdoc
+History.rdoc
+gem_make.out
+test-unit-*/test
+rss-*/test
+EOF
+tar -cf /root/rbenv.tar --exclude-from=/tmp/exclude.lst ${RBENV_ROOT}
diff --git a/.gitlab/ci/docker/fedora41/build_rust.sh b/.gitlab/ci/docker/fedora42/build_rust.sh
similarity index 100%
rename from .gitlab/ci/docker/fedora41/build_rust.sh
rename to .gitlab/ci/docker/fedora42/build_rust.sh
diff --git a/.gitlab/ci/docker/fedora42/build_rvm.sh b/.gitlab/ci/docker/fedora42/build_rvm.sh
new file mode 100755
index 0000000..22c4333
--- /dev/null
+++ b/.gitlab/ci/docker/fedora42/build_rvm.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+echo "gem: --no-document" > ~/.gemrc
+
+gpg2 --keyserver hkps://keyserver.ubuntu.com \
+     --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \
+                 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
+
+curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles
+
+export rvm_silence_banner=1
+
+# keep version in sync with `env_fedora*_makefiles.cmake`
+/usr/local/rvm/bin/rvm install ruby-3.3.8 --no-docs --disable-binary
+
+for p in archives docs examples gem-cache log src; do
+    touch /usr/local/rvm/${p}/.tar_exclude
+done
+
+cat <<EOF >/tmp/exclude.lst
+*LICENSE*
+*/doc/*
+*/man/*
+*.md
+BSDL
+CONTRIBUTING.*
+COPYING
+LEGAL
+PSFL
+README.rdoc
+History.rdoc
+gem_make.out
+test-unit-*/test
+rss-*/test
+EOF
+tar -C /usr/local \
+    --exclude-tag-under=.tar_exclude \
+    --exclude-from=/tmp/exclude.lst \
+    -cf /root/rvm.tar rvm
diff --git a/.gitlab/ci/docker/fedora42/deps_packages.lst b/.gitlab/ci/docker/fedora42/deps_packages.lst
new file mode 100644
index 0000000..5682514
--- /dev/null
+++ b/.gitlab/ci/docker/fedora42/deps_packages.lst
@@ -0,0 +1,141 @@
+# Install build requirements.
+ncurses-devel
+openssl-devel
+qt5-qtbase-devel
+qt6-qtbase-devel
+
+# Install development tools.
+clang
+clang-devel
+clang-tools-extra
+clang-tools-extra-devel
+compiler-rt
+flang
+gcc-c++
+git-core
+lfortran
+llvm-devel
+make
+
+# Install optional external build dependencies.
+bzip2-devel
+expat-devel
+jsoncpp-devel
+libarchive-devel
+libcurl-devel
+libuv-devel
+libzstd-devel
+rhash-devel
+xz-devel
+zlib-devel
+
+# Install documentation tools.
+python3-sphinx
+python3-sphinxcontrib-qthelp
+qt5-qttools-devel
+qt6-qttools-devel
+texinfo
+
+# Install lint tools.
+clang-analyzer
+codespell
+
+# Tools needed for the test suite.
+file
+findutils
+jq
+which
+
+# Install ASM_NASM language toolchain.
+nasm
+
+# Packages needed to test CTest.
+breezy
+mercurial
+subversion
+
+# Packages needed to test CPack.
+rpm-build
+
+# Packages needed to test find modules.
+alsa-lib-devel
+aspell
+aspell-devel
+aspell-en
+blas-devel
+boost-devel
+boost-python3-devel
+bzip2-devel
+cups-devel
+DevIL-devel
+doxygen
+expat-devel
+fontconfig-devel
+freeglut-devel
+freetype-devel
+gdal-devel
+gettext
+giflib-devel
+glew-devel
+gmock
+gnutls-devel
+grpc-devel
+grpc-plugins
+gsl-devel
+gtest-devel
+gtk2-devel
+hdf5-devel
+hdf5-mpich-devel
+hdf5-openmpi-devel
+ImageMagick-c++-devel
+jasper-devel
+java-21-openjdk-devel
+jsoncpp-devel
+lapack-devel
+libarchive-devel
+libcurl-devel
+libicu-devel
+libinput-devel
+libjpeg-turbo-devel
+libomp-devel
+libpng-devel
+libtiff-devel
+libuv-devel
+libxml2-devel
+libxslt-devel
+mpich-devel
+openal-soft-devel
+openmpi-devel
+opensp-devel
+patch
+perl
+postgresql-server-devel
+protobuf-c-devel
+protobuf-devel
+protobuf-lite-devel
+pypy2
+pypy2-devel
+pypy3
+pypy3-devel
+python3
+python3-devel
+python3-jsmin
+python3-jsonschema
+python3-numpy
+rbenv
+ruby
+ruby-build-rbenv
+ruby-devel
+rubygems
+SDL-devel
+sqlite-devel
+swig
+systemd-devel
+unixODBC-devel
+wxGTK-devel
+xalan-c-devel
+xerces-c-devel
+xz-devel
+
+# Packages needed to test third-party binaries.
+ncurses-compat-libs
diff --git a/.gitlab/ci/docker/fedora41/dnf.conf b/.gitlab/ci/docker/fedora42/dnf.conf
similarity index 100%
rename from .gitlab/ci/docker/fedora41/dnf.conf
rename to .gitlab/ci/docker/fedora42/dnf.conf
diff --git a/.gitlab/ci/docker/fedora41/install_deps.sh b/.gitlab/ci/docker/fedora42/install_deps.sh
similarity index 100%
rename from .gitlab/ci/docker/fedora41/install_deps.sh
rename to .gitlab/ci/docker/fedora42/install_deps.sh
diff --git a/.gitlab/ci/docker/fedora41/iwyu_packages.lst b/.gitlab/ci/docker/fedora42/iwyu_packages.lst
similarity index 100%
rename from .gitlab/ci/docker/fedora41/iwyu_packages.lst
rename to .gitlab/ci/docker/fedora42/iwyu_packages.lst
diff --git a/.gitlab/ci/docker/fedora41/rbenv_packages.lst b/.gitlab/ci/docker/fedora42/rbenv_packages.lst
similarity index 100%
rename from .gitlab/ci/docker/fedora41/rbenv_packages.lst
rename to .gitlab/ci/docker/fedora42/rbenv_packages.lst
diff --git a/.gitlab/ci/docker/fedora41/rust_packages.lst b/.gitlab/ci/docker/fedora42/rust_packages.lst
similarity index 100%
rename from .gitlab/ci/docker/fedora41/rust_packages.lst
rename to .gitlab/ci/docker/fedora42/rust_packages.lst
diff --git a/.gitlab/ci/docker/fedora42/rvm_packages.lst b/.gitlab/ci/docker/fedora42/rvm_packages.lst
new file mode 100644
index 0000000..3ab692c
--- /dev/null
+++ b/.gitlab/ci/docker/fedora42/rvm_packages.lst
@@ -0,0 +1,20 @@
+autoconf
+automake
+bison
+bzip2
+findutils
+gawk
+gcc-c++
+glibc-devel
+gnupg2
+libffi-devel
+libtool
+libyaml-devel
+make
+openssl-devel
+patch
+procps
+readline-devel
+sqlite-devel
+which
+zlib-devel
diff --git a/.gitlab/ci/env.sh b/.gitlab/ci/env.sh
index aa709a8..de5cf6f 100644
--- a/.gitlab/ci/env.sh
+++ b/.gitlab/ci/env.sh
@@ -22,3 +22,10 @@
 if test -r ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"; then
   source ".gitlab/ci/env_${CMAKE_CONFIGURATION}.sh"
 fi
+
+case "$(uname -s)-$(uname -m)" in
+    Linux-*)
+        # Remove superuser tools from PATH.
+        export PATH=$(echo "$PATH" | sed 's|:[^:]*/sbin:|:|g')
+        ;;
+esac
diff --git a/.gitlab/ci/env_fedora41_common_clang.sh b/.gitlab/ci/env_fedora41_common_clang.sh
deleted file mode 100644
index 02c8ca6..0000000
--- a/.gitlab/ci/env_fedora41_common_clang.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-export CC=/usr/bin/clang-19
-export CXX=/usr/bin/clang++-19
-export FC=/usr/bin/flang-new
diff --git a/.gitlab/ci/env_fedora41_hip_radeon.sh b/.gitlab/ci/env_fedora41_hip_radeon.sh
deleted file mode 100644
index 8024f56..0000000
--- a/.gitlab/ci/env_fedora41_hip_radeon.sh
+++ /dev/null
@@ -1 +0,0 @@
-export HIPCXX=/usr/bin/clang++-18
diff --git a/.gitlab/ci/env_fedora41_makefiles.cmake b/.gitlab/ci/env_fedora41_makefiles.cmake
deleted file mode 100644
index ef13cda..0000000
--- a/.gitlab/ci/env_fedora41_makefiles.cmake
+++ /dev/null
@@ -1 +0,0 @@
-set(ENV{MY_RUBY_HOME} "/usr/local/rvm/rubies/ruby-3.0.4")
diff --git a/.gitlab/ci/env_fedora41_makefiles.sh b/.gitlab/ci/env_fedora41_makefiles.sh
deleted file mode 100644
index c482642..0000000
--- a/.gitlab/ci/env_fedora41_makefiles.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-if test "$CMAKE_CI_NIGHTLY" = "true"; then
-  source .gitlab/ci/ispc-env.sh
-fi
-
-# Patch HDF5 Fortran compiler wrappers to work around Fedora bug.
-# https://bugzilla.redhat.com/show_bug.cgi?id=2183289
-sed -i '/^includedir=/ s|/mpich-x86_64||'   /usr/lib64/mpich/bin/h5pfc
-sed -i '/^includedir=/ s|/openmpi-x86_64||' /usr/lib64/openmpi/bin/h5pfc
diff --git a/.gitlab/ci/env_fedora41_makefiles_clang.sh b/.gitlab/ci/env_fedora41_makefiles_clang.sh
deleted file mode 100644
index e2892e5..0000000
--- a/.gitlab/ci/env_fedora41_makefiles_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora41_common_clang.sh
diff --git a/.gitlab/ci/env_fedora41_makefiles_lfortran.sh b/.gitlab/ci/env_fedora41_makefiles_lfortran.sh
deleted file mode 100644
index 10e5623..0000000
--- a/.gitlab/ci/env_fedora41_makefiles_lfortran.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora41_common_lfortran.sh
diff --git a/.gitlab/ci/env_fedora41_makefiles_symlinked.cmake b/.gitlab/ci/env_fedora41_makefiles_symlinked.cmake
deleted file mode 100644
index 16937df..0000000
--- a/.gitlab/ci/env_fedora41_makefiles_symlinked.cmake
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/env_fedora41_makefiles.cmake")
diff --git a/.gitlab/ci/env_fedora41_makefiles_symlinked.sh b/.gitlab/ci/env_fedora41_makefiles_symlinked.sh
deleted file mode 100644
index 7f84e9f..0000000
--- a/.gitlab/ci/env_fedora41_makefiles_symlinked.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora41_makefiles.sh
diff --git a/.gitlab/ci/env_fedora41_ninja_clang.sh b/.gitlab/ci/env_fedora41_ninja_clang.sh
deleted file mode 100644
index e2892e5..0000000
--- a/.gitlab/ci/env_fedora41_ninja_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora41_common_clang.sh
diff --git a/.gitlab/ci/env_fedora41_ninja_lfortran.sh b/.gitlab/ci/env_fedora41_ninja_lfortran.sh
deleted file mode 100644
index 10e5623..0000000
--- a/.gitlab/ci/env_fedora41_ninja_lfortran.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora41_common_lfortran.sh
diff --git a/.gitlab/ci/env_fedora41_ninja_multi_clang.sh b/.gitlab/ci/env_fedora41_ninja_multi_clang.sh
deleted file mode 100644
index e2892e5..0000000
--- a/.gitlab/ci/env_fedora41_ninja_multi_clang.sh
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/env_fedora41_common_clang.sh
diff --git a/.gitlab/ci/env_fedora41_asan.sh b/.gitlab/ci/env_fedora42_asan.sh
similarity index 100%
rename from .gitlab/ci/env_fedora41_asan.sh
rename to .gitlab/ci/env_fedora42_asan.sh
diff --git a/.gitlab/ci/env_fedora41_clang_analyzer.sh b/.gitlab/ci/env_fedora42_clang_analyzer.sh
similarity index 100%
rename from .gitlab/ci/env_fedora41_clang_analyzer.sh
rename to .gitlab/ci/env_fedora42_clang_analyzer.sh
diff --git a/.gitlab/ci/env_fedora42_common_clang.sh b/.gitlab/ci/env_fedora42_common_clang.sh
new file mode 100644
index 0000000..43775d2
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_common_clang.sh
@@ -0,0 +1,3 @@
+export CC=/usr/bin/clang-20
+export CXX=/usr/bin/clang++-20
+export FC=/usr/bin/flang-20
diff --git a/.gitlab/ci/env_fedora41_common_lfortran.sh b/.gitlab/ci/env_fedora42_common_lfortran.sh
similarity index 100%
rename from .gitlab/ci/env_fedora41_common_lfortran.sh
rename to .gitlab/ci/env_fedora42_common_lfortran.sh
diff --git a/.gitlab/ci/env_fedora41_extdeps.sh b/.gitlab/ci/env_fedora42_extdeps.sh
similarity index 100%
rename from .gitlab/ci/env_fedora41_extdeps.sh
rename to .gitlab/ci/env_fedora42_extdeps.sh
diff --git a/.gitlab/ci/env_fedora42_hip_radeon.sh b/.gitlab/ci/env_fedora42_hip_radeon.sh
new file mode 100644
index 0000000..cc57cc7
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_hip_radeon.sh
@@ -0,0 +1,2 @@
+export HIPCXX=/usr/bin/clang++-20
+export HIPFLAGS='--rocm-path=/usr --rocm-device-lib-path=/usr/lib64/rocm/llvm/lib/clang/18/amdgcn/bitcode'
diff --git a/.gitlab/ci/env_fedora42_makefiles.cmake b/.gitlab/ci/env_fedora42_makefiles.cmake
new file mode 100644
index 0000000..722c10e
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_makefiles.cmake
@@ -0,0 +1 @@
+set(ENV{MY_RUBY_HOME} "/usr/local/rvm/rubies/ruby-3.3.8")
diff --git a/.gitlab/ci/env_fedora41_ninja.sh b/.gitlab/ci/env_fedora42_makefiles.sh
similarity index 100%
copy from .gitlab/ci/env_fedora41_ninja.sh
copy to .gitlab/ci/env_fedora42_makefiles.sh
diff --git a/.gitlab/ci/env_fedora42_makefiles_clang.sh b/.gitlab/ci/env_fedora42_makefiles_clang.sh
new file mode 100644
index 0000000..8067256
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_makefiles_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora42_common_clang.sh
diff --git a/.gitlab/ci/env_fedora42_makefiles_lfortran.sh b/.gitlab/ci/env_fedora42_makefiles_lfortran.sh
new file mode 100644
index 0000000..9d559f9
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_makefiles_lfortran.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora42_common_lfortran.sh
diff --git a/.gitlab/ci/env_fedora42_makefiles_symlinked.cmake b/.gitlab/ci/env_fedora42_makefiles_symlinked.cmake
new file mode 100644
index 0000000..fcf100a
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_makefiles_symlinked.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/env_fedora42_makefiles.cmake")
diff --git a/.gitlab/ci/env_fedora42_makefiles_symlinked.sh b/.gitlab/ci/env_fedora42_makefiles_symlinked.sh
new file mode 100644
index 0000000..c18e125
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_makefiles_symlinked.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora42_makefiles.sh
diff --git a/.gitlab/ci/env_fedora41_ninja.sh b/.gitlab/ci/env_fedora42_ninja.sh
similarity index 100%
rename from .gitlab/ci/env_fedora41_ninja.sh
rename to .gitlab/ci/env_fedora42_ninja.sh
diff --git a/.gitlab/ci/env_fedora42_ninja_clang.sh b/.gitlab/ci/env_fedora42_ninja_clang.sh
new file mode 100644
index 0000000..8067256
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_ninja_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora42_common_clang.sh
diff --git a/.gitlab/ci/env_fedora42_ninja_lfortran.sh b/.gitlab/ci/env_fedora42_ninja_lfortran.sh
new file mode 100644
index 0000000..9d559f9
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_ninja_lfortran.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora42_common_lfortran.sh
diff --git a/.gitlab/ci/env_fedora41_ninja_multi.sh b/.gitlab/ci/env_fedora42_ninja_multi.sh
similarity index 100%
rename from .gitlab/ci/env_fedora41_ninja_multi.sh
rename to .gitlab/ci/env_fedora42_ninja_multi.sh
diff --git a/.gitlab/ci/env_fedora42_ninja_multi_clang.sh b/.gitlab/ci/env_fedora42_ninja_multi_clang.sh
new file mode 100644
index 0000000..8067256
--- /dev/null
+++ b/.gitlab/ci/env_fedora42_ninja_multi_clang.sh
@@ -0,0 +1 @@
+. .gitlab/ci/env_fedora42_common_clang.sh
diff --git a/.gitlab/ci/env_windows_arm64_package.ps1 b/.gitlab/ci/env_windows_arm64_package.ps1
deleted file mode 100644
index 74c9c2b..0000000
--- a/.gitlab/ci/env_windows_arm64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/wix4-env.ps1
diff --git a/.gitlab/ci/env_windows_i386_package.ps1 b/.gitlab/ci/env_windows_i386_package.ps1
deleted file mode 100644
index 74c9c2b..0000000
--- a/.gitlab/ci/env_windows_i386_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/wix4-env.ps1
diff --git a/.gitlab/ci/env_windows_x86_64_package.ps1 b/.gitlab/ci/env_windows_x86_64_package.ps1
deleted file mode 100644
index 74c9c2b..0000000
--- a/.gitlab/ci/env_windows_x86_64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/wix4-env.ps1
diff --git a/.gitlab/ci/extdeps-linux.sh b/.gitlab/ci/extdeps-linux.sh
index f091525..87ed1d8 100755
--- a/.gitlab/ci/extdeps-linux.sh
+++ b/.gitlab/ci/extdeps-linux.sh
@@ -71,7 +71,7 @@
 
 git clone https://github.com/google/cppdap.git
 cd cppdap
-git checkout 03cc18678ed2ed8b2424ec99dee7e4655d876db5 # 2023-05-25
+git checkout c69444ed76f7468b232ac4f989cb8f2bdc100185 # 2024-08-02
 cd ..
 cmake -S cppdap -B cppdap-build \
   -DCPPDAP_USE_EXTERNAL_JSONCPP_PACKAGE=ON \
diff --git a/.gitlab/ci/iar-env.sh b/.gitlab/ci/iar-env.sh
index 8583c71..9ec7494 100644
--- a/.gitlab/ci/iar-env.sh
+++ b/.gitlab/ci/iar-env.sh
@@ -1,5 +1,5 @@
 files='
-bxarm-9.60.3.deb
+bxarm-9.60.4.deb
 bxavr-8.10.2.deb
 bxrh850-3.10.2.deb
 bxriscv-3.30.1.deb
@@ -12,7 +12,7 @@
 done
 
 echo '
-b65e7e51fa61dd058d9946901ccb2d2b878973573e8d28761644d541bb93a82d  bxarm-9.60.3.deb
+cd92a136bc9bbb1e713121cb407131b54250d2ae30809df3cd752c6383e1878f  bxarm-9.60.4.deb
 4a1065291952a23a8bfbbaa4eb36ca49b0af8653b8faab34ce955d9d48d64506  bxavr-8.10.2.deb
 b14085a0f21750c58168125d3cece2e3fcbd4c6495c652b5e65b6637bac0ac31  bxrh850-3.10.2.deb
 517e18dffdd4345f97c480b5128c7feea25ec1c3f06e62d8e2e6808c401d514a  bxriscv-3.30.1.deb
diff --git a/.gitlab/ci/iar.ps1 b/.gitlab/ci/iar.ps1
index a372437..2034fa2 100644
--- a/.gitlab/ci/iar.ps1
+++ b/.gitlab/ci/iar.ps1
@@ -7,7 +7,7 @@
 $iar_dir = New-Item -Force -ItemType Directory -Path "$outdir\iar"
 
 $files = @{
-    "bxarm-9.60.3.7274-1.zip"  = "AE1923440B260FD8F7AA75AB0BF15B8AC7AF9A7865C07F6B9A73F8D05DFEA7E1"
+    "bxarm-9.60.4.11196-1.zip" = "0DE5F610D0FA3A6513C856BC2403A84D5277F1F6D0D65A6022D1FD745BC4AF6A"
     "BXAVR-8102-1.zip"         = "862EFD23531854506070D5647F9B32197B80E5A727304BFBD8E386A3DAADF093"
     "BXRH850-3102-1.zip"       = "8D1D009A0D138C7CA8431316123CB85CE1B41319A68B997F90D2E338CD469C7F"
     "BXRISCV-3301-1.zip"       = "59FF23F7B98EE72567A23942DE799AF137791A19BFEC102B2A59821FABBCA55A"
diff --git a/.gitlab/ci/intel.ps1 b/.gitlab/ci/intel.ps1
index 171e6a7..c6bf710 100644
--- a/.gitlab/ci/intel.ps1
+++ b/.gitlab/ci/intel.ps1
@@ -1,14 +1,14 @@
 $erroractionpreference = "stop"
 
-if ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)(oneapi2024\.1\.0)(_|$)") {
-    # Intel oneAPI 2024.1.0
-    $version = "2024.1.0"
-    $version_dir = "2024.1"
+if ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)(oneapi2025\.1)(_|$)") {
+    # Intel oneAPI 2025.1.2
+    $version = "2025.1.2"
+    $version_dir = "2025.1"
     $bin_dir = "bin"
     $llvm_dir = "bin\compiler"
     $filename = "intel-oneapi-$version-windows-1"
-    $sha256sum = "CB6857C08CD815722913358EC495AA575C2EED730646098A6CF7178E55FA7323"
-} elseif ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)(intel2021\.9\.0)(_|$)") {
+    $sha256sum = "CA7D5B4E5C11AA9FAF6ED56045D2440F620A2DA3D8BF2B8B644280C9B10DE844"
+} elseif ("$env:CMAKE_CI_BUILD_NAME" -match "(^|_)(intel2021\.9)(_|$)") {
     # Intel oneAPI 2023.1.0
     $version = "2023.1.0"
     $version_dir = "2023.1.0"
diff --git a/.gitlab/ci/package_info.cmake.in b/.gitlab/ci/package_info.cmake.in
deleted file mode 100644
index f9a5bb7..0000000
--- a/.gitlab/ci/package_info.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CPACK_PACKAGE_FILE_NAME "@CPACK_PACKAGE_FILE_NAME@")
diff --git a/.gitlab/ci/package_windows.ps1 b/.gitlab/ci/package_windows.ps1
index 9ec2942..5b787f4 100644
--- a/.gitlab/ci/package_windows.ps1
+++ b/.gitlab/ci/package_windows.ps1
@@ -1,7 +1,3 @@
-if (Test-Path -Path "build/ci_package_info.cmake" -PathType Leaf) {
-    cmake -P .gitlab/ci/package_windows_build.cmake
-} else {
-    cd build
-    cpack -G ZIP
-    cpack -G WIX
-}
+cd build
+. ../Utilities/Release/win/sign-package.ps1 -cpack cpack
+if (-not $?) { Exit $LastExitCode }
diff --git a/.gitlab/ci/package_windows_build.cmake b/.gitlab/ci/package_windows_build.cmake
deleted file mode 100644
index a2b7ed4..0000000
--- a/.gitlab/ci/package_windows_build.cmake
+++ /dev/null
@@ -1,42 +0,0 @@
-cmake_minimum_required(VERSION 3.29)
-include(build/ci_package_info.cmake)
-
-set(build "${CMAKE_CURRENT_BINARY_DIR}/build")
-
-file(GLOB paths RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
-  # Allow CPack to find CMAKE_ROOT and license text.
-  "${build}/CMakeFiles/CMakeSourceDir.txt"
-  "${build}/CMakeFiles/LICENSE.txt"
-
-  # We need the main binaries.
-  "${build}/bin"
-
-  # Pass through the documentation.
-  "${build}/install-doc"
-
-  # CPack configuration.
-  "${build}/CPackConfig.cmake"
-  "${build}/CMakeCPackOptions.cmake"
-  "${build}/Source/QtDialog/QtDialogCPack.cmake"
-
-  # CPack/IFW packaging files.
-  "${build}/CMake*.qs"
-
-  # CPack/WIX packaging files.
-  "${build}/Utilities/Release/WiX/custom_action_dll*.wxs"
-  "${build}/Utilities/Release/WiX/CustomAction/CMakeWiXCustomActions.*"
-  )
-
-file(GLOB_RECURSE paths_recurse RELATIVE "${CMAKE_CURRENT_BINARY_DIR}"
-  # Install rules.
-  "${build}/cmake_install.cmake"
-  "${build}/*/cmake_install.cmake"
-  )
-
-# Create a "package" containing the build-tree files needed to build a package.
-file(MAKE_DIRECTORY build/unsigned)
-file(ARCHIVE_CREATE
-  OUTPUT build/unsigned/${CPACK_PACKAGE_FILE_NAME}.build.zip
-  PATHS ${paths} ${paths_recurse}
-  FORMAT zip
-  )
diff --git a/.gitlab/ci/post_build_fedora41_tidy.sh b/.gitlab/ci/post_build_fedora42_tidy.sh
similarity index 100%
rename from .gitlab/ci/post_build_fedora41_tidy.sh
rename to .gitlab/ci/post_build_fedora42_tidy.sh
diff --git a/.gitlab/ci/post_build_windows_arm64_package.ps1 b/.gitlab/ci/post_build_windows_arm64_package.ps1
deleted file mode 100644
index f98d995..0000000
--- a/.gitlab/ci/post_build_windows_arm64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/package_windows.ps1
diff --git a/.gitlab/ci/post_build_windows_i386_package.ps1 b/.gitlab/ci/post_build_windows_i386_package.ps1
deleted file mode 100644
index f98d995..0000000
--- a/.gitlab/ci/post_build_windows_i386_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/package_windows.ps1
diff --git a/.gitlab/ci/post_build_windows_x86_64_package.ps1 b/.gitlab/ci/post_build_windows_x86_64_package.ps1
deleted file mode 100644
index f98d995..0000000
--- a/.gitlab/ci/post_build_windows_x86_64_package.ps1
+++ /dev/null
@@ -1 +0,0 @@
-. .gitlab/ci/package_windows.ps1
diff --git a/.gitlab/ci/pre_build_fedora41_tidy.sh b/.gitlab/ci/pre_build_fedora42_tidy.sh
similarity index 100%
rename from .gitlab/ci/pre_build_fedora41_tidy.sh
rename to .gitlab/ci/pre_build_fedora42_tidy.sh
diff --git a/.gitlab/ci/repackage/intel.ps1 b/.gitlab/ci/repackage/intel.ps1
new file mode 100644
index 0000000..60d1b70
--- /dev/null
+++ b/.gitlab/ci/repackage/intel.ps1
@@ -0,0 +1,153 @@
+# Intel Compilers for Windows are available only via installers.
+# Run an installer and repackage the installation directory.
+
+# From the Intel oneAPI download page, download offline
+# installers for the Base and HPC products, as documented
+# by their "Install through a Command Line" sections.
+
+#Requires -RunAsAdministrator
+
+param (
+  [Parameter(Mandatory=$true)]
+  [string]$installer,
+  [string]$revision = "1",
+  [string]$basedir = "c:\intel"
+  )
+
+$erroractionpreference = "stop"
+
+Add-Type -AssemblyName System.IO.Compression.FileSystem
+
+$base_installer_file = Get-Item -Path $installer
+$base_installer_name = $base_installer_file.Name
+if ($base_installer_name -match '^intel-oneapi-base-toolkit-(?<version>(?<version2>[0-9][0-9][0-9][0-9]\.[0-9])\.[0-9])\.') {
+  $version2 = $Matches.version2
+  $version = $Matches.version
+} else {
+  Write-Host "Base installer file does not match expected pattern."
+  Exit 1
+}
+
+$hpc_installer_file = Get-Item -Path (Join-Path $base_installer_file.Directory "intel-oneapi-hpc-toolkit-$version.*")
+if (-not $hpc_installer_file) {
+  Write-Host "HPC installer file not found next to base installer."
+  Exit 1
+}
+$hpc_installer_name = $hpc_installer_file.Name
+Write-Host "Version: '$version'"
+Write-Host "Base Installer: '$base_installer_file'"
+Write-Host "HPC Installer: '$hpc_installer_file'"
+
+$package_name = "intel-oneapi-$version-windows-$revision"
+$package_dir = New-Item -Force -ItemType Directory -Path "$basedir\$package_name"
+if (-not $package_dir) {
+  Write-Host "Failed to create package install dir."
+  Exit 1
+}
+$compiler_exclude = @(
+  ".toolkit_linking_tool"
+  "bin\*.o"
+  "bin\*.rtl"
+  "bin\*.spv"
+  "bin\1033"
+  "bin\OpenCL.dll"
+  "bin\aocl-ioc64.exe"
+  "bin\cl.cfg"
+  "bin\common_clang64.dll"
+  "bin\compiler\append-file.exe"
+  "bin\compiler\clang++.exe"
+  "bin\compiler\clang-cl.exe"
+  "bin\compiler\clang-cpp.exe"
+  "bin\compiler\clang-format.exe"
+  "bin\compiler\clang-include-fixer.exe"
+  "bin\compiler\clang-linker-wrapper.exe"
+  "bin\compiler\clang-offload-*.exe"
+  "bin\compiler\clang-tidy.exe"
+  "bin\compiler\clangd.exe"
+  "bin\compiler\file-table-tform.exe"
+  "bin\compiler\ld.lld.exe"
+  "bin\compiler\lld-link.exe"
+  "bin\compiler\llvm-cov.exe"
+  "bin\compiler\llvm-lib.exe"
+  "bin\compiler\llvm-profdata.exe"
+  "bin\compiler\llvm-profgen.exe"
+  "bin\compiler\llvm-spirv.exe"
+  "bin\compiler\llvm-symbolizer.exe"
+  "bin\compiler\modularize.exe"
+  "bin\compiler\spirv-to-ir-wrapper.exe"
+  "bin\compiler\sycl-post-link.exe"
+  "bin\compiler\yaml2obj.exe"
+  "bin\deftofd.exe"
+  "bin\dpcpp-cl.exe"
+  "bin\dpcpp.exe"
+  "bin\icpx.exe"
+  "bin\icx-cc.exe"
+  "bin\icx-cl.exe"
+  "bin\intelocl64.*"
+  "bin\ioc64.exe"
+  "bin\libhwloc-15.dll"
+  "bin\libintelocl.so-gdb.py"
+  "bin\libiomp5md.pdb"
+  "bin\libocl_*.dll"
+  "bin\opencl-aot.exe"
+  "bin\pstloffload*.dll"
+  "bin\run-clang-tidy"
+  "bin\svml_dispmd.dll"
+  "bin\sycl*"
+  "bin\tcm*"
+  "bin\ur_*.dll"
+  "share"
+  )
+
+Write-Host "Installing to: $package_dir"
+$install_args = "-s -r yes -a --silent --eula accept"
+$install_args = $install_args + " --instance repackage"
+$install_args = $install_args + " -p=NEED_VS2019_INTEGRATION=0"
+$install_args = $install_args + " -p=NEED_VS2022_INTEGRATION=0"
+Start-Process -Wait -FilePath "$base_installer_file" `
+  -ArgumentList "$install_args --install-dir $package_dir --components intel.oneapi.win.cpp-dpcpp-common"
+Write-Host ""
+Start-Process -Wait -FilePath "$hpc_installer_file" `
+  -ArgumentList "$install_args --components intel.oneapi.win.ifort-compiler"
+Write-Host ""
+Get-Item -Path "$package_dir\*" -Exclude compiler,setvars.bat,setvars-vcvarsall.bat | ForEach-Object {
+  Remove-Item "$_" -Recurse -Force
+}
+Remove-Item "$package_dir/compiler/latest" -Recurse -Force
+foreach ($p in $compiler_exclude) {
+  Remove-Item "$package_dir/compiler/$version2/$p" -Recurse -Force
+}
+
+@"
+This was repackaged from an installation by:
+
+* $base_installer_name
+* $hpc_installer_name
+
+using CMake's ".gitlab/ci/repackage/intel.ps1" script.
+
+Duplicate files were removed from this distribution.
+Restore them using hard links:
+
+* compiler/$version2/bin/compiler/clang++.exe    -> clang.exe
+* compiler/$version2/bin/compiler/clang-cl.exe   -> clang.exe
+* compiler/$version2/bin/compiler/clang-cpp.exe  -> clang.exe
+* compiler/$version2/bin/compiler/ld.lld.exe     -> lld.exe
+* compiler/$version2/bin/compiler/lld-link.exe   -> lld.exe
+* compiler/$version2/bin/compiler/llvm-lib.exe   -> llvm-ar.exe
+* compiler/$version2/bin/icpx.exe                -> icx.exe
+* compiler/$version2/bin/icx-cc.exe              -> icx.exe
+* compiler/$version2/bin/icx-cl.exe              -> icx.exe
+
+Also add a directory junction:
+
+* compiler/latest -> $version2
+
+Then use "setvars.bat" to establish an environment.
+
+"@ | Add-Content -NoNewline "$package_dir/README.txt"
+
+Write-Host "Repackaging to: $package_name.zip"
+$compressionLevel = [System.IO.Compression.CompressionLevel]::Optimal
+$includeBaseDirectory = $true
+[System.IO.Compression.ZipFile]::CreateFromDirectory("$package_dir", "$package_name.zip", $compressionLevel, $includeBaseDirectory)
diff --git a/.gitlab/ci/signtool-env.ps1 b/.gitlab/ci/signtool-env.ps1
new file mode 100644
index 0000000..5467b98
--- /dev/null
+++ b/.gitlab/ci/signtool-env.ps1
@@ -0,0 +1,22 @@
+if ("$env:PROCESSOR_ARCHITECTURE" -eq "AMD64") {
+    $arch = "x64"
+} elseif ("$env:PROCESSOR_ARCHITECTURE" -eq "ARM64") {
+    $arch = "arm64"
+} else {
+    throw ('unknown PROCESSOR_ARCHITECTURE: ' + "$env:PROCESSOR_ARCHITECTURE")
+}
+
+$regKey = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0'
+$signtoolPath = $null
+if ($sdkDir = Get-ItemPropertyValue -Path $regKey -Name "InstallationFolder") {
+  if ($sdkBin = Get-ChildItem -Path "$sdkDir/bin" -Recurse -Name "$arch" |
+                  Where-Object { Test-Path -Path "$sdkDir/bin/$_/signtool.exe" -PathType Leaf } |
+                  Select-Object -Last 1) {
+    $signtoolPath = "$sdkDir/bin/$sdkBin"
+  }
+}
+if ($signtoolPath) {
+  Set-Item -Force -Path "env:PATH" -Value "$env:PATH;$signtoolPath"
+} else {
+  throw ('No signtool.exe found in Windows SDK')
+}
diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml
index 9a4a0b9..47f0d5f 100644
--- a/.gitlab/os-linux.yml
+++ b/.gitlab/os-linux.yml
@@ -5,7 +5,7 @@
 ### Release
 
 .linux_prep_source:
-    image: "fedora:41"
+    image: "fedora:42"
 
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -59,7 +59,7 @@
 ### Debian
 
 .debian12:
-    image: "kitware/cmake:ci-debian12-x86_64-2025-01-23"
+    image: "kitware/cmake:ci-debian12-x86_64-2025-03-31"
 
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -74,7 +74,7 @@
         CMAKE_CI_NO_INSTALL: 1
 
 .debian12_aarch64:
-    image: "kitware/cmake:ci-debian12-aarch64-2023-07-27"
+    image: "kitware/cmake:ci-debian12-aarch64-2025-03-31"
 
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci"
@@ -82,15 +82,15 @@
 
 ### Fedora
 
-.fedora41:
-    image: "kitware/cmake:ci-fedora41-x86_64-2025-02-03"
+.fedora42:
+    image: "kitware/cmake:ci-fedora42-x86_64-2025-04-22"
 
     variables:
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci/long file name for testing purposes"
         CMAKE_ARCH: x86_64
 
-.fedora41_hip:
-    image: "kitware/cmake:ci-fedora41-hip-x86_64-2025-02-03"
+.fedora42_hip:
+    image: "kitware/cmake:ci-fedora42-hip-x86_64-2025-04-22"
 
     variables:
         # FIXME(rocclr): device modules fail loading from binaries in paths with spaces
@@ -99,36 +99,36 @@
 
 #### Lint builds
 
-.fedora41_tidy:
-    extends: .fedora41
+.fedora42_tidy:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_tidy
+        CMAKE_CONFIGURATION: fedora42_tidy
         CMAKE_CI_NO_INSTALL: 1
 
-.fedora41_clang_analyzer:
-    extends: .fedora41
+.fedora42_clang_analyzer:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_clang_analyzer
+        CMAKE_CONFIGURATION: fedora42_clang_analyzer
         CMAKE_CI_BUILD_TYPE: Debug
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_CI_NO_INSTALL: 1
 
-.fedora41_sphinx:
-    extends: .fedora41
+.fedora42_sphinx:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_sphinx
+        CMAKE_CONFIGURATION: fedora42_sphinx
         CTEST_NO_WARNINGS_ALLOWED: 1
         CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
         CMAKE_CI_NO_INSTALL: 1
 
-.fedora41_sphinx_package:
-    extends: .fedora41
+.fedora42_sphinx_package:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_sphinx_package
+        CMAKE_CONFIGURATION: fedora42_sphinx_package
         CTEST_SOURCE_SUBDIRECTORY: "Utilities/Sphinx"
 
 #### Build and test
@@ -184,43 +184,43 @@
         CMAKE_CI_BUILD_TYPE: Release
         CTEST_NO_WARNINGS_ALLOWED: 1
 
-.fedora41_extdeps:
-    extends: .fedora41
+.fedora42_extdeps:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_extdeps
+        CMAKE_CONFIGURATION: fedora42_extdeps
         CMAKE_CI_BUILD_TYPE: Release
         CTEST_NO_WARNINGS_ALLOWED: 1
 
-.fedora41_ninja:
-    extends: .fedora41
+.fedora42_ninja:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_ninja
+        CMAKE_CONFIGURATION: fedora42_ninja
         CMAKE_CI_BUILD_TYPE: Release
         CTEST_NO_WARNINGS_ALLOWED: 1
 
-.fedora41_ninja_multi:
-    extends: .fedora41
+.fedora42_ninja_multi:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_ninja_multi
+        CMAKE_CONFIGURATION: fedora42_ninja_multi
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_GENERATOR: "Ninja Multi-Config"
 
-.fedora41_makefiles:
-    extends: .fedora41
+.fedora42_makefiles:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_makefiles
+        CMAKE_CONFIGURATION: fedora42_makefiles
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_GENERATOR: "Unix Makefiles"
 
-.fedora41_makefiles_symlinked:
-    extends: .fedora41
+.fedora42_makefiles_symlinked:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_makefiles_symlinked
+        CMAKE_CONFIGURATION: fedora42_makefiles_symlinked
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_GENERATOR: "Unix Makefiles"
         CMAKE_CI_IN_SYMLINK_TREE: 1
@@ -241,43 +241,43 @@
     variables:
         CMAKE_CONFIGURATION: debian12_ninja_clang
 
-.fedora41_makefiles_clang:
-    extends: .fedora41
+.fedora42_makefiles_clang:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_makefiles_clang
+        CMAKE_CONFIGURATION: fedora42_makefiles_clang
         CMAKE_GENERATOR: "Unix Makefiles"
 
-.fedora41_makefiles_lfortran:
-    extends: .fedora41
+.fedora42_makefiles_lfortran:
+    extends: .fedora42
 
     variables:
         # FIXME(lfortran): -rpath flags with spaces not forwarded
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci"
-        CMAKE_CONFIGURATION: fedora41_makefiles_lfortran
+        CMAKE_CONFIGURATION: fedora42_makefiles_lfortran
         CMAKE_GENERATOR: "Unix Makefiles"
         CTEST_LABELS: "Fortran"
 
-.fedora41_ninja_lfortran:
-    extends: .fedora41
+.fedora42_ninja_lfortran:
+    extends: .fedora42
 
     variables:
         # FIXME(lfortran): -rpath flags with spaces not forwarded
         GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci"
-        CMAKE_CONFIGURATION: fedora41_ninja_lfortran
+        CMAKE_CONFIGURATION: fedora42_ninja_lfortran
         CTEST_LABELS: "Fortran"
 
-.fedora41_ninja_clang:
-    extends: .fedora41
+.fedora42_ninja_clang:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_ninja_clang
+        CMAKE_CONFIGURATION: fedora42_ninja_clang
 
-.fedora41_ninja_multi_clang:
-    extends: .fedora41
+.fedora42_ninja_multi_clang:
+    extends: .fedora42
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_ninja_multi_clang
+        CMAKE_CONFIGURATION: fedora42_ninja_multi_clang
         CMAKE_GENERATOR: "Ninja Multi-Config"
 
 ### Sanitizers
@@ -293,13 +293,13 @@
         CTEST_MEMORYCHECK_TYPE: AddressSanitizer
         CTEST_MEMORYCHECK_SANITIZER_OPTIONS: ""
 
-.fedora41_asan:
+.fedora42_asan:
     extends:
-        - .fedora41
+        - .fedora42
         - .fedora_asan_addon
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_asan
+        CMAKE_CONFIGURATION: fedora42_asan
 
 ### Intel Compiler
 
@@ -477,11 +477,11 @@
         CMAKE_CONFIGURATION: debian12_hip_radeon
         CTEST_LABELS: "HIP"
 
-.fedora41_hip_radeon:
-    extends: .fedora41_hip
+.fedora42_hip_radeon:
+    extends: .fedora42_hip
 
     variables:
-        CMAKE_CONFIGURATION: fedora41_hip_radeon
+        CMAKE_CONFIGURATION: fedora42_hip_radeon
         CTEST_LABELS: "HIP"
 
 .hip6.3_nvidia:
@@ -575,10 +575,27 @@
         - docker
         - linux-x86_64-v3
 
-.linux_x86_64_tags_radeon:
+.linux_x86_64_tags_rocm5.2:
     tags:
         - cmake
         - radeon
+        - rocm-5.2
+        - docker
+        - linux-x86_64
+
+.linux_x86_64_tags_rocm6.2:
+    tags:
+        - cmake
+        - radeon
+        - rocm-6.2
+        - docker
+        - linux-x86_64
+
+.linux_x86_64_tags_rocm6.3:
+    tags:
+        - cmake
+        - radeon
+        - rocm-6.3
         - docker
         - linux-x86_64
 
@@ -621,14 +638,14 @@
 
 .cmake_version_update_linux:
     stage: build
-    extends: .fedora41
+    extends: .fedora42
     script:
         - .gitlab/ci/cmake_version_update.sh
     interruptible: false # The job internally fetches and retries.
 
 .cmake_spellcheck_linux:
     stage: build
-    extends: .fedora41
+    extends: .fedora42
     script:
         - .gitlab/ci/codespell.bash
         - .gitlab/ci/typos.bash
@@ -799,7 +816,7 @@
 .cmake_org_help:
     stage: build
     extends:
-        - .fedora41
+        - .fedora42
         - .linux_x86_64_tags
         - .cmake_org_help_artifacts
     script:
diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml
index afb5c51..34a4433 100644
--- a/.gitlab/os-windows.yml
+++ b/.gitlab/os-windows.yml
@@ -244,7 +244,7 @@
 .windows_inteloneapi_ninja:
     extends:
         - .windows_ninja
-        - .windows_vcvarsall_vs2022_x64_msvc14.43
+        - .windows_vcvarsall_vs2022_x64
 
     variables:
         CMAKE_CONFIGURATION: windows_inteloneapi_ninja
@@ -314,6 +314,14 @@
 
 ## Tags
 
+.windows_x86_64_tags_nonconcurrent_sign:
+    tags:
+        - cmake # Since this is a bare runner, pin to a project.
+        - windows-x86_64
+        - shell
+        - sign-windows-v1
+        - nonconcurrent
+
 .windows_x86_64_tags_nonconcurrent_vs2022:
     tags:
         - cmake # Since this is a bare runner, pin to a project.
@@ -426,6 +434,18 @@
 
     interruptible: true
 
+.cmake_package_windows:
+    stage: package
+    environment:
+        name: sign-windows
+    script:
+        - . .gitlab/ci/env.ps1
+        - . .gitlab/ci/signtool-env.ps1
+        - . .gitlab/ci/cmake-env.ps1
+        - . .gitlab/ci/wix4-env.ps1
+        - . .gitlab/ci/package_windows.ps1
+    interruptible: true
+
 .cmake_test_windows:
     stage: test
 
diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml
index c7102f9..efb7290 100644
--- a/.gitlab/rules.yml
+++ b/.gitlab/rules.yml
@@ -70,7 +70,9 @@
 
 .run_only_for_package:
     rules:
-        - if: '$CMAKE_CI_PACKAGE == "dev"'
+        - if: '$CMAKE_CI_PACKAGE == "dev" && $CI_JOB_STAGE != "upload"'
+          when: on_success
+        - if: '$CMAKE_CI_PACKAGE == "dev" && $CI_JOB_STAGE == "upload"'
           variables:
               RSYNC_DESTINATION: "kitware@cmake.org:dev/"
           when: on_success
diff --git a/.gitlab/upload.yml b/.gitlab/upload.yml
index ac177a9..c489c54 100644
--- a/.gitlab/upload.yml
+++ b/.gitlab/upload.yml
@@ -1,7 +1,7 @@
 # Steps for uploading artifacts
 
 .rsync_upload_package:
-    image: "fedora:41"
+    image: "fedora:42"
     stage: upload
     tags:
         - cmake
@@ -21,7 +21,7 @@
 
 .rsync_upload_help:
     stage: upload
-    image: "fedora:41"
+    image: "fedora:42"
     tags:
         - cmake
         - docker
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index fccc0be..8b6d940 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -108,7 +108,7 @@
         stages: [commit-msg, pre-commit]
 
   - repo: https://github.com/crate-ci/typos
-    rev: v1.29.4
+    rev: v1.30.0
     hooks:
       - id: typos
         # NOTE Override hook's default args to prevent automatic
diff --git a/.typos.toml b/.typos.toml
index 70608b8..5ad2245 100644
--- a/.typos.toml
+++ b/.typos.toml
@@ -9,6 +9,9 @@
     "(?s)(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)off.*?\\n\\s*(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)on"
     # NOTE Allow to mark a line to exclude from spellchecking
   , "(?Rm)^.*(#|/(/|\\*)|\\.\\.)\\s*(NOQA|noqa):? spellcheck(: *|=| +)disable-line$"
+    # NOTE Stop checking from this line to the end of file
+    # This line is a marker added by Git to the `COMMIT_EDITMSG`.
+  , "(?sm)^# ------------------------ >8 ------------------------$.*"
   ]
 locale = "en-us"
 # ATTENTION If, for any reason, you want to add the
@@ -35,6 +38,7 @@
 [type.cmake.extend-identifiers]
 COMMANDs = "COMMANDs"
 xCOMMANDx = "xCOMMANDx"
+TYPEs = "TYPEs"
 
 [type.cmake.extend-words]
 # Some compiler's options trigger false-positives
@@ -53,6 +57,9 @@
 Ot = "Ot"
 SEH = "SEH"
 
+[type.py.extend-identifiers]
+typ = "typ"
+
 [files]
 ignore-hidden = false
 ignore-dot = false
diff --git a/Auxiliary/cmake.m4 b/Auxiliary/cmake.m4
index 205b0e4..19ead8f 100644
--- a/Auxiliary/cmake.m4
+++ b/Auxiliary/cmake.m4
@@ -1,6 +1,10 @@
 dnl Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 dnl file LICENSE.rst or https://cmake.org/licensing for details.
 
+# CMAKE_FIND_BINARY
+# -----------------
+# Finds the cmake command-line binary and sets its absolute path in the
+# CMAKE_BINARY variable.
 AC_DEFUN([CMAKE_FIND_BINARY],
 [AC_ARG_VAR([CMAKE_BINARY], [path to the cmake binary])dnl
 
@@ -9,13 +13,33 @@
 fi
 ])dnl
 
-# $1: package name
-# $2: language (e.g. C/CXX/Fortran)
-# $3: The compiler ID, defaults to GNU.
-#     Possible values are: GNU, Intel, Clang, SunPro, HP, XL, VisualAge, PGI,
-#     PathScale, Cray, SCO, MSVC, LCC
-# $4: optional extra arguments to cmake, e.g. "-DCMAKE_SIZEOF_VOID_P=8"
-# $5: optional path to cmake binary
+# CMAKE_FIND_PACKAGE(package, lang, [compiler-id], [cmake-args],
+#   [action-if-found], [action-if-not-found])
+# --------------------------------------------------------------
+# Finds a package with CMake.
+#
+# package:
+#   The name of the package as called in CMake with find_package(package).
+#
+# lang:
+#   The programming language to use (e.g., C, CXX, Fortran).
+#   See https://cmake.org/cmake/help/latest/command/enable_language.html
+#   for a complete list of supported languages.
+#
+# compiler-id:
+#   (Optional) The compiler ID to use. Defaults to GNU.
+#   See https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html
+#   for possible values.
+#
+# cmake-args:
+#   (Optional) Additional arguments to pass to cmake command, e.g.,
+#   -DCMAKE_SIZEOF_VOID_P=8.
+#
+# action-if-found:
+#   (Optional) Commands to execute if the package is found.
+#
+# action-if-not-found:
+#   (Optional) Commands to execute if the package is not found.
 AC_DEFUN([CMAKE_FIND_PACKAGE], [
 AC_REQUIRE([CMAKE_FIND_BINARY])dnl
 
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 97668d3..3ac6030 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -32,7 +32,7 @@
 #  - Root install directory (displayed to end user at installer-run time)
 #  - "NSIS package/display name" (text used in the installer GUI)
 #  - Registry key used to store info about the installation
-if(CMAKE_CL_64)
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
   set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
   set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
 else()
@@ -44,18 +44,10 @@
 if(NOT DEFINED CPACK_SYSTEM_NAME)
   # make sure package is not Cygwin-unknown, for Cygwin just
   # cygwin is good for the system name
-  if("x${CMAKE_SYSTEM_NAME}" STREQUAL "xCYGWIN")
-    set(CPACK_SYSTEM_NAME Cygwin)
+  if(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
+    set(CPACK_SYSTEM_NAME cygwin)
   else()
-    set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
-  endif()
-endif()
-if(${CPACK_SYSTEM_NAME} MATCHES Windows)
-  if(CMAKE_CL_64)
-    set(CPACK_SYSTEM_NAME win64-x64)
-    set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
-  else()
-    set(CPACK_SYSTEM_NAME win32-x86)
+    string(TOLOWER "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" CPACK_SYSTEM_NAME)
   endif()
 endif()
 
@@ -170,7 +162,7 @@
 _cmifwarg("Package <Licenses> tag (pairs of <display_name> <file_path>)"
   STRING LICENSES "${${_cpifwrc}LICENSES_DEFAULT}")
 
-if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
   set(_CPACK_IFW_PACKAGE_ICON
       "set(CPACK_IFW_PACKAGE_ICON \"${CMake_SOURCE_DIR}/Source/QtDialog/CMakeSetup.ico\")")
   if(BUILD_QtDialog)
@@ -189,9 +181,11 @@
   )
 endif()
 
-if(${CMAKE_SYSTEM_NAME} MATCHES Linux)
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
   set(CPACK_IFW_TARGET_DIRECTORY "@HomeDir@/${CMAKE_PROJECT_NAME}")
   set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
+  set(CPACK_IFW_TARGET_DIRECTORY "@RootDir@/Program Files/${CMAKE_PROJECT_NAME}")
 endif()
 
 # Components scripts configuration
@@ -265,9 +259,5 @@
   "~$"
   )
 
-if(CMake_CPACK_CUSTOM_SCRIPT)
-  include(${CMake_CPACK_CUSTOM_SCRIPT})
-endif()
-
 # include CPack model once all variables are set
 include(CPack)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 907c344..ef6e301 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file LICENSE.rst or https://cmake.org/licensing for details.
 
-cmake_minimum_required(VERSION 3.13...3.30 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
 set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideC.cmake)
 set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/Source/Modules/OverrideCXX.cmake)
 
@@ -44,118 +44,7 @@
   endif()
 
   set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
-endif()
 
-if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
-  if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL MATCHES "^3|2\\.1$")
-    set(USE_LGPL "${CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL}")
-  else()
-    set(USE_LGPL "2.1")
-  endif()
-else()
-  set(USE_LGPL "")
-endif()
-
-# Use most-recent available language dialects with GNU and Clang
-if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
-  include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake)
-  if(NOT CMake_C11_THREAD_LOCAL_BROKEN)
-    set(CMAKE_C_STANDARD 11)
-  else()
-    set(CMAKE_C_STANDARD 99)
-  endif()
-endif()
-if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
-  if(CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
-    set(CMAKE_CXX_STANDARD 98)
-  else()
-    include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx17_check.cmake)
-    if(NOT CMake_CXX17_BROKEN)
-      set(CMAKE_CXX_STANDARD 17)
-    else()
-      include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx14_check.cmake)
-      if(NOT CMake_CXX14_BROKEN)
-        set(CMAKE_CXX_STANDARD 14)
-      else()
-        set(CMAKE_CXX_STANDARD 11)
-      endif()
-    endif()
-  endif()
-endif()
-if(NOT CMake_TEST_EXTERNAL_CMAKE)
-  # include special compile flags for some compilers
-  include(CompileFlags.cmake)
-
-  # check for available C++ features
-  include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
-
-  if(NOT CMake_HAVE_CXX_UNIQUE_PTR)
-    message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).")
-  endif()
-endif()
-
-# Inform STL library header wrappers whether to use system versions.
-configure_file(Utilities/std/cmSTL.hxx.in Utilities/cmSTL.hxx @ONLY)
-
-# set the internal encoding of CMake to UTF-8
-set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
-
-# option to use COMPONENT with install command
-option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF)
-mark_as_advanced(CMake_INSTALL_COMPONENTS)
-macro(CMake_OPTIONAL_COMPONENT NAME)
-  if(CMake_INSTALL_COMPONENTS)
-    set(COMPONENT COMPONENT ${NAME})
-  else()
-    set(COMPONENT)
-  endif()
-endmacro()
-
-# option to disable installing 3rd-party dependencies
-option(CMake_INSTALL_DEPENDENCIES
-  "Whether to install 3rd-party runtime dependencies" OFF)
-mark_as_advanced(CMake_INSTALL_DEPENDENCIES)
-
-# option to build reference for CMake developers
-option(CMake_BUILD_DEVELOPER_REFERENCE
-  "Build CMake Developer Reference" OFF)
-mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
-
-# option to build using interprocedural optimizations (IPO/LTO)
-option(CMake_BUILD_LTO "Compile CMake with link-time optimization if supported" OFF)
-if(CMake_BUILD_LTO)
-  include(CheckIPOSupported)
-  check_ipo_supported(RESULT HAVE_IPO)
-  if(HAVE_IPO)
-    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
-  endif()
-endif()
-
-option(CMake_BUILD_PCH "Compile CMake with precompiled headers" OFF)
-
-# Check whether to build support for the debugger mode.
-if(NOT CMake_TEST_EXTERNAL_CMAKE)
-  if(NOT DEFINED CMake_ENABLE_DEBUGGER)
-    # The debugger uses cppdap, which does not compile everywhere.
-    if(CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin|Linux|BSD|DragonFly|CYGWIN|MSYS"
-        AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.16)
-        AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "XLClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.1)
-        AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "LCC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1.23)
-        )
-      set(CMake_ENABLE_DEBUGGER 1)
-    else()
-      set(CMake_ENABLE_DEBUGGER 0)
-    endif()
-  endif()
-else()
-  set(CMake_ENABLE_DEBUGGER 0)
-endif()
-
-#-----------------------------------------------------------------------
-# a macro to deal with system libraries, implemented as a macro
-# simply to improve readability of the main script
-#-----------------------------------------------------------------------
-macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
   include(CMakeDependentOption)
 
   # Allow the user to enable/disable all system utility library options by
@@ -230,9 +119,116 @@
 
   # Inform utility library header wrappers whether to use system versions.
   configure_file(Utilities/cmThirdParty.h.in Utilities/cmThirdParty.h @ONLY)
+endif()
 
+if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL)
+  if(CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL MATCHES "^3|2\\.1$")
+    set(USE_LGPL "${CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL}")
+  else()
+    set(USE_LGPL "2.1")
+  endif()
+else()
+  set(USE_LGPL "")
+endif()
+
+# Use most-recent available language dialects with GNU and Clang
+if(NOT DEFINED CMAKE_C_STANDARD AND NOT CMake_NO_C_STANDARD)
+  include(${CMake_SOURCE_DIR}/Source/Checks/cm_c11_thread_local.cmake)
+  if(NOT CMake_C11_THREAD_LOCAL_BROKEN)
+    set(CMAKE_C_STANDARD 11)
+  else()
+    set(CMAKE_C_STANDARD 99)
+  endif()
+endif()
+if(NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMake_NO_CXX_STANDARD)
+  if(CMAKE_CXX_COMPILER_ID STREQUAL SunPro AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.14)
+    set(CMAKE_CXX_STANDARD 98)
+  else()
+    include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx17_check.cmake)
+    if(NOT CMake_CXX17_BROKEN)
+      set(CMAKE_CXX_STANDARD 17)
+    else()
+      include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx14_check.cmake)
+      if(NOT CMake_CXX14_BROKEN)
+        set(CMAKE_CXX_STANDARD 14)
+      else()
+        set(CMAKE_CXX_STANDARD 11)
+      endif()
+    endif()
+  endif()
+endif()
+if(NOT CMake_TEST_EXTERNAL_CMAKE)
+  # include special compile flags for some compilers
+  include(CompileFlags.cmake)
+
+  # check for available C++ features
+  include(${CMake_SOURCE_DIR}/Source/Checks/cm_cxx_features.cmake)
+
+  if(NOT CMake_HAVE_CXX_UNIQUE_PTR)
+    message(FATAL_ERROR "The C++ compiler does not support C++11 (e.g. std::unique_ptr).")
+  endif()
+endif()
+
+# Inform STL library header wrappers whether to use system versions.
+configure_file(Utilities/std/cmSTL.hxx.in Utilities/cmSTL.hxx @ONLY)
+
+# set the internal encoding of CMake to UTF-8
+set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
+
+# enable parallel install
+set_property(GLOBAL PROPERTY INSTALL_PARALLEL ON)
+
+# option to use COMPONENT with install command
+option(CMake_INSTALL_COMPONENTS "Using components when installing" OFF)
+mark_as_advanced(CMake_INSTALL_COMPONENTS)
+macro(CMake_OPTIONAL_COMPONENT NAME)
+  if(CMake_INSTALL_COMPONENTS)
+    set(COMPONENT COMPONENT ${NAME})
+  else()
+    set(COMPONENT)
+  endif()
 endmacro()
 
+# option to disable installing 3rd-party dependencies
+option(CMake_INSTALL_DEPENDENCIES
+  "Whether to install 3rd-party runtime dependencies" OFF)
+mark_as_advanced(CMake_INSTALL_DEPENDENCIES)
+
+# option to build reference for CMake developers
+option(CMake_BUILD_DEVELOPER_REFERENCE
+  "Build CMake Developer Reference" OFF)
+mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
+
+# option to build using interprocedural optimizations (IPO/LTO)
+option(CMake_BUILD_LTO "Compile CMake with link-time optimization if supported" OFF)
+if(CMake_BUILD_LTO)
+  include(CheckIPOSupported)
+  check_ipo_supported(RESULT HAVE_IPO)
+  if(HAVE_IPO)
+    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+  endif()
+endif()
+
+option(CMake_BUILD_PCH "Compile CMake with precompiled headers" OFF)
+
+# Check whether to build support for the debugger mode.
+if(NOT CMake_TEST_EXTERNAL_CMAKE)
+  if(NOT DEFINED CMake_ENABLE_DEBUGGER)
+    # The debugger uses cppdap, which does not compile everywhere.
+    if(CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin|Linux|BSD|DragonFly|CYGWIN|MSYS"
+        AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.16)
+        AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "XLClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.1)
+        AND NOT (CMAKE_CXX_COMPILER_ID STREQUAL "LCC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 1.23)
+        )
+      set(CMake_ENABLE_DEBUGGER 1)
+    else()
+      set(CMake_ENABLE_DEBUGGER 0)
+    endif()
+  endif()
+else()
+  set(CMake_ENABLE_DEBUGGER 0)
+endif()
+
 #-----------------------------------------------------------------------
 # a macro to determine the generator and ctest executable to use
 # for testing. Simply to improve readability of the main script.
@@ -392,8 +388,8 @@
 include(CTest)
 
 # Set up test-time configuration.
-set_directory_properties(PROPERTIES
-  TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
+set_property(DIRECTORY APPEND PROPERTY
+  TEST_INCLUDE_FILES "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
 
 if(NOT CMake_TEST_EXTERNAL_CMAKE)
   # where to write the resulting executables and libraries
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 14f944b..62e5233 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -45,31 +45,37 @@
 
 # Silence duplicate symbol warnings on AIX
 if(CMAKE_SYSTEM_NAME MATCHES "AIX")
-  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+  if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
   endif()
 endif()
 
 if(CMAKE_SYSTEM MATCHES "OSF1-V")
-  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+  if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
   endif()
 endif()
 
 # Workaround for short jump tables on PA-RISC
 if(CMAKE_SYSTEM_PROCESSOR MATCHES "^parisc")
-  if(CMAKE_COMPILER_IS_GNUCC)
+  if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-calls")
   endif()
-  if(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-calls")
   endif()
 endif()
 
 # Use 64-bit off_t on 32-bit Linux
 if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
-  # ensure 64bit offsets are used for filesystem accesses for 32bit compilation
+  # Use 64-bit off_t even in 32-bit builds.
   add_compile_definitions(_FILE_OFFSET_BITS=64)
+
+  # Use 64-bit time_t even in 32-bit builds.  Skip this with
+  # system libarchive because its ABI uses the default time_t.
+  if (NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
+    add_compile_definitions(_TIME_BITS=64)
+  endif()
 endif()
 
 # Workaround for TOC Overflow on ppc64
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
deleted file mode 100644
index ab96bd3..0000000
--- a/Help/command/FIND_XXX.txt
+++ /dev/null
@@ -1,253 +0,0 @@
-A short-hand signature is:
-
-.. parsed-literal::
-
-   |FIND_XXX| (<VAR> name1 [path1 path2 ...])
-
-The general signature is:
-
-.. parsed-literal::
-
-   |FIND_XXX| (
-             <VAR>
-             name | |NAMES|
-             [HINTS [path | ENV var]...]
-             [PATHS [path | ENV var]...]
-             [REGISTRY_VIEW (64|32|64_32|32_64|HOST|TARGET|BOTH)]
-             [PATH_SUFFIXES suffix1 [suffix2 ...]]
-             [VALIDATOR function]
-             [DOC "cache documentation string"]
-             [NO_CACHE]
-             [REQUIRED]
-             [NO_DEFAULT_PATH]
-             [NO_PACKAGE_ROOT_PATH]
-             [NO_CMAKE_PATH]
-             [NO_CMAKE_ENVIRONMENT_PATH]
-             [NO_SYSTEM_ENVIRONMENT_PATH]
-             [NO_CMAKE_SYSTEM_PATH]
-             [NO_CMAKE_INSTALL_PREFIX]
-             [CMAKE_FIND_ROOT_PATH_BOTH |
-              ONLY_CMAKE_FIND_ROOT_PATH |
-              NO_CMAKE_FIND_ROOT_PATH]
-            )
-
-This command is used to find a |SEARCH_XXX_DESC|.
-A cache entry, or a normal variable if ``NO_CACHE`` is specified,
-named by ``<VAR>`` is created to store the result of this command.
-If the |SEARCH_XXX| is found the result is stored in the variable
-and the search will not be repeated unless the variable is cleared.
-If nothing is found, the result will be ``<VAR>-NOTFOUND``.
-
-Options include:
-
-``NAMES``
-  Specify one or more possible names for the |SEARCH_XXX|.
-
-  When using this to specify names with and without a version
-  suffix, we recommend specifying the unversioned name first
-  so that locally-built packages can be found before those
-  provided by distributions.
-
-``HINTS``, ``PATHS``
-  Specify directories to search in addition to the default locations.
-  The ``ENV var`` sub-option reads paths from a system environment
-  variable.
-
-  .. versionchanged:: 3.24
-    On ``Windows`` platform, it is possible to include registry queries as part
-    of the directories, using a :ref:`dedicated syntax <Find Using Windows Registry>`.
-    Such specifications will be ignored on all other platforms.
-
-``REGISTRY_VIEW``
-  .. versionadded:: 3.24
-
-  .. include:: FIND_XXX_REGISTRY_VIEW.txt
-
-``PATH_SUFFIXES``
-  Specify additional subdirectories to check below each directory
-  location otherwise considered.
-
-``VALIDATOR``
-  .. versionadded:: 3.25
-
-  Specify a :command:`function` to be called for each candidate item found
-  (a :command:`macro` cannot be provided, that will result in an error).
-  Two arguments will be passed to the validator function: the name of a
-  result variable, and the absolute path to the candidate item.  The item
-  will be accepted and the search will end unless the function sets the
-  value in the result variable to false in the calling scope.  The result
-  variable will hold a true value when the validator function is entered.
-
-  .. parsed-literal::
-
-     function(my_check validator_result_var item)
-       if(NOT item MATCHES ...)
-         set(${validator_result_var} FALSE PARENT_SCOPE)
-       endif()
-     endfunction()
-
-     |FIND_XXX| (result NAMES ... VALIDATOR my_check)
-
-  Note that if a cached result is used, the search is skipped and any
-  ``VALIDATOR`` is ignored.  The cached result is not required to pass the
-  validation function.
-
-``DOC``
-  Specify the documentation string for the ``<VAR>`` cache entry.
-
-``NO_CACHE``
-  .. versionadded:: 3.21
-
-  The result of the search will be stored in a normal variable rather than
-  a cache entry.
-
-  .. note::
-
-    If the variable is already set before the call (as a normal or cache
-    variable) then the search will not occur.
-
-  .. warning::
-
-    This option should be used with caution because it can greatly increase
-    the cost of repeated configure steps.
-
-``REQUIRED``
-  .. versionadded:: 3.18
-
-  Stop processing with an error message if nothing is found, otherwise
-  the search will be attempted again the next time |FIND_XXX| is invoked
-  with the same variable.
-
-If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
-added to the search.
-If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
-
-.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| replace::
-   |prefix_XXX_SUBDIR| for each ``<prefix>`` in the
-   :variable:`<PackageName>_ROOT` CMake variable and the
-   :envvar:`<PackageName>_ROOT` environment variable if
-   called from within a find module loaded by
-   :command:`find_package(<PackageName>)`
-
-.. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
-   |prefix_XXX_SUBDIR| for each ``<prefix>`` in :variable:`CMAKE_PREFIX_PATH`
-
-.. |ENV_CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
-   |prefix_XXX_SUBDIR| for each ``<prefix>`` in :envvar:`CMAKE_PREFIX_PATH`
-
-.. |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR| replace::
-   |prefix_XXX_SUBDIR| for each ``<prefix>/[s]bin`` in ``PATH``, and
-   |entry_XXX_SUBDIR| for other entries in ``PATH``
-
-.. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| replace::
-   |prefix_XXX_SUBDIR| for each ``<prefix>`` in
-   :variable:`CMAKE_SYSTEM_PREFIX_PATH`
-
-1. If called from within a find module or any other script loaded by a call to
-   :command:`find_package(<PackageName>)`, search prefixes unique to the
-   current package being found.  See policy :policy:`CMP0074`.
-
-   .. versionadded:: 3.12
-
-   Specifically, search paths specified by the following variables, in order:
-
-   a. :variable:`<PackageName>_ROOT` CMake variable,
-      where ``<PackageName>`` is the case-preserved package name.
-
-   b. :variable:`<PACKAGENAME>_ROOT` CMake variable,
-      where ``<PACKAGENAME>`` is the upper-cased package name.
-      See policy :policy:`CMP0144`.
-
-      .. versionadded:: 3.27
-
-   c. :envvar:`<PackageName>_ROOT` environment variable,
-      where ``<PackageName>`` is the case-preserved package name.
-
-   d. :envvar:`<PACKAGENAME>_ROOT` environment variable,
-      where ``<PACKAGENAME>`` is the upper-cased package name.
-      See policy :policy:`CMP0144`.
-
-      .. versionadded:: 3.27
-
-   The package root variables are maintained as a stack, so if called from
-   nested find modules or config packages, root paths from the parent's find
-   module or config package will be searched after paths from the current
-   module or package.  In other words, the search order would be
-   ``<CurrentPackage>_ROOT``, ``ENV{<CurrentPackage>_ROOT}``,
-   ``<ParentPackage>_ROOT``, ``ENV{<ParentPackage>_ROOT}``, etc.
-   This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
-   the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
-
-   * |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX|
-
-2. Search paths specified in cmake-specific cache variables.
-   These are intended to be used on the command line with a ``-DVAR=value``.
-   The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
-   This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
-   :variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``.
-
-   * |CMAKE_PREFIX_PATH_XXX|
-   * |CMAKE_XXX_PATH|
-   * |CMAKE_XXX_MAC_PATH|
-
-3. Search paths specified in cmake-specific environment variables.
-   These are intended to be set in the user's shell configuration,
-   and therefore use the host's native path separator
-   (``;`` on Windows and ``:`` on UNIX).
-   This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or
-   by setting the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``.
-
-   * |ENV_CMAKE_PREFIX_PATH_XXX|
-   * |ENV_CMAKE_XXX_PATH|
-   * |ENV_CMAKE_XXX_MAC_PATH|
-
-4. Search the paths specified by the ``HINTS`` option.
-   These should be paths computed by system introspection, such as a
-   hint provided by the location of another item already found.
-   Hard-coded guesses should be specified with the ``PATHS`` option.
-
-5. Search the standard system environment variables.
-   This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by
-   setting the :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``.
-
-   * |SYSTEM_ENVIRONMENT_PATH_XXX|
-
-   |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX|
-
-6. Search cmake variables defined in the Platform files
-   for the current system.  The searching of ``CMAKE_INSTALL_PREFIX`` and
-   ``CMAKE_STAGING_PREFIX`` can be
-   skipped if ``NO_CMAKE_INSTALL_PREFIX`` is passed or by setting the
-   :variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE``. All these locations
-   can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed or by setting the
-   :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` to ``FALSE``.
-
-   * |CMAKE_SYSTEM_PREFIX_PATH_XXX|
-   * |CMAKE_SYSTEM_XXX_PATH|
-   * |CMAKE_SYSTEM_XXX_MAC_PATH|
-
-   The platform paths that these variables contain are locations that
-   typically include installed software. An example being ``/usr/local`` for
-   UNIX based platforms.
-
-7. Search the paths specified by the PATHS option
-   or in the short-hand version of the command.
-   These are typically hard-coded guesses.
-
-The :variable:`CMAKE_IGNORE_PATH`, :variable:`CMAKE_IGNORE_PREFIX_PATH`,
-:variable:`CMAKE_SYSTEM_IGNORE_PATH` and
-:variable:`CMAKE_SYSTEM_IGNORE_PREFIX_PATH` variables can also cause some
-of the above locations to be ignored.
-
-.. versionadded:: 3.16
-  Added ``CMAKE_FIND_USE_<CATEGORY>_PATH`` variables to globally disable
-  various search locations.
-
-.. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
-
-On macOS the :variable:`CMAKE_FIND_FRAMEWORK` and
-:variable:`CMAKE_FIND_APPBUNDLE` variables determine the order of
-preference between Apple-style and unix-style package components.
-
-.. include:: FIND_XXX_ROOT.txt
-.. include:: FIND_XXX_ORDER.txt
diff --git a/Help/command/add_compile_definitions.rst b/Help/command/add_compile_definitions.rst
index b2eb2af..04cb4c2 100644
--- a/Help/command/add_compile_definitions.rst
+++ b/Help/command/add_compile_definitions.rst
@@ -25,7 +25,7 @@
   Any leading ``-D`` on an item will be removed.
 
 .. |command_name| replace:: ``add_compile_definitions``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
 See Also
 ^^^^^^^^
diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst
index 869d0c2..3f7ab6c 100644
--- a/Help/command/add_compile_options.rst
+++ b/Help/command/add_compile_options.rst
@@ -20,9 +20,9 @@
 ^^^^^^^^^
 
 .. |command_name| replace:: ``add_compile_options``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
-.. include:: OPTIONS_SHELL.txt
+.. include:: include/OPTIONS_SHELL.rst
 
 Example
 ^^^^^^^
@@ -41,7 +41,8 @@
   endif()
 
 To set per-language options, use the :genex:`$<COMPILE_LANGUAGE>`
-or :genex:`$<COMPILE_LANGUAGE:languages>` generator expressions.
+or :genex:`$<COMPILE_LANGUAGE:languages> <COMPILE_LANGUAGE:languages>`
+generator expressions.
 
 See Also
 ^^^^^^^^
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index dffefe5..31565b5 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -282,7 +282,7 @@
 ``MAIN_DEPENDENCY``
   Specify the primary input source file to the command.  This is
   treated just like any value given to the ``DEPENDS`` option
-  but also suggests to Visual Studio generators where to hang
+  but also suggests to :ref:`Visual Studio Generators` where to hang
   the custom command. Each source file may have at most one command
   specifying it as its main dependency. A compile command (i.e. for a
   library or an executable) counts as an implicit main dependency which
diff --git a/Help/command/add_dependencies.rst b/Help/command/add_dependencies.rst
index c619212..b0dd494 100644
--- a/Help/command/add_dependencies.rst
+++ b/Help/command/add_dependencies.rst
@@ -12,7 +12,6 @@
 is one created by one of the :command:`add_executable`,
 :command:`add_library`, or :command:`add_custom_target` commands
 (but not targets generated by CMake like ``install``).
-At least one ``<target-dependency>`` must be given.
 
 Dependencies added to an :ref:`imported target <Imported Targets>`
 or an :ref:`interface library <Interface Libraries>` are followed
@@ -32,6 +31,10 @@
   finished before sources in ``<target>`` start compiling; this
   ensures generated sources are available.
 
+.. versionchanged:: 4.1
+  The command may be called with no dependencies.
+  Previously, at least one dependency was required.
+
 See Also
 ^^^^^^^^
 
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index 58b576d..50cb0bc 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -120,9 +120,9 @@
 that would not affect linking of a normal library (e.g. ``.txt``).
 They may contain custom commands generating such sources, but not
 ``PRE_BUILD``, ``PRE_LINK``, or ``POST_BUILD`` commands.  Some native build
-systems (such as Xcode) may not like targets that have only object files, so
-consider adding at least one real source file to any target that references
-:genex:`$\<TARGET_OBJECTS:objlib\> <TARGET_OBJECTS>`.
+systems (such as :generator:`Xcode`) may not like targets that have only
+object files, so consider adding at least one real source file to any target
+that references :genex:`$\<TARGET_OBJECTS:objlib\> <TARGET_OBJECTS>`.
 
 .. versionadded:: 3.12
   Object libraries can be linked to with :command:`target_link_libraries`.
diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst
index df72715..419ee56 100644
--- a/Help/command/add_link_options.rst
+++ b/Help/command/add_link_options.rst
@@ -24,13 +24,13 @@
   see the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
 
 .. |command_name| replace:: ``add_link_options``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
-.. include:: DEVICE_LINK_OPTIONS.txt
+.. include:: include/DEVICE_LINK_OPTIONS.rst
 
-.. include:: OPTIONS_SHELL.txt
+.. include:: include/OPTIONS_SHELL.rst
 
-.. include:: LINK_OPTIONS_LINKER.txt
+.. include:: include/LINK_OPTIONS_LINKER.rst
 
 See Also
 ^^^^^^^^
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index 18f6725..4e72749 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -214,7 +214,7 @@
 .. variable:: CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS
 
   In addition to the scripts shipped with CMake, a user may append full
-  paths to his script(s) to the this list.  The script filename has the
+  paths of their script(s) to this list.  The script filename has the
   following format: ``NNN-<name>.cmake``, where ``NNN`` is three digits
   used to apply collected scripts in a specific order.
 
@@ -234,6 +234,8 @@
 
 .. code-block:: cmake
 
+  # 000-FallbackScript.cmake
+  #
   # Try to detect some old distribution
   # See also
   # - http://linuxmafia.com/faq/Admin/release-files.html
@@ -268,6 +270,18 @@
   endif()
   unset(CMAKE_GET_OS_RELEASE_FALLBACK_CONTENT)
 
+Then this script can be applied as a fallback to determine the missing host
+system information:
+
+.. code-block:: cmake
+
+  list(
+    APPEND
+    CMAKE_GET_OS_RELEASE_FALLBACK_SCRIPTS
+    ${CMAKE_CURRENT_SOURCE_DIR}/000-FallbackScript.cmake
+  )
+
+  cmake_host_system_information(RESULT info QUERY DISTRIB_INFO)
 
 .. rubric:: Footnotes
 
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index 333e514..98861f9 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -59,9 +59,9 @@
 
   cmake_policy(VERSION <min>[...<max>])
 
-.. include:: POLICY_VERSION.txt
+.. include:: include/POLICY_VERSION.rst
 
-.. include:: DEPRECATED_POLICY_VERSIONS.txt
+.. include:: include/DEPRECATED_POLICY_VERSIONS.rst
 
 See Also
 ^^^^^^^^
diff --git a/Help/command/cmake_path.rst b/Help/command/cmake_path.rst
index 81932b6..3094ad6 100644
--- a/Help/command/cmake_path.rst
+++ b/Help/command/cmake_path.rst
@@ -325,8 +325,8 @@
   cmake_path(GET dotPath STEM dotStem)
   cmake_path(GET dotDotPath EXTENSION dotDotExt)
   cmake_path(GET dotDotPath STEM dotDotStem)
-  cmake_path(GET dotMorePath EXTENSION someMoreExt)
-  cmake_path(GET dotMorePath STEM someMoreStem)
+  cmake_path(GET someMorePath EXTENSION someMoreExt)
+  cmake_path(GET someMorePath STEM someMoreStem)
   message("Dot extension is \"${dotExt}\"")
   message("Dot stem is \"${dotStem}\"")
   message("Dot-dot extension is \"${dotDotExt}\"")
@@ -623,7 +623,7 @@
   cmake_path(HAS_FILENAME path has_filename)
   if(has_filename)
     cmake_path(REMOVE_FILENAME path)
-    cmake_path(APPEND path input);
+    cmake_path(APPEND path "${input}")
   endif()
 
 .. _REMOVE_EXTENSION:
@@ -648,10 +648,10 @@
 .. code-block:: cmake
 
   cmake_path(REMOVE_EXTENSION path)
-  if(NOT "input" MATCHES "^\\.")
+  if(NOT input MATCHES "^\\.")
     cmake_path(APPEND_STRING path ".")
   endif()
-  cmake_path(APPEND_STRING path "input")
+  cmake_path(APPEND_STRING path "${input}")
 
 
 .. _Path Generation:
diff --git a/Help/command/cmake_pkg_config.rst b/Help/command/cmake_pkg_config.rst
index 3744d93..32ffed3 100644
--- a/Help/command/cmake_pkg_config.rst
+++ b/Help/command/cmake_pkg_config.rst
@@ -12,9 +12,11 @@
 Synopsis
 ^^^^^^^^
 
-.. code-block:: cmake
+.. parsed-literal::
 
-  cmake_pkg_config(EXTRACT <package> [<version>] [...])
+  cmake_pkg_config(`EXTRACT`_ <package> [<version>] [...])
+  cmake_pkg_config(`POPULATE`_ <package> [<version>] [...])
+  cmake_pkg_config(`IMPORT`_ <package> [<version>] [...])
 
 Introduction
 ^^^^^^^^^^^^
@@ -27,7 +29,31 @@
 semantics as a pkg-config style version specifier, with the exception that if
 no comparison operator is specified ``=`` is assumed.
 
-.. _`common options`:
+PkgConfig Targets
+^^^^^^^^^^^^^^^^^
+
+``cmake_pkg_config`` may recursively generate target-like names in the global
+scope in order to resolve a package ``IMPORT`` or ``POPULATE`` command. These
+names take the form of ``@foreign_pkgcfg::[<prefix>_]<package>`` and are exposed
+via the :prop_tgt:`INTERFACE_LINK_LIBRARIES` target property of an
+``IMPORT``-generated target.
+
+It is not possible to modify or address these pkg-config native targets via
+normal target-based commands. Limited control over their generation is possible
+via the ``POPULATE`` command, but modification should generally be performed
+inside the corresponding package file, not downstream in CMake.
+
+Pkg-config targets are reused across commands. Once a given package name has
+been resolved via ``POPULATE`` or ``IMPORT`` (but not ``EXTRACT``), all future
+requests for the corresponding package name by those commands will resolve to
+the previously generated pkg-config target.
+
+``EXTRACT`` always performs the complete package name lookup in order to allow
+searches for multiple installations of the same package in custom dependency
+management schemes.
+
+Common Options
+^^^^^^^^^^^^^^
 
 There are multiple signatures for this command, and some of the options are
 common between them. They are:
@@ -143,7 +169,7 @@
      library directory paths and ``pc_sysrootdir`` will be set to ``/``
 
 ``TOP_BUILD_DIR <path>``
-  Overrides the top build directory path used to derived the ``pc_top_builddir``
+  Overrides the top build directory path used to derive the ``pc_top_builddir``
   package variable.
 
   When this option is not provided, the default top build directory path is
@@ -154,29 +180,48 @@
   #. If no top build directory path is available, the ``pc_top_builddir``
      package variable is not set
 
+``PREFIX <name>``
+  Specifying a prefix creates an independent collection of pkg-config targets
+  separate from previously populated targets. This enables multiple version of
+  a given package to co-exist, for example packages from different sysroots.
+
+  The default prefix is an empty string.
+
+``BIND_PC_REQUIRES <<name>=<target>>...``
+  A list of ``<name>=<target>`` pairs, the ``name`` is a package name as it
+  appears in the ``Requires`` list of a pkg-config file and the ``target`` is a
+  CMake-native target name (not a pkg-config target).
+
+  When a given package name appears in the ``Requires`` list of a package, it
+  will be fulfilled with the associated CMake target. This behavior applies to
+  all dependencies in the pkg-config graph that have not been previously
+  populated.
+
 Signatures
 ^^^^^^^^^^
 
 .. signature::
   cmake_pkg_config(EXTRACT <package> [<version>] [...])
 
+  .. versionadded:: 3.31
+
   Extract the contents of the package into variables.
 
   .. code-block:: cmake
 
     cmake_pkg_config(EXTRACT <package> [<version>]
                     [REQUIRED] [EXACT] [QUIET]
+                    [SYSTEM_INCLUDE_DIRS <path>...]
+                    [SYSTEM_LIBRARY_DIRS <path>...]
+                    [ALLOW_SYSTEM_INCLUDES <bool>]
+                    [ALLOW_SYSTEM_LIBS <bool>]
                     [STRICTNESS <mode>]
                     [ENV_MODE <mode>]
                     [PC_LIBDIR <path>...]
                     [PC_PATH <path>...]
                     [DISABLE_UNINSTALLED <bool>]
                     [PC_SYSROOT_DIR <path>]
-                    [TOP_BUILD_DIR <path>]
-                    [SYSTEM_INCLUDE_DIRS <path>...]
-                    [SYSTEM_LIBRARY_DIRS <path>...]
-                    [ALLOW_SYSTEM_INCLUDES <bool>]
-                    [ALLOW_SYSTEM_LIBS <bool>])
+                    [TOP_BUILD_DIR <path>])
 
 The following variables will be populated from the contents of package file:
 
@@ -261,3 +306,65 @@
   #. ``CMAKE_PKG_CONFIG_ALLOW_SYS_LIBS``
   #. If the ``PKG_CONFIG_ALLOW_SYSTEM_LIBS`` environment variable is defined
      the flags are preserved, otherwise they are filtered during flag mangling.
+
+.. signature::
+  cmake_pkg_config(POPULATE <package> [<version>] [...])
+
+  .. versionadded:: 4.1
+
+  Populate a package in the pkg-config target namespace
+
+  .. code-block:: cmake
+
+    cmake_pkg_config(POPULATE <package> [<version>]
+                    [REQUIRED] [EXACT] [QUIET]
+                    [PREFIX <prefix>]
+                    [BIND_PC_REQUIRES <<name>=<target>>...]
+                    [STRICTNESS <mode>]
+                    [ENV_MODE <mode>]
+                    [PC_LIBDIR <path>...]
+                    [PC_PATH <path>...]
+                    [DISABLE_UNINSTALLED <bool>]
+                    [PC_SYSROOT_DIR <path>]
+                    [TOP_BUILD_DIR <path>])
+
+``POPULATE`` enables manual control of resolution of a given package's
+``Requires`` list without importing onto a native CMake target. Once populated,
+a package and its dependencies will be used for resolution of all future
+``POPULATE`` and ``IMPORT`` commands.
+
+A ``PKGCONFIG_<package>_FOUND`` variable will be set to indicate whether the
+package was found.
+
+.. signature::
+  cmake_pkg_config(IMPORT <package> [<version>] [...])
+
+  .. versionadded:: 4.1
+
+  Import a pkg-config target as a CMake :prop_tgt:`IMPORTED` target
+
+  .. code-block:: cmake
+
+    cmake_pkg_config(IMPORT <package> [<version>]
+                    [REQUIRED] [EXACT] [QUIET]
+                    [NAME <name>]
+                    [PREFIX <prefix>]
+                    [BIND_PC_REQUIRES <<name>=<target>>...]
+                    [STRICTNESS <mode>]
+                    [ENV_MODE <mode>]
+                    [PC_LIBDIR <path>...]
+                    [PC_PATH <path>...]
+                    [DISABLE_UNINSTALLED <bool>]
+                    [PC_SYSROOT_DIR <path>]
+                    [TOP_BUILD_DIR <path>])
+
+Creates a native CMake ``IMPORTED`` target that can be linked to via
+:command:`target_link_libraries`. This new target is named
+``PkgConfig::<package>`` by default.
+
+A ``PKGCONFIG_<package>_FOUND`` variable will be set to indicate whether the
+package was found.
+
+``NAME``
+  Overrides the name of the created CMake target to ``PkgConfig::<name>``. This
+  *does not* affect the ``PKGCONFIG_<package>_FOUND`` variable.
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index 276e160..bbec8e6 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -39,12 +39,12 @@
 component separators, resulting in the ``...<max>`` part being ignored and
 preserving the pre-3.12 behavior of basing policies on ``<min>``.
 
-.. include:: POLICY_VERSION.txt
+.. include:: include/POLICY_VERSION.rst
 
 Note that the :command:`cmake_minimum_required(VERSION)`
 command implicitly calls ``cmake_policy(VERSION)`` too.
 
-.. include:: DEPRECATED_POLICY_VERSIONS.txt
+.. include:: include/DEPRECATED_POLICY_VERSIONS.rst
 
 Setting Policies Explicitly
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -58,7 +58,7 @@
 one may fix the project to work with the new behavior and set the
 policy state to ``NEW``.
 
-.. include:: ../policy/DEPRECATED.txt
+.. include:: ../policy/include/DEPRECATED.rst
 
 Checking Policy Settings
 ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/command/ctest_start.rst b/Help/command/ctest_start.rst
index 2d68a37..9c4e3dc 100644
--- a/Help/command/ctest_start.rst
+++ b/Help/command/ctest_start.rst
@@ -80,8 +80,8 @@
 However, for the sake of readability, it is recommended that you order your
 parameters in the order listed at the top of this page.
 
-If the :variable:`CTEST_CHECKOUT_COMMAND` variable (or the
-:variable:`CTEST_CVS_CHECKOUT` variable) is set, its content is treated as
+If the :variable:`CTEST_CHECKOUT_COMMAND` variable is set, its content is
+treated as
 command-line.  The command is invoked with the current working directory set
 to the parent of the source directory, even if the source directory already
 exists.  This can be used to create the source tree from a version control
diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst
index d587310..1bffef6 100644
--- a/Help/command/enable_language.rst
+++ b/Help/command/enable_language.rst
@@ -11,7 +11,7 @@
 the :command:`project` command but does not create any of the extra
 variables that are created by the :command:`project` command.
 
-.. include:: SUPPORTED_LANGUAGES.txt
+.. include:: include/SUPPORTED_LANGUAGES.rst
 
 The following restrictions apply to where ``enable_language()`` may be called:
 
diff --git a/Help/command/exec_program.rst b/Help/command/exec_program.rst
index 6010176..7925c21 100644
--- a/Help/command/exec_program.rst
+++ b/Help/command/exec_program.rst
@@ -9,22 +9,55 @@
 
   Use the :command:`execute_process` command instead.
 
-Run an executable program during the processing of the CMakeList.txt
-file.
+Runs an executable program during the processing of a CMake file or script:
 
 .. code-block:: cmake
 
-  exec_program(Executable [directory in which to run]
-               [ARGS <arguments to executable>]
-               [OUTPUT_VARIABLE <var>]
-               [RETURN_VALUE <var>])
+  exec_program(
+    <executable>
+    [<working-dir>]
+    [ARGS <arguments-to-executable>...]
+    [OUTPUT_VARIABLE <var>]
+    [RETURN_VALUE <var>]
+  )
 
-The executable is run in the optionally specified directory.  The
+The ``<executable>`` is run in the optionally specified directory
+``<working-dir>``.  The
 executable can include arguments if it is double quoted, but it is
 better to use the optional ``ARGS`` argument to specify arguments to the
-program.  This is because cmake will then be able to escape spaces in
+executable program.  This is because CMake will then be able to escape spaces in
 the executable path.  An optional argument ``OUTPUT_VARIABLE`` specifies a
 variable in which to store the output.  To capture the return value of
 the execution, provide a ``RETURN_VALUE``.  If ``OUTPUT_VARIABLE`` is
 specified, then no output will go to the stdout/stderr of the console
-running cmake.
+running CMake.
+
+Examples
+^^^^^^^^
+
+Example of the legacy ``exec_program()`` command used in earlier versions of
+CMake:
+
+.. code-block:: cmake
+
+  exec_program(
+    some_command
+    ${dir}
+    ARGS arg_1 arg_2 args "\"<quoted-arg>\""
+    OUTPUT_VARIABLE output
+    RETURN_VALUE result
+  )
+
+A direct equivalent replacement of the previous example using the
+:command:`execute_process` command in new code:
+
+.. code-block:: cmake
+
+  execute_process(
+    COMMAND some_command arg_1 arg_2 args "<quoted-arg>"
+    WORKING_DIRECTORY ${dir}
+    RESULT_VARIABLE result
+    OUTPUT_VARIABLE output
+    ERROR_VARIABLE output
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index c2c7fe3..a2f9036 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -121,6 +121,10 @@
  and standard error pipes, respectively.  If the same variable is named
  for both pipes their output will be merged in the order produced.
 
+``OUTPUT_STRIP_TRAILING_WHITESPACE``, ``ERROR_STRIP_TRAILING_WHITESPACE``
+  Removes whitespace characters from the end of the values stored in the
+  corresponding ``OUTPUT_VARIABLE`` and ``ERROR_VARIABLE`` variables.
+
 ``ECHO_OUTPUT_VARIABLE``, ``ECHO_ERROR_VARIABLE``
   .. versionadded:: 3.18
 
diff --git a/Help/command/export.rst b/Help/command/export.rst
index 349522e..6668e97 100644
--- a/Help/command/export.rst
+++ b/Help/command/export.rst
@@ -89,10 +89,10 @@
 
 .. versionadded:: 3.7
 
-This signature exports cmake built targets to the android ndk build system
+This signature exports CMake built targets to the android ndk build system
 by creating an ``Android.mk`` file that references the prebuilt targets. The
 Android NDK supports the use of prebuilt libraries, both static and shared.
-This allows cmake to build the libraries of a project and make them available
+This allows CMake to build the libraries of a project and make them available
 to an ndk build system complete with transitive dependencies, include flags
 and defines required to use the libraries. The signature takes a list of
 targets and puts them in the ``Android.mk`` file specified by the
@@ -127,6 +127,39 @@
   Specify that :command:`find_dependency` calls should be exported. See
   :command:`install(EXPORT)` for details on how this works.
 
+Exporting Targets to the |CPS|
+""""""""""""""""""""""""""""""
+
+.. code-block:: cmake
+
+  export(EXPORT <export-name> PACKAGE_INFO <package-name>
+         [PROJECT <project-name>|NO_PROJECT_METADATA]
+         [APPENDIX <appendix-name>]
+         [LOWER_CASE_FILE]
+         [VERSION <version>
+          [COMPAT_VERSION <version>]
+          [VERSION_SCHEMA <string>]]
+         [DEFAULT_TARGETS <target>...]
+         [DEFAULT_CONFIGURATIONS <config>...]
+         [DESCRIPTION <project-description-string>]
+         [HOMEPAGE_URL <url-string>])
+
+.. versionadded:: 4.1
+.. note::
+
+  Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
+
+Creates a file in the |CPS|_ that may be included by outside projects to import
+targets named by ``<target>...`` from the current project's build tree.  See
+the :command:`install(PACKAGE_INFO)` command to export targets from an install
+tree.  The imported targets are implicitly in the namespace ``<package-name>``.
+
+The default file name is ``<package-name>[-<appendix-name>].cps``. If the
+``LOWER_CASE_FILE`` option is given, the file name will use the package name
+converted to lower case.
+
+See :command:`install(PACKAGE_INFO)` for a description of the other options.
+
 Exporting Packages
 ^^^^^^^^^^^^^^^^^^
 
@@ -221,3 +254,6 @@
     this target. If specified, the generated code will check to see if the
     ``.xcframework`` exists, and if it does, it will use the ``.xcframework``
     as its imported location instead of the installed library.
+
+.. _CPS: https://cps-org.github.io/cps/
+.. |CPS| replace:: Common Package Specification
diff --git a/Help/command/find_file.rst b/Help/command/find_file.rst
index 9ef8a6d..9695ddf 100644
--- a/Help/command/find_file.rst
+++ b/Help/command/find_file.rst
@@ -45,4 +45,4 @@
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
 
-.. include:: FIND_XXX.txt
+.. include:: include/FIND_XXX.rst
diff --git a/Help/command/find_library.rst b/Help/command/find_library.rst
index fea5e74..b150818 100644
--- a/Help/command/find_library.rst
+++ b/Help/command/find_library.rst
@@ -44,7 +44,7 @@
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_LIBRARY`
 
-.. include:: FIND_XXX.txt
+.. include:: include/FIND_XXX.rst
 
 When more than one value is given to the ``NAMES`` option this command by
 default will consider one name at a time and search every directory
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 72b28d3..4dc9696 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -50,6 +50,8 @@
 
 The command has a few modes by which it searches for packages:
 
+.. _`Module mode`:
+
 **Module mode**
   In this mode, CMake searches for a file called ``Find<PackageName>.cmake``,
   looking first in the locations listed in the :variable:`CMAKE_MODULE_PATH`,
@@ -70,6 +72,8 @@
   Module mode is only supported by the
   :ref:`basic command signature <Basic Signature>`.
 
+.. _`Config mode`:
+
 **Config mode**
   In this mode, CMake searches for a file called
   ``<lowercasePackageName>-config.cmake`` or ``<PackageName>Config.cmake``.
@@ -132,7 +136,7 @@
 .. code-block:: cmake
 
   find_package(<PackageName> [version] [EXACT] [QUIET] [MODULE]
-               [REQUIRED] [[COMPONENTS] [components...]]
+               [REQUIRED|OPTIONAL] [[COMPONENTS] [components...]]
                [OPTIONAL_COMPONENTS components...]
                [REGISTRY_VIEW  (64|32|64_32|32_64|HOST|TARGET|BOTH)]
                [GLOBAL]
@@ -159,6 +163,13 @@
 ``REQUIRED`` option is present, the ``COMPONENTS`` keyword can be omitted
 and the required components can be listed directly after ``REQUIRED``.
 
+The :variable:`CMAKE_FIND_REQUIRED` variable can be enabled to make this call
+``REQUIRED`` by default. This behavior can be overridden by providing the
+``OPTIONAL`` keyword. As with the ``REQUIRED`` option, a list of components
+can be listed directly after ``OPTIONAL``, which is equivalent to listing
+them after the ``COMPONENTS`` keyword. When the ``OPTIONAL`` keyword is given,
+the warning output when a package is not found is suppressed.
+
 Additional optional components may be listed after ``OPTIONAL_COMPONENTS``.
 If these cannot be satisfied, the package overall can still be considered
 found, as long as all required components are satisfied.
@@ -246,7 +257,7 @@
 .. code-block:: cmake
 
   find_package(<PackageName> [version] [EXACT] [QUIET]
-               [REQUIRED] [[COMPONENTS] [components...]]
+               [REQUIRED|OPTIONAL] [[COMPONENTS] [components...]]
                [OPTIONAL_COMPONENTS components...]
                [CONFIG|NO_MODULE]
                [GLOBAL]
@@ -429,7 +440,7 @@
   ``REGISTRY_VIEW`` can be specified to manage ``Windows`` registry queries
   specified as part of ``PATHS`` and ``HINTS``.
 
-  .. include:: FIND_XXX_REGISTRY_VIEW.txt
+  .. include:: include/FIND_XXX_REGISTRY_VIEW.rst
 
 If ``PATH_SUFFIXES`` is specified, the suffixes are appended to each
 (``W``) or (``U``) directory entry one-by-one.
@@ -613,8 +624,8 @@
    and ``<prefix>/<name>.framework/Versions/*/Resources/CMake``.  In previous
    versions of CMake, this order was unspecified.
 
-.. include:: FIND_XXX_ROOT.txt
-.. include:: FIND_XXX_ORDER.txt
+.. include:: include/FIND_XXX_ROOT.rst
+.. include:: include/FIND_XXX_ORDER.rst
 
 By default the value stored in the result variable will be the path at
 which the file is found.  The :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS`
@@ -632,6 +643,9 @@
 
 Setting both variables to ``TRUE`` simultaneously is an error.
 
+The :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` variable takes priority
+over the ``OPTIONAL`` keyword in determining whether a package is required.
+
 .. _`version selection`:
 
 Config Mode Version Selection
@@ -649,6 +663,8 @@
 match of the requested version may be found.  CMake does not establish any
 convention for the meaning of version numbers.
 
+.. _`cmake script version selection`:
+
 CMake-script
 """"""""""""
 
@@ -781,6 +797,8 @@
   As a result, it is not possible to use a version range to extend the range
   of compatible package versions that will be accepted.
 
+.. _`cps version selection`:
+
 |CPS|
 """""
 
@@ -808,6 +826,9 @@
 is implicitly equal to the package version, i.e. no backwards compatibility is
 provided.
 
+.. TODO Rework the preceding paragraph when COMPAT_VERSION has broader support
+        in CMake.
+
 When a package uses a recognized schema, CMake will determine the package's
 acceptability according to the following rules:
 
diff --git a/Help/command/find_path.rst b/Help/command/find_path.rst
index 080c231..ab44e32 100644
--- a/Help/command/find_path.rst
+++ b/Help/command/find_path.rst
@@ -44,7 +44,7 @@
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_INCLUDE`
 
-.. include:: FIND_XXX.txt
+.. include:: include/FIND_XXX.rst
 
 When searching for frameworks, if the file is specified as ``A/b.h``, then
 the framework search will look for ``A.framework/Headers/b.h``.  If that
diff --git a/Help/command/find_program.rst b/Help/command/find_program.rst
index d20ca93..bde5289 100644
--- a/Help/command/find_program.rst
+++ b/Help/command/find_program.rst
@@ -35,7 +35,7 @@
 .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
    :variable:`CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`
 
-.. include:: FIND_XXX.txt
+.. include:: include/FIND_XXX.rst
 
 When more than one value is given to the ``NAMES`` option this command by
 default will consider one name at a time and search every directory
diff --git a/Help/command/DEPRECATED_POLICY_VERSIONS.txt b/Help/command/include/DEPRECATED_POLICY_VERSIONS.rst
similarity index 100%
rename from Help/command/DEPRECATED_POLICY_VERSIONS.txt
rename to Help/command/include/DEPRECATED_POLICY_VERSIONS.rst
diff --git a/Help/command/DEVICE_LINK_OPTIONS.txt b/Help/command/include/DEVICE_LINK_OPTIONS.rst
similarity index 100%
rename from Help/command/DEVICE_LINK_OPTIONS.txt
rename to Help/command/include/DEVICE_LINK_OPTIONS.rst
diff --git a/Help/command/include/FIND_XXX.rst b/Help/command/include/FIND_XXX.rst
new file mode 100644
index 0000000..9d063ad
--- /dev/null
+++ b/Help/command/include/FIND_XXX.rst
@@ -0,0 +1,265 @@
+A short-hand signature is:
+
+.. parsed-literal::
+
+   |FIND_XXX| (<VAR> name1 [path1 path2 ...])
+
+The general signature is:
+
+.. parsed-literal::
+
+   |FIND_XXX| (
+             <VAR>
+             name | |NAMES|
+             [HINTS [path | ENV var]...]
+             [PATHS [path | ENV var]...]
+             [REGISTRY_VIEW (64|32|64_32|32_64|HOST|TARGET|BOTH)]
+             [PATH_SUFFIXES suffix1 [suffix2 ...]]
+             [VALIDATOR function]
+             [DOC "cache documentation string"]
+             [NO_CACHE]
+             [REQUIRED|OPTIONAL]
+             [NO_DEFAULT_PATH]
+             [NO_PACKAGE_ROOT_PATH]
+             [NO_CMAKE_PATH]
+             [NO_CMAKE_ENVIRONMENT_PATH]
+             [NO_SYSTEM_ENVIRONMENT_PATH]
+             [NO_CMAKE_SYSTEM_PATH]
+             [NO_CMAKE_INSTALL_PREFIX]
+             [CMAKE_FIND_ROOT_PATH_BOTH |
+              ONLY_CMAKE_FIND_ROOT_PATH |
+              NO_CMAKE_FIND_ROOT_PATH]
+            )
+
+This command is used to find a |SEARCH_XXX_DESC|.
+A cache entry, or a normal variable if ``NO_CACHE`` is specified,
+named by ``<VAR>`` is created to store the result of this command.
+If the |SEARCH_XXX| is found the result is stored in the variable
+and the search will not be repeated unless the variable is cleared.
+If nothing is found, the result will be ``<VAR>-NOTFOUND``.
+
+Options include:
+
+``NAMES``
+  Specify one or more possible names for the |SEARCH_XXX|.
+
+  When using this to specify names with and without a version
+  suffix, we recommend specifying the unversioned name first
+  so that locally-built packages can be found before those
+  provided by distributions.
+
+``HINTS``, ``PATHS``
+  Specify directories to search in addition to the default locations.
+  The ``ENV var`` sub-option reads paths from a system environment
+  variable.
+
+  .. versionchanged:: 3.24
+    On ``Windows`` platform, it is possible to include registry queries as part
+    of the directories, using a :ref:`dedicated syntax <Find Using Windows Registry>`.
+    Such specifications will be ignored on all other platforms.
+
+``REGISTRY_VIEW``
+  .. versionadded:: 3.24
+
+  .. include:: include/FIND_XXX_REGISTRY_VIEW.rst
+
+``PATH_SUFFIXES``
+  Specify additional subdirectories to check below each directory
+  location otherwise considered.
+
+``VALIDATOR``
+  .. versionadded:: 3.25
+
+  Specify a :command:`function` to be called for each candidate item found
+  (a :command:`macro` cannot be provided, that will result in an error).
+  Two arguments will be passed to the validator function: the name of a
+  result variable, and the absolute path to the candidate item.  The item
+  will be accepted and the search will end unless the function sets the
+  value in the result variable to false in the calling scope.  The result
+  variable will hold a true value when the validator function is entered.
+
+  .. parsed-literal::
+
+     function(my_check validator_result_var item)
+       if(NOT item MATCHES ...)
+         set(${validator_result_var} FALSE PARENT_SCOPE)
+       endif()
+     endfunction()
+
+     |FIND_XXX| (result NAMES ... VALIDATOR my_check)
+
+  Note that if a cached result is used, the search is skipped and any
+  ``VALIDATOR`` is ignored.  The cached result is not required to pass the
+  validation function.
+
+``DOC``
+  Specify the documentation string for the ``<VAR>`` cache entry.
+
+``NO_CACHE``
+  .. versionadded:: 3.21
+
+  The result of the search will be stored in a normal variable rather than
+  a cache entry.
+
+  .. note::
+
+    If the variable is already set before the call (as a normal or cache
+    variable) then the search will not occur.
+
+  .. warning::
+
+    This option should be used with caution because it can greatly increase
+    the cost of repeated configure steps.
+
+``REQUIRED``
+  .. versionadded:: 3.18
+
+  Stop processing with an error message if nothing is found, otherwise
+  the search will be attempted again the next time |FIND_XXX| is invoked
+  with the same variable.
+
+  .. versionadded:: 4.1
+
+    Every |FIND_XXX| command will be treated as ``REQUIRED`` when the
+    :variable:`CMAKE_FIND_REQUIRED` variable is enabled.
+
+``OPTIONAL``
+  .. versionadded:: 4.1
+
+  Ignore the value of :variable:`CMAKE_FIND_REQUIRED` and
+  continue without an error message if nothing is found.
+  Incompatible with ``REQUIRED``.
+
+If ``NO_DEFAULT_PATH`` is specified, then no additional paths are
+added to the search.
+If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
+
+.. |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX_SUBDIR| replace::
+   |prefix_XXX_SUBDIR| for each ``<prefix>`` in the
+   :variable:`<PackageName>_ROOT` CMake variable and the
+   :envvar:`<PackageName>_ROOT` environment variable if
+   called from within a find module loaded by
+   :command:`find_package(<PackageName>)`
+
+.. |CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
+   |prefix_XXX_SUBDIR| for each ``<prefix>`` in :variable:`CMAKE_PREFIX_PATH`
+
+.. |ENV_CMAKE_PREFIX_PATH_XXX_SUBDIR| replace::
+   |prefix_XXX_SUBDIR| for each ``<prefix>`` in :envvar:`CMAKE_PREFIX_PATH`
+
+.. |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR| replace::
+   |prefix_XXX_SUBDIR| for each ``<prefix>/[s]bin`` in ``PATH``, and
+   |entry_XXX_SUBDIR| for other entries in ``PATH``
+
+.. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR| replace::
+   |prefix_XXX_SUBDIR| for each ``<prefix>`` in
+   :variable:`CMAKE_SYSTEM_PREFIX_PATH`
+
+1. If called from within a find module or any other script loaded by a call to
+   :command:`find_package(<PackageName>)`, search prefixes unique to the
+   current package being found.  See policy :policy:`CMP0074`.
+
+   .. versionadded:: 3.12
+
+   Specifically, search paths specified by the following variables, in order:
+
+   a. :variable:`<PackageName>_ROOT` CMake variable,
+      where ``<PackageName>`` is the case-preserved package name.
+
+   b. :variable:`<PACKAGENAME>_ROOT` CMake variable,
+      where ``<PACKAGENAME>`` is the upper-cased package name.
+      See policy :policy:`CMP0144`.
+
+      .. versionadded:: 3.27
+
+   c. :envvar:`<PackageName>_ROOT` environment variable,
+      where ``<PackageName>`` is the case-preserved package name.
+
+   d. :envvar:`<PACKAGENAME>_ROOT` environment variable,
+      where ``<PACKAGENAME>`` is the upper-cased package name.
+      See policy :policy:`CMP0144`.
+
+      .. versionadded:: 3.27
+
+   The package root variables are maintained as a stack, so if called from
+   nested find modules or config packages, root paths from the parent's find
+   module or config package will be searched after paths from the current
+   module or package.  In other words, the search order would be
+   ``<CurrentPackage>_ROOT``, ``ENV{<CurrentPackage>_ROOT}``,
+   ``<ParentPackage>_ROOT``, ``ENV{<ParentPackage>_ROOT}``, etc.
+   This can be skipped if ``NO_PACKAGE_ROOT_PATH`` is passed or by setting
+   the :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` to ``FALSE``.
+
+   * |FIND_PACKAGE_ROOT_PREFIX_PATH_XXX|
+
+2. Search paths specified in cmake-specific cache variables.
+   These are intended to be used on the command line with a ``-DVAR=value``.
+   The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
+   This can be skipped if ``NO_CMAKE_PATH`` is passed or by setting the
+   :variable:`CMAKE_FIND_USE_CMAKE_PATH` to ``FALSE``.
+
+   * |CMAKE_PREFIX_PATH_XXX|
+   * |CMAKE_XXX_PATH|
+   * |CMAKE_XXX_MAC_PATH|
+
+3. Search paths specified in cmake-specific environment variables.
+   These are intended to be set in the user's shell configuration,
+   and therefore use the host's native path separator
+   (``;`` on Windows and ``:`` on UNIX).
+   This can be skipped if ``NO_CMAKE_ENVIRONMENT_PATH`` is passed or
+   by setting the :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH` to ``FALSE``.
+
+   * |ENV_CMAKE_PREFIX_PATH_XXX|
+   * |ENV_CMAKE_XXX_PATH|
+   * |ENV_CMAKE_XXX_MAC_PATH|
+
+4. Search the paths specified by the ``HINTS`` option.
+   These should be paths computed by system introspection, such as a
+   hint provided by the location of another item already found.
+   Hard-coded guesses should be specified with the ``PATHS`` option.
+
+5. Search the standard system environment variables.
+   This can be skipped if ``NO_SYSTEM_ENVIRONMENT_PATH`` is passed or by
+   setting the :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH` to ``FALSE``.
+
+   * |SYSTEM_ENVIRONMENT_PATH_XXX|
+
+   |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX|
+
+6. Search cmake variables defined in the Platform files
+   for the current system.  The searching of ``CMAKE_INSTALL_PREFIX`` and
+   ``CMAKE_STAGING_PREFIX`` can be
+   skipped if ``NO_CMAKE_INSTALL_PREFIX`` is passed or by setting the
+   :variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE``. All these locations
+   can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed or by setting the
+   :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` to ``FALSE``.
+
+   * |CMAKE_SYSTEM_PREFIX_PATH_XXX|
+   * |CMAKE_SYSTEM_XXX_PATH|
+   * |CMAKE_SYSTEM_XXX_MAC_PATH|
+
+   The platform paths that these variables contain are locations that
+   typically include installed software. An example being ``/usr/local`` for
+   UNIX based platforms.
+
+7. Search the paths specified by the PATHS option
+   or in the short-hand version of the command.
+   These are typically hard-coded guesses.
+
+The :variable:`CMAKE_IGNORE_PATH`, :variable:`CMAKE_IGNORE_PREFIX_PATH`,
+:variable:`CMAKE_SYSTEM_IGNORE_PATH` and
+:variable:`CMAKE_SYSTEM_IGNORE_PREFIX_PATH` variables can also cause some
+of the above locations to be ignored.
+
+.. versionadded:: 3.16
+  Added ``CMAKE_FIND_USE_<CATEGORY>_PATH`` variables to globally disable
+  various search locations.
+
+.. |FIND_ARGS_XXX| replace:: <VAR> NAMES name
+
+On macOS the :variable:`CMAKE_FIND_FRAMEWORK` and
+:variable:`CMAKE_FIND_APPBUNDLE` variables determine the order of
+preference between Apple-style and unix-style package components.
+
+.. include:: include/FIND_XXX_ROOT.rst
+.. include:: include/FIND_XXX_ORDER.rst
diff --git a/Help/command/FIND_XXX_ORDER.txt b/Help/command/include/FIND_XXX_ORDER.rst
similarity index 100%
rename from Help/command/FIND_XXX_ORDER.txt
rename to Help/command/include/FIND_XXX_ORDER.rst
diff --git a/Help/command/FIND_XXX_REGISTRY_VIEW.txt b/Help/command/include/FIND_XXX_REGISTRY_VIEW.rst
similarity index 100%
rename from Help/command/FIND_XXX_REGISTRY_VIEW.txt
rename to Help/command/include/FIND_XXX_REGISTRY_VIEW.rst
diff --git a/Help/command/FIND_XXX_ROOT.txt b/Help/command/include/FIND_XXX_ROOT.rst
similarity index 100%
rename from Help/command/FIND_XXX_ROOT.txt
rename to Help/command/include/FIND_XXX_ROOT.rst
diff --git a/Help/command/GENEX_NOTE.txt b/Help/command/include/GENEX_NOTE.rst
similarity index 100%
rename from Help/command/GENEX_NOTE.txt
rename to Help/command/include/GENEX_NOTE.rst
diff --git a/Help/command/LINK_LIBRARIES_LINKER.txt b/Help/command/include/LINK_LIBRARIES_LINKER.rst
similarity index 100%
rename from Help/command/LINK_LIBRARIES_LINKER.txt
rename to Help/command/include/LINK_LIBRARIES_LINKER.rst
diff --git a/Help/command/LINK_OPTIONS_LINKER.txt b/Help/command/include/LINK_OPTIONS_LINKER.rst
similarity index 100%
rename from Help/command/LINK_OPTIONS_LINKER.txt
rename to Help/command/include/LINK_OPTIONS_LINKER.rst
diff --git a/Help/command/OPTIONS_SHELL.txt b/Help/command/include/OPTIONS_SHELL.rst
similarity index 100%
rename from Help/command/OPTIONS_SHELL.txt
rename to Help/command/include/OPTIONS_SHELL.rst
diff --git a/Help/command/POLICY_VERSION.txt b/Help/command/include/POLICY_VERSION.rst
similarity index 100%
rename from Help/command/POLICY_VERSION.txt
rename to Help/command/include/POLICY_VERSION.rst
diff --git a/Help/command/SUPPORTED_LANGUAGES.txt b/Help/command/include/SUPPORTED_LANGUAGES.rst
similarity index 100%
rename from Help/command/SUPPORTED_LANGUAGES.txt
rename to Help/command/include/SUPPORTED_LANGUAGES.rst
diff --git a/Help/command/UNSET_NOTE.txt b/Help/command/include/UNSET_NOTE.rst
similarity index 100%
rename from Help/command/UNSET_NOTE.txt
rename to Help/command/include/UNSET_NOTE.rst
diff --git a/Help/command/include_directories.rst b/Help/command/include_directories.rst
index e68bb81..dcb5620 100644
--- a/Help/command/include_directories.rst
+++ b/Help/command/include_directories.rst
@@ -30,7 +30,7 @@
 considered in dependency calculations - see compiler docs.
 
 .. |command_name| replace:: ``include_directories``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
 .. note::
 
diff --git a/Help/command/install.rst b/Help/command/install.rst
index f3262a0..033c5c6 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -46,7 +46,8 @@
   and the order that install rules added in different subdirectories will run is
   not guaranteed.
 
-.. _`common options`:
+Common Options
+""""""""""""""
 
 There are multiple signatures for this command.  Some of them define
 installation options for files and targets.  Options common to
@@ -640,7 +641,7 @@
 
   .. code-block:: cmake
 
-    install(DIRECTORY dirs...
+    install(DIRECTORY <dir>...
             TYPE <type> | DESTINATION <dir>
             [FILE_PERMISSIONS <permission>...]
             [DIRECTORY_PERMISSIONS <permission>...]
@@ -648,124 +649,164 @@
             [CONFIGURATIONS <config>...]
             [COMPONENT <component>] [EXCLUDE_FROM_ALL]
             [FILES_MATCHING]
-            [[PATTERN <pattern> | REGEX <regex>]
-             [EXCLUDE] [PERMISSIONS <permission>...]] [...])
+            [<match-rule> <match-option>...]...
+            )
 
   The ``DIRECTORY`` form installs contents of one or more directories to a
   given destination.  The directory structure is copied verbatim to the
-  destination.  The last component of each directory name is appended to
-  the destination directory but a trailing slash may be used to avoid
-  this because it leaves the last component empty.  Directory names
-  given as relative paths are interpreted with respect to the current
-  source directory.  If no input directory names are given the
-  destination directory will be created but nothing will be installed
-  into it.  The ``FILE_PERMISSIONS`` and ``DIRECTORY_PERMISSIONS`` options
-  specify permissions given to files and directories in the destination.
-  If ``USE_SOURCE_PERMISSIONS`` is specified and ``FILE_PERMISSIONS`` is not,
-  file permissions will be copied from the source directory structure.
-  If no permissions are specified files will be given the default
-  permissions specified in the ``FILES`` form of the command, and the
-  directories will be given the default permissions specified in the
-  ``PROGRAMS`` form of the command.
-
-  .. versionadded:: 3.1
-    The ``MESSAGE_NEVER`` option disables file installation status output.
-
-  Installation of directories may be controlled with fine granularity
-  using the ``PATTERN`` or ``REGEX`` options.  These "match" options specify a
-  globbing pattern or regular expression to match directories or files
-  encountered within input directories.  They may be used to apply
-  certain options (see below) to a subset of the files and directories
-  encountered.  The full path to each input file or directory (with
-  forward slashes) is matched against the expression.  A ``PATTERN`` will
-  match only complete file names: the portion of the full path matching
-  the pattern must occur at the end of the file name and be preceded by
-  a slash.  A ``REGEX`` will match any portion of the full path but it may
-  use ``/`` and ``$`` to simulate the ``PATTERN`` behavior.  By default all
-  files and directories are installed whether or not they are matched.
-  The ``FILES_MATCHING`` option may be given before the first match option
-  to disable installation of files (but not directories) not matched by
-  any expression.  For example, the code
-
-  .. code-block:: cmake
-
-    install(DIRECTORY src/ DESTINATION doc/myproj
-            FILES_MATCHING PATTERN "*.png")
-
-  will extract and install images from a source tree.
-
-  Some options may follow a ``PATTERN`` or ``REGEX`` expression as described
-  under :ref:`string(REGEX) <Regex Specification>` and are applied
-  only to files or directories matching them.  The ``EXCLUDE`` option will
-  skip the matched file or directory.  The ``PERMISSIONS`` option overrides
-  the permissions setting for the matched file or directory.  For
-  example the code
-
-  .. code-block:: cmake
-
-    install(DIRECTORY icons scripts/ DESTINATION share/myproj
-            PATTERN "CVS" EXCLUDE
-            PATTERN "scripts/*"
-            PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
-                        GROUP_EXECUTE GROUP_READ)
-
-  will install the ``icons`` directory to ``share/myproj/icons`` and the
-  ``scripts`` directory to ``share/myproj``.  The icons will get default
-  file permissions, the scripts will be given specific permissions, and any
-  ``CVS`` directories will be excluded.
+  destination.
 
   Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both.
-  A ``TYPE`` argument specifies the generic file type of the files within the
-  listed directories being installed.  A destination will then be set
-  automatically by taking the corresponding variable from
-  :module:`GNUInstallDirs`, or by using a built-in default if that variable
-  is not defined.  See the table below for the supported file types and their
-  corresponding variables and built-in defaults.  Projects can provide a
-  ``DESTINATION`` argument instead of a file type if they wish to explicitly
-  define the install destination.
+  If no permissions is given, files will be given the default permissions
+  specified in the `FILES`_ form of the command, and the directories
+  will be given the default permissions specified in the `PROGRAMS`_
+  form of the command.
 
-  ======================= ================================== =========================
-     ``TYPE`` Argument         GNUInstallDirs Variable           Built-In Default
-  ======================= ================================== =========================
-  ``BIN``                 ``${CMAKE_INSTALL_BINDIR}``        ``bin``
-  ``SBIN``                ``${CMAKE_INSTALL_SBINDIR}``       ``sbin``
-  ``LIB``                 ``${CMAKE_INSTALL_LIBDIR}``        ``lib``
-  ``INCLUDE``             ``${CMAKE_INSTALL_INCLUDEDIR}``    ``include``
-  ``SYSCONF``             ``${CMAKE_INSTALL_SYSCONFDIR}``    ``etc``
-  ``SHAREDSTATE``         ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com``
-  ``LOCALSTATE``          ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var``
-  ``RUNSTATE``            ``${CMAKE_INSTALL_RUNSTATEDIR}``   ``<LOCALSTATE dir>/run``
-  ``DATA``                ``${CMAKE_INSTALL_DATADIR}``       ``<DATAROOT dir>``
-  ``INFO``                ``${CMAKE_INSTALL_INFODIR}``       ``<DATAROOT dir>/info``
-  ``LOCALE``              ``${CMAKE_INSTALL_LOCALEDIR}``     ``<DATAROOT dir>/locale``
-  ``MAN``                 ``${CMAKE_INSTALL_MANDIR}``        ``<DATAROOT dir>/man``
-  ``DOC``                 ``${CMAKE_INSTALL_DOCDIR}``        ``<DATAROOT dir>/doc``
-  ``LIBEXEC``             ``${CMAKE_INSTALL_LIBEXECDIR}``    ``libexec``
-  ======================= ================================== =========================
+  The options are:
 
-  Note that some of the types' built-in defaults use the ``DATAROOT`` directory as
-  a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with
-  ``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in
-  default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use
-  ``DATA`` instead.
+  ``<dir>...``
+    The list of directories to be installed.
 
-  To make packages compliant with distribution filesystem layout policies, if
-  projects must specify a ``DESTINATION``, it is strongly recommended that they use
-  a path that begins with the appropriate relative :module:`GNUInstallDirs` variable.
-  This allows package maintainers to control the install destination by setting
-  the appropriate cache variables.
+    The last component of each directory name is appended to the
+    destination directory but a trailing slash may be used to avoid
+    this because it leaves the last component empty.  Directory names
+    given as relative paths are interpreted with respect to the current
+    source directory.  If no input directory names are given the
+    destination directory will be created but nothing will be installed
+    into it.
 
-  .. versionadded:: 3.4
-    An install destination given as a ``DESTINATION`` argument may
-    use "generator expressions" with the syntax ``$<...>``.  See the
-    :manual:`cmake-generator-expressions(7)` manual for available expressions.
+    .. versionadded:: 3.5
+      The source ``<dir>...`` list may use "generator expressions" with the
+      syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)`
+      manual for available expressions.
 
-  .. versionadded:: 3.5
-    The list of ``dirs...`` given to ``DIRECTORY`` may use
-    "generator expressions" too.
+  ``TYPE <type>``
+    Specifies the generic file type of the files within the listed
+    directories being installed.  A destination will then be set
+    automatically by taking the corresponding variable from
+    :module:`GNUInstallDirs`, or by using a built-in default if that
+    variable is not defined.  See the table below for the supported
+    file types and their corresponding variables and built-in defaults.
+    Projects can provide a ``DESTINATION`` argument instead of a file
+    type if they wish to explicitly define the install destination.
 
-  .. versionadded:: 3.31
-    The ``TYPE`` argument now supports type ``LIBEXEC``.
+    ======================= ================================== =========================
+       ``TYPE`` Argument         GNUInstallDirs Variable           Built-In Default
+    ======================= ================================== =========================
+    ``BIN``                 ``${CMAKE_INSTALL_BINDIR}``        ``bin``
+    ``SBIN``                ``${CMAKE_INSTALL_SBINDIR}``       ``sbin``
+    ``LIB``                 ``${CMAKE_INSTALL_LIBDIR}``        ``lib``
+    ``INCLUDE``             ``${CMAKE_INSTALL_INCLUDEDIR}``    ``include``
+    ``SYSCONF``             ``${CMAKE_INSTALL_SYSCONFDIR}``    ``etc``
+    ``SHAREDSTATE``         ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com``
+    ``LOCALSTATE``          ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var``
+    ``RUNSTATE``            ``${CMAKE_INSTALL_RUNSTATEDIR}``   ``<LOCALSTATE dir>/run``
+    ``DATA``                ``${CMAKE_INSTALL_DATADIR}``       ``<DATAROOT dir>``
+    ``INFO``                ``${CMAKE_INSTALL_INFODIR}``       ``<DATAROOT dir>/info``
+    ``LOCALE``              ``${CMAKE_INSTALL_LOCALEDIR}``     ``<DATAROOT dir>/locale``
+    ``MAN``                 ``${CMAKE_INSTALL_MANDIR}``        ``<DATAROOT dir>/man``
+    ``DOC``                 ``${CMAKE_INSTALL_DOCDIR}``        ``<DATAROOT dir>/doc``
+    ``LIBEXEC``             ``${CMAKE_INSTALL_LIBEXECDIR}``    ``libexec``
+    ======================= ================================== =========================
+
+    Note that some of the types' built-in defaults use the ``DATAROOT``
+    directory as a prefix.  The ``DATAROOT`` prefix is calculated similarly
+    to the types, with ``CMAKE_INSTALL_DATAROOTDIR`` as the variable and
+    ``share`` as the built-in default.  You cannot use ``DATAROOT`` as a
+    ``TYPE`` parameter; please use ``DATA`` instead.
+
+    .. versionadded:: 3.31
+      The ``LIBEXEC`` type.
+
+  ``DESTINATION <dir>``
+    The destination directory, as documented among the `common options`_.
+
+    To make packages compliant with distribution filesystem layout
+    policies, if projects must specify a ``DESTINATION``, it is
+    strongly recommended that they use a path that begins with the
+    appropriate relative :module:`GNUInstallDirs` variable.
+    This allows package maintainers to control the install destination
+    by setting the appropriate cache variables.
+
+    .. versionadded:: 3.4
+      The destination ``<dir>`` may use "generator expressions" with the
+      syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)`
+      manual for available expressions.
+
+  ``FILE_PERMISSIONS <permission>...``
+    Specify permissions given to files in the destination, where the
+    ``<permission>`` names are documented among the `common options`_.
+
+  ``DIRECTORY_PERMISSIONS <permission>...``
+    Specify permissions given to directories in the destination, where the
+    ``<permission>`` names are documented among the `common options`_.
+
+  ``USE_SOURCE_PERMISSIONS``
+    If specified, and ``FILE_PERMISSIONS`` is not, file permissions will
+    be copied from the source directory structure.
+
+  ``MESSAGE_NEVER``
+    .. versionadded:: 3.1
+
+    Disable file installation status output.
+
+  ``FILES_MATCHING``
+    This option may be given before the first ``<match-rule>`` to
+    disable installation of files (but not directories) not matched
+    by any expression.  For example, the code
+
+    .. code-block:: cmake
+
+      install(DIRECTORY src/ DESTINATION doc/myproj
+              FILES_MATCHING PATTERN "*.png")
+
+    will extract and install images from a source tree.
+
+  ``<match-rule> <match-option>...``
+    Installation of directories may be controlled with fine granularity
+    using rules that match directories or files encountered within input
+    directories.  They may be used to apply certain options (see below)
+    to a subset of the files and directories encountered.  All files
+    and directories are installed whether or not they are matched,
+    unless the above ``FILES_MATCHING`` option is given.
+
+    The full path to each input file or directory, with forward slashes,
+    may be matched by a ``<match-rule>``:
+
+    ``PATTERN <pattern>``
+      Match complete file names using a globbing pattern.  The portion of
+      the full path matching the pattern must occur at the end of the file
+      name and be preceded by a slash (which is not part of the pattern).
+
+    ``REGEX <regex>``
+      Match any portion of the full path of a file with a
+      :ref:`regular expression <Regex Specification>`.
+      One may use ``/`` and ``$`` to limit matching to the end of a path.
+
+    Each ``<match-rule>`` may be followed by ``<match-option>`` arguments.
+    The match options apply to the files or directories matched by the rule.
+    The match options are:
+
+    ``EXCLUDE``
+      Exclude the matched file or directory from installation.
+
+    ``PERMISSIONS <permission>...``
+      Ovrerride the permissions setting for the matched file or directory.
+
+    For example, the code
+
+    .. code-block:: cmake
+
+      install(DIRECTORY icons scripts/ DESTINATION share/myproj
+              PATTERN "CVS" EXCLUDE
+              PATTERN "scripts/*"
+              PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+                          GROUP_EXECUTE GROUP_READ)
+
+    will install the ``icons`` directory to ``share/myproj/icons`` and the
+    ``scripts`` directory to ``share/myproj``.  The icons will get default
+    file permissions, the scripts will be given specific permissions, and any
+    ``CVS`` directories will be excluded.
 
 .. signature::
   install(SCRIPT <file> [...])
@@ -943,6 +984,7 @@
   .. code-block:: cmake
 
     install(PACKAGE_INFO <package-name> EXPORT <export-name>
+            [PROJECT <project-name>|NO_PROJECT_METADATA]
             [APPENDIX <appendix-name>]
             [DESTINATION <dir>]
             [LOWER_CASE_FILE]
@@ -951,6 +993,8 @@
              [VERSION_SCHEMA <string>]]
             [DEFAULT_TARGETS <target>...]
             [DEFAULT_CONFIGURATIONS <config>...]
+            [DESCRIPTION <project-description-string>]
+            [HOMEPAGE_URL <url-string>]
             [PERMISSIONS <permission>...]
             [CONFIGURATIONS <config>...]
             [COMPONENT <component>]
@@ -970,6 +1014,62 @@
 
   If ``DESTINATION`` is not specified, a platform-specific default is used.
 
+  Several options may be used to specify package metadata:
+
+  ``VERSION <version>``
+    Version of the package.  The ``<version>`` shall conform to the specified
+    schema.  Refer to :ref:`Version Selection (CPS) <cps version selection>`
+    for more information on how the package version is used when consumers
+    request a package.
+
+  ``COMPAT_VERSION <version>``
+    Oldest version for which the package provides compatibility.
+
+    If not specified, ``COMPAT_VERSION`` is implicitly taken to equal the
+    package's ``VERSION``, which is to say that no backwards compatibility is
+    provided.
+
+  ``VERSION_SCHEMA <schema>``
+    The schema that the package's version number(s) (both ``VERSION`` and
+    ``COMPAT_VERSION``) follow.  While no schema will be written to the
+    ``.cps`` file if this option is not provided, CPS specifies that the schema
+    is assumed to be ``simple`` in such cases. Refer to |cps-version_schema|_
+    for more details and a list of officially supported schemas, but be aware
+    that the specification may include schemas that are not supported by CMake.
+    See :ref:`Version Selection (CPS) <cps version selection>` for the list of
+    schemas supported by :command:`find_package`.
+
+  ``DEFAULT_TARGETS <target>...``
+
+    Targets to be used if a consumer requests linking to the package name,
+    rather than to specific components.
+
+  ``DEFAULT_CONFIGURATIONS <config>...``
+
+    Ordered list of configurations consumers should prefer if no exact match or
+    mapping of the consumer's configuration to the package's available
+    configurations exists.  If not specified, CMake will fall back to the
+    package's available configurations in an unspecified order.
+
+  ``DESCRIPTION <project-description-string>``
+    .. versionadded:: 4.1
+
+    An informational description of the project.  It is recommended that this
+    description is a relatively short string, usually no more than a few words.
+
+  ``HOMEPAGE_URL <url-string>``
+    .. versionadded:: 4.1
+
+    An informational canonical home URL for the project.
+
+  By default, if the specified ``<package-name>`` matches the current CMake
+  :variable:`PROJECT_NAME`, package metadata will be inherited from the
+  project.  The ``PROJECT <project-name>`` option may be used to specify a
+  different project from which to inherit metadata.  If ``NO_PROJECT_METADATA``
+  is specified, automatic inheritance of package metadata will be disabled.
+  In any case, any metadata values specified in the ``install`` command will
+  take precedence.
+
   If ``APPENDIX`` is specified, rather than generating a top level package
   specification, the specified targets will be exported as an appendix to the
   named package.  Appendices may be used to separate less commonly used targets
@@ -979,7 +1079,7 @@
   artifacts produced by multiple build trees.
 
   Appendices are not permitted to change basic package metadata; therefore,
-  none of ``VERSION``, ``COMPAT_VERSION``, ``VERSION_SCHEMA``,
+  none of ``PROJECT``, ``VERSION``, ``COMPAT_VERSION``, ``VERSION_SCHEMA``,
   ``DEFAULT_TARGETS`` or ``DEFAULT_CONFIGURATIONS`` may be specified in
   combination with ``APPENDIX``.  Additionally, it is strongly recommended that
   use of ``LOWER_CASE_FILE`` should be consistent between the main package and
@@ -1180,3 +1280,6 @@
 
 .. _CPS: https://cps-org.github.io/cps/
 .. |CPS| replace:: Common Package Specification
+
+.. _cps-version_schema: https://cps-org.github.io/cps/schema.html#version-schema
+.. |cps-version_schema| replace:: ``version_schema``
diff --git a/Help/command/link_directories.rst b/Help/command/link_directories.rst
index 5e7fc39..a841f86 100644
--- a/Help/command/link_directories.rst
+++ b/Help/command/link_directories.rst
@@ -40,8 +40,8 @@
   generally be used directly in calls to :command:`target_link_libraries`.
   Situations where a library search path may be needed include:
 
-  - Project generators like Xcode where the user can switch target
-    architecture at build time, but a full path to a library cannot
+  - Project generators like :generator:`Xcode` where the user can switch
+    target architecture at build time, but a full path to a library cannot
     be used because it only provides one architecture (i.e. it is not
     a universal binary).
   - Libraries may themselves have other private library dependencies
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 0110021..abae8d2 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -246,6 +246,11 @@
                                       <replace_expression> ...)
         :target: TRANSFORM_REPLACE
 
+      .. versionchanged:: 4.1
+        The ``^`` anchor now matches only at the beginning of the input
+        element instead of the beginning of each repeated search.
+        See policy :policy:`CMP0186`.
+
   ``<SELECTOR>`` determines which elements of the list will be transformed.
   Only one type of selector can be specified at a time.
   When given, ``<SELECTOR>`` must be one of the following:
diff --git a/Help/command/option.rst b/Help/command/option.rst
index 464ad44..b939a2d 100644
--- a/Help/command/option.rst
+++ b/Help/command/option.rst
@@ -11,8 +11,11 @@
 If ``<variable>`` is already set as a normal or cache variable,
 then the command does nothing (see policy :policy:`CMP0077`).
 
-For options that depend on the values of other options, see
-the module help for :module:`CMakeDependentOption`.
-
 In CMake project mode, a boolean cache variable is created with the option
 value. In CMake script mode, a boolean variable is set with the option value.
+
+See Also
+^^^^^^^^
+
+* The :module:`CMakeDependentOption` module to specify boolean options that
+  depend on the values of other options or a set of conditions.
diff --git a/Help/command/project.rst b/Help/command/project.rst
index b42a034..bf0f171 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -11,6 +11,7 @@
  project(<PROJECT-NAME> [<language-name>...])
  project(<PROJECT-NAME>
          [VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]
+         [COMPAT_VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]
          [DESCRIPTION <project-description-string>]
          [HOMEPAGE_URL <url-string>]
          [LANGUAGES <language-name>...])
@@ -86,6 +87,25 @@
     ``CMakeLists.txt``, then the version is also stored in the variable
     :variable:`CMAKE_PROJECT_VERSION`.
 
+``COMPAT_VERSION <version>``
+  .. versionadded:: 4.1
+  .. note::
+
+    Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
+
+  Optional; requires ``VERSION`` also be set.
+
+  Takes a ``<version>`` argument composed of non-negative integer components,
+  i.e. ``<major>[.<minor>[.<patch>[.<tweak>]]]``,
+  and sets the variables
+
+  * :variable:`PROJECT_COMPAT_VERSION`,
+    :variable:`<PROJECT-NAME>_COMPAT_VERSION`
+
+    When the ``project()`` command is called from the top-level
+    ``CMakeLists.txt``, then the compatibility version is also stored in the
+    variable :variable:`CMAKE_PROJECT_COMPAT_VERSION`.
+
 ``DESCRIPTION <project-description-string>``
   .. versionadded:: 3.9
 
@@ -123,14 +143,18 @@
 
   Selects which programming languages are needed to build the project.
 
-.. include:: SUPPORTED_LANGUAGES.txt
+.. include:: include/SUPPORTED_LANGUAGES.rst
 
 By default ``C`` and ``CXX`` are enabled if no language options are given.
 Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages,
 to skip enabling any languages.
 
-The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL``
-options are intended for use as default values in package metadata and documentation.
+The variables set through the ``VERSION``, ``COMPAT_VERSION``, ``DESCRIPTION``
+and ``HOMEPAGE_URL`` options are intended for use as default values in package
+metadata and documentation. The :command:`export` and :command:`install`
+commands use these accordingly when generating |CPS| package descriptions.
+
+.. |CPS| replace:: Common Package Specification
 
 .. _`Code Injection`:
 
diff --git a/Help/command/qt_wrap_cpp.rst b/Help/command/qt_wrap_cpp.rst
index 02f7232..7e9d69a 100644
--- a/Help/command/qt_wrap_cpp.rst
+++ b/Help/command/qt_wrap_cpp.rst
@@ -8,7 +8,7 @@
   :module:`FindQt4` module provides the ``qt4_wrap_cpp()`` macro, which
   should be used instead for Qt 4 projects.  For projects using Qt 5 or
   later, use the equivalent macro provided by Qt itself (e.g. Qt 5 provides
-  `qt5_wrap_cpp() <https://doc.qt.io/qt-5/qtcore-cmake-qt5-wrap-cpp.html>`_).
+  `qt5_wrap_cpp() <https://doc.qt.io/archives/qt-5.15/qtcore-cmake-qt5-wrap-cpp.html>`_).
 
 Manually create Qt Wrappers.
 
diff --git a/Help/command/set.rst b/Help/command/set.rst
index fa635c6..6c1af47 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -38,7 +38,7 @@
   can be used as an alternate method to the :command:`set(PARENT_SCOPE)`
   and :command:`unset(PARENT_SCOPE)` commands to update the parent scope.
 
-.. include:: UNSET_NOTE.txt
+.. include:: include/UNSET_NOTE.rst
 
 Set Cache Entry
 ^^^^^^^^^^^^^^^
diff --git a/Help/command/string.rst b/Help/command/string.rst
index dc2d983..f540e1c 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -117,6 +117,17 @@
   two backslashes (``\\1``) are required in CMake code to get a backslash
   through argument parsing.
 
+.. versionchanged:: 4.1
+  The ``^`` anchor now matches only at the beginning of the input
+  string instead of the beginning of each repeated search.
+  See policy :policy:`CMP0186`.
+
+  Zero-length matches are allowed in ``MATCHALL`` and ``REPLACE``.
+  Previously, they triggered an error.
+
+  The replacement expression may contain references to subexpressions that
+  didn't match anything. Previously, such references triggered an error.
+
 .. _`Regex Specification`:
 
 Regex Specification
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index 5796b00..61cfb19 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -26,7 +26,7 @@
   Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
 
 .. |command_name| replace:: ``target_compile_definitions``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
 Any leading ``-D`` on an item will be removed.  Empty items are ignored.
 For example, the following are all equivalent:
diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst
index 531af81..2d569e9 100644
--- a/Help/command/target_compile_features.rst
+++ b/Help/command/target_compile_features.rst
@@ -33,8 +33,8 @@
 .. |command_name| replace:: ``target_compile_features``
 .. |more_see_also| replace:: See the :manual:`cmake-compile-features(7)`
    manual for information on compile features and a list of supported compilers.
-.. include:: GENEX_NOTE.txt
-   :start-line: 1
+.. include:: include/GENEX_NOTE.rst
+   :start-line: 2
 
 See Also
 ^^^^^^^^
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index 64f45aa..6fb86cd 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -39,9 +39,9 @@
   Allow setting ``INTERFACE`` items on :ref:`IMPORTED targets <Imported Targets>`.
 
 .. |command_name| replace:: ``target_compile_options``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
-.. include:: OPTIONS_SHELL.txt
+.. include:: include/OPTIONS_SHELL.rst
 
 See Also
 ^^^^^^^^
@@ -69,3 +69,6 @@
 * :variable:`CMAKE_<LANG>_FLAGS` and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>`
   add language-wide flags passed to all invocations of the compiler.
   This includes invocations that drive compiling and those that drive linking.
+
+* The :module:`CheckCompilerFlag` module to check whether the compiler
+  supports a given flag.
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index bb5f9c3..38bf581 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -41,7 +41,7 @@
 populated with the specified directories.
 
 .. |command_name| replace:: ``target_include_directories``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
 Specified include directories may be absolute paths or relative paths.
 A relative path will be interpreted as relative to the current source
@@ -71,7 +71,7 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
-.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
+.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.rst
 
 See Also
 ^^^^^^^^
diff --git a/Help/command/target_link_directories.rst b/Help/command/target_link_directories.rst
index 67d3352..af7a506 100644
--- a/Help/command/target_link_directories.rst
+++ b/Help/command/target_link_directories.rst
@@ -35,7 +35,7 @@
 property instead of being appended.
 
 .. |command_name| replace:: ``target_link_directories``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
 .. note::
 
@@ -46,8 +46,8 @@
   generally be used directly in calls to :command:`target_link_libraries`.
   Situations where a library search path may be needed include:
 
-  - Project generators like Xcode where the user can switch target
-    architecture at build time, but a full path to a library cannot
+  - Project generators like :generator:`Xcode` where the user can switch
+    target architecture at build time, but a full path to a library cannot
     be used because it only provides one architecture (i.e. it is not
     a universal binary).
   - Libraries may themselves have other private library dependencies
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index ab01307..a8ba92c 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -127,11 +127,15 @@
   in the :prop_gbl:`DEBUG_CONFIGURATIONS` global property if it is set).
   The ``optimized`` keyword corresponds to all other configurations.  The
   ``general`` keyword corresponds to all configurations, and is purely
-  optional.  Higher granularity may be achieved for per-configuration
-  rules by creating and linking to
-  :ref:`IMPORTED library targets <Imported Targets>`.
-  These keywords are interpreted immediately by this command and therefore
-  have no special meaning when produced by a generator expression.
+  optional.  These keywords are interpreted immediately by this command and
+  therefore have no special meaning when produced by a generator expression.
+
+  Alternatively, generator expressions like :genex:`$<CONFIG>` provide finer
+  per-configuration linking of ``<item>``.  For a more structured approach,
+  higher granularity can be achieved by creating and linking to
+  :ref:`IMPORTED library targets <Imported Targets>` with the
+  :prop_tgt:`IMPORTED_CONFIGURATIONS` property set, particularly in find
+  modules.
 
 Items containing ``::``, such as ``Foo::Bar``, are assumed to be
 :ref:`IMPORTED <Imported Targets>` or :ref:`ALIAS <Alias Targets>` library
@@ -146,7 +150,7 @@
 See the :manual:`cmake-buildsystem(7)` manual for more on defining
 buildsystem properties.
 
-.. include:: ../command/LINK_LIBRARIES_LINKER.txt
+.. include:: ../command/include/LINK_LIBRARIES_LINKER.rst
 
 Libraries for a Target and/or its Dependents
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -412,7 +416,7 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:`INTERFACE_LINK_LIBRARIES`
-.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
+.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.rst
 
 See Also
 ^^^^^^^^
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index 7561c99..cbbd720 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -43,13 +43,13 @@
   :ref:`IMPORTED targets <Imported Targets>` only support ``INTERFACE`` items.
 
 .. |command_name| replace:: ``target_link_options``
-.. include:: GENEX_NOTE.txt
+.. include:: include/GENEX_NOTE.rst
 
-.. include:: DEVICE_LINK_OPTIONS.txt
+.. include:: include/DEVICE_LINK_OPTIONS.rst
 
-.. include:: OPTIONS_SHELL.txt
+.. include:: include/OPTIONS_SHELL.rst
 
-.. include:: LINK_OPTIONS_LINKER.txt
+.. include:: include/LINK_OPTIONS_LINKER.rst
 
 See Also
 ^^^^^^^^
@@ -66,3 +66,6 @@
 * :variable:`CMAKE_<LANG>_FLAGS` and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>`
   add language-wide flags passed to all invocations of the compiler.
   This includes invocations that drive compiling and those that drive linking.
+
+* The :module:`CheckLinkerFlag` module to check whether a linker flag is
+  supported by the compiler.
diff --git a/Help/command/target_precompile_headers.rst b/Help/command/target_precompile_headers.rst
index 61ea0aa..acd83a8 100644
--- a/Help/command/target_precompile_headers.rst
+++ b/Help/command/target_precompile_headers.rst
@@ -71,15 +71,16 @@
   )
 
 .. |command_name| replace:: ``target_precompile_headers``
-.. |more_see_also| replace:: The :genex:`$<COMPILE_LANGUAGE:...>` generator
+.. |more_see_also| replace:: The :genex:`$<COMPILE_LANGUAGE:...>
+   <COMPILE_LANGUAGE:languages>` generator
    expression is particularly useful for specifying a language-specific header
    to precompile for only one language (e.g. ``CXX`` and not ``C``).  In this
    case, header file names that are not explicitly in double quotes or angle
    brackets must be specified by absolute path.  Also, when specifying angle
    brackets inside a generator expression, be sure to encode the closing
    ``>`` as :genex:`$<ANGLE-R>`.  For example:
-.. include:: GENEX_NOTE.txt
-   :start-line: 1
+.. include:: include/GENEX_NOTE.rst
+   :start-line: 2
 
 .. code-block:: cmake
 
diff --git a/Help/command/unset.rst b/Help/command/unset.rst
index 522be89..f78d01f 100644
--- a/Help/command/unset.rst
+++ b/Help/command/unset.rst
@@ -18,7 +18,7 @@
 above the current scope.  See the same option in the :command:`set` command
 for further details.
 
-.. include:: UNSET_NOTE.txt
+.. include:: include/UNSET_NOTE.rst
 
 Unset Environment Variable
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/cpack_gen/nuget.rst b/Help/cpack_gen/nuget.rst
index d97f0c0..7192209 100644
--- a/Help/cpack_gen/nuget.rst
+++ b/Help/cpack_gen/nuget.rst
@@ -41,6 +41,14 @@
  :Mandatory: No
  :Default: ``OFF``
 
+.. variable:: CPACK_NUGET_SYMBOL_PACKAGE
+
+ .. versionadded:: 4.1
+
+ Generate a Nuget symbol package (.snupkg).
+
+ :Mandatory: No
+ :Default: ``OFF``
 
 Required metadata variables
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 0fd6964..3583765 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -439,6 +439,51 @@
  variable. Note that you must enclose the entire value between quotes when
  setting this variable.
 
+.. variable:: CPACK_RPM_PACKAGE_RECOMMENDS
+              CPACK_RPM_<component>_PACKAGE_RECOMMENDS
+
+ .. versionadded:: 4.1
+
+ RPM spec recommends field.
+
+ :Mandatory: No
+ :Default:
+
+ May be used to set weak RPM dependencies (recommends). If ``rpmbuild`` doesn't
+ support the ``Recommends`` tag, CPack will emit a warning and ignore this
+ variable. Note that you must enclose the entire value between quotes when
+ setting this variable.
+
+.. variable:: CPACK_RPM_PACKAGE_SUPPLEMENTS
+              CPACK_RPM_<component>_PACKAGE_SUPPLEMENTS
+
+ .. versionadded:: 4.1
+
+ RPM spec supplements field.
+
+ :Mandatory: No
+ :Default:
+
+ May be used to set weak RPM dependencies (supplements). If ``rpmbuild`` doesn't
+ support the ``Supplements`` tag, CPack will emit a warning and ignore this
+ variable. Note that you must enclose the entire value between quotes when
+ setting this variable.
+
+.. variable:: CPACK_RPM_PACKAGE_ENHANCES
+              CPACK_RPM_<component>_PACKAGE_ENHANCES
+
+ .. versionadded:: 4.1
+
+ RPM spec enhances field.
+
+ :Mandatory: No
+ :Default:
+
+ May be used to set weak RPM dependencies (enhances). If ``rpmbuild`` doesn't
+ support the ``Enhances`` tag, CPack will emit a warning and ignore this
+ variable. Note that you must enclose the entire value between quotes when
+ setting this variable.
+
 .. variable:: CPACK_RPM_PACKAGE_PROVIDES
               CPACK_RPM_<component>_PACKAGE_PROVIDES
 
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
index ada6ab4..500cf05 100644
--- a/Help/dev/documentation.rst
+++ b/Help/dev/documentation.rst
@@ -16,6 +16,14 @@
 .. _`reStructuredText`: https://docutils.sourceforge.net/docs/ref/rst/introduction.html
 .. _`Sphinx`: https://sphinx-doc.org
 
+To generate the HTML and/or man documentation locally from within the CMake
+repository to ``build/html`` and ``build/man`` directories:
+
+.. code-block:: console
+
+  $ cmake -S Utilities/Sphinx -B build -DSPHINX_HTML=ON -DSPHINX_MAN=ON
+  $ cmake --build build
+
 Markup Constructs
 -----------------
 
diff --git a/Help/dev/experimental.rst b/Help/dev/experimental.rst
index 0b19422..81ddc8c 100644
--- a/Help/dev/experimental.rst
+++ b/Help/dev/experimental.rst
@@ -105,7 +105,7 @@
 In order to activate support for exporting build databases, set
 
 * variable ``CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE`` to
-* value ``4bd552e2-b7fb-429a-ab23-c83ef53f3f13``.
+* value ``73194a1d-c0b5-41b9-9190-a4512925e192``.
 
 This UUID may change in future versions of CMake.  Be sure to use the value
 documented here by the source tree of the version of CMake with which you are
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
index 2f4babc..24ddb9a 100644
--- a/Help/dev/maint.rst
+++ b/Help/dev/maint.rst
@@ -78,7 +78,7 @@
 .. code-block:: shell
 
   git fetch origin
-  git checkout -b release-$ver origin/release
+  git switch -c release-$ver origin/release
 
 Merge the ``$topic`` branch into the local ``release-$ver`` branch, making
 sure to include a ``Merge-request: !xxxx`` footer in the commit message:
@@ -91,7 +91,7 @@
 
 .. code-block:: shell
 
-  git checkout master
+  git switch master
   git pull
   git merge --no-ff release-$ver
 
@@ -180,7 +180,7 @@
 
 .. code-block:: shell
 
-  git checkout -b doc-$ver-relnotes
+  git switch -c doc-$ver-relnotes
 
 Run the `consolidate-relnotes.bash`_ script:
 
@@ -236,7 +236,7 @@
 
 .. code-block:: shell
 
-  git checkout -b release-$ver origin/master
+  git switch -c release-$ver origin/master
 
 Remove the development branch release note infrastructure:
 
@@ -278,7 +278,7 @@
 
 .. code-block:: shell
 
-  git checkout master
+  git switch master
   git pull
   git merge --no-ff release-$ver
 
@@ -287,7 +287,7 @@
 
 .. code-block:: shell
 
-  git checkout origin/master -- \
+  git restore -s origin/master -- \
     Source/CMakeVersion.cmake Help/release/dev/0-sample-topic.rst
   sed -i $'/^Releases/ i\\\n.. include:: dev.txt\\\n' Help/release/index.rst
 
diff --git a/Help/dev/testing.rst b/Help/dev/testing.rst
index f90cef7..d5303e2 100644
--- a/Help/dev/testing.rst
+++ b/Help/dev/testing.rst
@@ -26,9 +26,9 @@
     $ ctest
 
 * With a multi-configuration CMake generator, such as
-  ``Ninja Multi-Config``, ``Visual Studio``, or ``Xcode``,
-  one must tell ``ctest`` which configuration to test
-  by passing the ``-C <config>`` option:
+  :generator:`Ninja Multi-Config`, :generator:`Visual Studio <Visual Studio
+  Generators>`, or :generator:`Xcode`, one must tell ``ctest`` which
+  configuration to test by passing the ``-C <config>`` option:
 
   .. code-block:: console
 
diff --git a/Help/envvar/ADSP_ROOT.rst b/Help/envvar/ADSP_ROOT.rst
index ee2328b..f624ac4 100644
--- a/Help/envvar/ADSP_ROOT.rst
+++ b/Help/envvar/ADSP_ROOT.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.24
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``ADSP_ROOT`` environment variable specifies a default value
 for the :variable:`CMAKE_ADSP_ROOT` variable when there is no explicit
diff --git a/Help/envvar/ASM_DIALECT.rst b/Help/envvar/ASM_DIALECT.rst
index 11dbe5a..4c271fd 100644
--- a/Help/envvar/ASM_DIALECT.rst
+++ b/Help/envvar/ASM_DIALECT.rst
@@ -1,7 +1,7 @@
 ASM<DIALECT>
 ------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling a specific dialect of assembly language
 files. ``ASM<DIALECT>`` can be one of:
diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst
index f13efbb..e2b48a1 100644
--- a/Help/envvar/ASM_DIALECTFLAGS.rst
+++ b/Help/envvar/ASM_DIALECTFLAGS.rst
@@ -1,7 +1,7 @@
 ASM<DIALECT>FLAGS
 -----------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling a specific dialect
 of an assembly language.  ``ASM<DIALECT>FLAGS`` can be one of:
@@ -14,6 +14,6 @@
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_ASM<DIALECT>_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``ASM<DIALECT>``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_ASM<DIALECT>_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CC.rst b/Help/envvar/CC.rst
index 1bb8d51..31867e4 100644
--- a/Help/envvar/CC.rst
+++ b/Help/envvar/CC.rst
@@ -1,7 +1,7 @@
 CC
 --
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``C`` language files. Will only be used by
 CMake on the first configuration to determine ``C`` compiler, after which the
diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst
index a6b2452..987ff3b 100644
--- a/Help/envvar/CFLAGS.rst
+++ b/Help/envvar/CFLAGS.rst
@@ -1,12 +1,12 @@
 CFLAGS
 ------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``C`` files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_C_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``C``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_C_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CLICOLOR.rst b/Help/envvar/CLICOLOR.rst
index 404e79e..b976a25 100644
--- a/Help/envvar/CLICOLOR.rst
+++ b/Help/envvar/CLICOLOR.rst
@@ -3,17 +3,17 @@
 
 .. versionadded:: 3.21
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Set to ``0`` to tell command-line tools not to print color
 messages even if connected to a terminal.
 This is a `common convention`_ among command-line tools in general.
 
-See also the :envvar:`CLICOLOR_FORCE` environment variable.
-:envvar:`CLICOLOR_FORCE`, if activated, takes precedence over
+See also the :envvar:`NO_COLOR` and :envvar:`CLICOLOR_FORCE` environment
+variables.  If either of them is activated, it takes precedence over
 :envvar:`!CLICOLOR`.
 
 See the :variable:`CMAKE_COLOR_DIAGNOSTICS` variable to control
 color in a generated build system.
 
-.. _`common convention`: https://web.archive.org/web/20230417221418/https://bixense.com/clicolors/
+.. _`common convention`: https://web.archive.org/web/20250410160803/https://bixense.com/clicolors/
diff --git a/Help/envvar/CLICOLOR_FORCE.rst b/Help/envvar/CLICOLOR_FORCE.rst
index 639ed85..80a66e3 100644
--- a/Help/envvar/CLICOLOR_FORCE.rst
+++ b/Help/envvar/CLICOLOR_FORCE.rst
@@ -3,17 +3,18 @@
 
 .. versionadded:: 3.5
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Set to a non-empty value, other than ``0``, to tell command-line
 tools to print color messages even if not connected to a terminal.
 This is a `common convention`_ among command-line tools in general.
 
-See also the :envvar:`CLICOLOR` environment variable.
-:envvar:`!CLICOLOR_FORCE`, if activated, takes precedence over
-:envvar:`CLICOLOR`.
+See also the :envvar:`NO_COLOR` and :envvar:`CLICOLOR` environment variables.
+If :envvar:`NO_COLOR` is activated, it takes precedence over
+:envvar:`!CLICOLOR_FORCE`.  Otherwise, if :envvar:`!CLICOLOR_FORCE` is
+activated, it takes precedence over :envvar:`CLICOLOR`.
 
 See the :variable:`CMAKE_COLOR_DIAGNOSTICS` variable to control
 color in a generated build system.
 
-.. _`common convention`: https://web.archive.org/web/20230417221418/https://bixense.com/clicolors/
+.. _`common convention`: https://web.archive.org/web/20250410160803/https://bixense.com/clicolors/
diff --git a/Help/envvar/CMAKE_APPBUNDLE_PATH.rst b/Help/envvar/CMAKE_APPBUNDLE_PATH.rst
index d80e08d..7b5f761 100644
--- a/Help/envvar/CMAKE_APPBUNDLE_PATH.rst
+++ b/Help/envvar/CMAKE_APPBUNDLE_PATH.rst
@@ -1,7 +1,7 @@
 CMAKE_APPBUNDLE_PATH
 --------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_APPBUNDLE_PATH`` environment variable may be set to a list of
 directories to be searched for macOS application bundles
diff --git a/Help/envvar/CMAKE_APPLE_SILICON_PROCESSOR.rst b/Help/envvar/CMAKE_APPLE_SILICON_PROCESSOR.rst
index adecb72..31558ea 100644
--- a/Help/envvar/CMAKE_APPLE_SILICON_PROCESSOR.rst
+++ b/Help/envvar/CMAKE_APPLE_SILICON_PROCESSOR.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.19.2
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 On Apple Silicon hosts running macOS, set this environment variable to tell
 CMake what architecture to use for :variable:`CMAKE_HOST_SYSTEM_PROCESSOR`.
diff --git a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
index a50797c..0030469 100644
--- a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.12
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specifies the maximum number of concurrent processes to use when building
 using the ``cmake --build`` command line
diff --git a/Help/envvar/CMAKE_BUILD_TYPE.rst b/Help/envvar/CMAKE_BUILD_TYPE.rst
index f798aff..b2627f7 100644
--- a/Help/envvar/CMAKE_BUILD_TYPE.rst
+++ b/Help/envvar/CMAKE_BUILD_TYPE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.22
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_BUILD_TYPE`` environment variable specifies a default value
 for the :variable:`CMAKE_BUILD_TYPE` variable when there is no explicit
diff --git a/Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst b/Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst
index d3d0aa9..2f34e00 100644
--- a/Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst
+++ b/Help/envvar/CMAKE_COLOR_DIAGNOSTICS.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.24
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specifies a default value for the :variable:`CMAKE_COLOR_DIAGNOSTICS` variable
 when there is no explicit value given on the first run.
diff --git a/Help/envvar/CMAKE_CONFIGURATION_TYPES.rst b/Help/envvar/CMAKE_CONFIGURATION_TYPES.rst
index 833aa4a..39d98c4 100644
--- a/Help/envvar/CMAKE_CONFIGURATION_TYPES.rst
+++ b/Help/envvar/CMAKE_CONFIGURATION_TYPES.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.22
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_CONFIGURATION_TYPES`` environment variable specifies a
 default value for the :variable:`CMAKE_CONFIGURATION_TYPES` variable
diff --git a/Help/envvar/CMAKE_CONFIG_DIR.rst b/Help/envvar/CMAKE_CONFIG_DIR.rst
index 1b5f14f..8f93a56 100644
--- a/Help/envvar/CMAKE_CONFIG_DIR.rst
+++ b/Help/envvar/CMAKE_CONFIG_DIR.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.31
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specify a CMake user-wide configuration directory for
 :manual:`cmake-file-api(7)` queries.
diff --git a/Help/envvar/CMAKE_CONFIG_TYPE.rst b/Help/envvar/CMAKE_CONFIG_TYPE.rst
index 168593d..d1d2301 100644
--- a/Help/envvar/CMAKE_CONFIG_TYPE.rst
+++ b/Help/envvar/CMAKE_CONFIG_TYPE.rst
@@ -1,7 +1,7 @@
 CMAKE_CONFIG_TYPE
 -----------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The default build configuration for :ref:`Build Tool Mode` and
 ``ctest`` build handler when there is no explicit configuration given.
diff --git a/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst
index 3e397d8..40d6c84 100644
--- a/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst
+++ b/Help/envvar/CMAKE_CROSSCOMPILING_EMULATOR.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.28
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The default value for :variable:`CMAKE_CROSSCOMPILING_EMULATOR` when there
 is no explicit configuration given on the first run while creating a new
diff --git a/Help/envvar/CMAKE_EXPORT_BUILD_DATABASE.rst b/Help/envvar/CMAKE_EXPORT_BUILD_DATABASE.rst
index a9d868a..368617d 100644
--- a/Help/envvar/CMAKE_EXPORT_BUILD_DATABASE.rst
+++ b/Help/envvar/CMAKE_EXPORT_BUILD_DATABASE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.31
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The default value for :variable:`CMAKE_EXPORT_BUILD_DATABASE` when there is no
 explicit configuration given on the first run while creating a new build tree.
diff --git a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
index 9e678be..50800aa 100644
--- a/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
+++ b/Help/envvar/CMAKE_EXPORT_COMPILE_COMMANDS.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.17
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The default value for :variable:`CMAKE_EXPORT_COMPILE_COMMANDS` when there
 is no explicit configuration given on the first run while creating a new
diff --git a/Help/envvar/CMAKE_FRAMEWORK_PATH.rst b/Help/envvar/CMAKE_FRAMEWORK_PATH.rst
index f543132..e8a360d 100644
--- a/Help/envvar/CMAKE_FRAMEWORK_PATH.rst
+++ b/Help/envvar/CMAKE_FRAMEWORK_PATH.rst
@@ -1,7 +1,7 @@
 CMAKE_FRAMEWORK_PATH
 --------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_FRAMEWORK_PATH`` environment variable may be set to a list of
 directories to be searched for macOS frameworks by the :command:`find_library`,
diff --git a/Help/envvar/CMAKE_GENERATOR.rst b/Help/envvar/CMAKE_GENERATOR.rst
index 596e8f3..284b15c 100644
--- a/Help/envvar/CMAKE_GENERATOR.rst
+++ b/Help/envvar/CMAKE_GENERATOR.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.15
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specifies the CMake default generator to use when no generator is supplied
 with :option:`-G <cmake -G>`. If the provided value doesn't name a generator
diff --git a/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst b/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst
index 8ca7d80..a3efbbd 100644
--- a/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst
+++ b/Help/envvar/CMAKE_GENERATOR_INSTANCE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.15
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Default value for :variable:`CMAKE_GENERATOR_INSTANCE` if no Cache entry is
 present. This value is only applied if :envvar:`CMAKE_GENERATOR` is set.
diff --git a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
index e657904..0c0d9aa 100644
--- a/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
+++ b/Help/envvar/CMAKE_GENERATOR_PLATFORM.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.15
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Default value for :variable:`CMAKE_GENERATOR_PLATFORM` if no Cache entry
 is present and no value is specified by :option:`cmake -A` option.
diff --git a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
index 03208e7..f90b62d 100644
--- a/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/envvar/CMAKE_GENERATOR_TOOLSET.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.15
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Default value for :variable:`CMAKE_GENERATOR_TOOLSET` if no Cache entry
 is present and no value is specified by :option:`cmake -T` option.
diff --git a/Help/envvar/CMAKE_INCLUDE_PATH.rst b/Help/envvar/CMAKE_INCLUDE_PATH.rst
index a42460d..d4093dc 100644
--- a/Help/envvar/CMAKE_INCLUDE_PATH.rst
+++ b/Help/envvar/CMAKE_INCLUDE_PATH.rst
@@ -1,7 +1,7 @@
 CMAKE_INCLUDE_PATH
 ------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_INCLUDE_PATH`` environment variable may be set to a list of
 directories to be searched by the :command:`find_file` and :command:`find_path` commands.
diff --git a/Help/envvar/CMAKE_INSTALL_MODE.rst b/Help/envvar/CMAKE_INSTALL_MODE.rst
index 4549ea1..eab90a1 100644
--- a/Help/envvar/CMAKE_INSTALL_MODE.rst
+++ b/Help/envvar/CMAKE_INSTALL_MODE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.22
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_INSTALL_MODE`` environment variable allows users to operate
 CMake in an alternate mode of :command:`file(INSTALL)` and :command:`install()`.
diff --git a/Help/envvar/CMAKE_INSTALL_PARALLEL_LEVEL.rst b/Help/envvar/CMAKE_INSTALL_PARALLEL_LEVEL.rst
index 84b5930..6af6732 100644
--- a/Help/envvar/CMAKE_INSTALL_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CMAKE_INSTALL_PARALLEL_LEVEL.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.31
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specifies the default maximum number of concurrent processes to use when
 installing using ``cmake --install``.
diff --git a/Help/envvar/CMAKE_INSTALL_PREFIX.rst b/Help/envvar/CMAKE_INSTALL_PREFIX.rst
index 5c3e055..a80b537 100644
--- a/Help/envvar/CMAKE_INSTALL_PREFIX.rst
+++ b/Help/envvar/CMAKE_INSTALL_PREFIX.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.29
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_INSTALL_PREFIX`` environment variable specifies a custom default
 value for the :variable:`CMAKE_INSTALL_PREFIX` variable in place of the
diff --git a/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
index c384fa1..d70bed0 100644
--- a/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
+++ b/Help/envvar/CMAKE_LANG_COMPILER_LAUNCHER.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.17
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Default compiler launcher to use for the specified language. Will only be used
 by CMake to initialize the variable on the first configuration. Afterwards, it
diff --git a/Help/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE.rst b/Help/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE.rst
index 36c79fa..93c2dbc 100644
--- a/Help/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE.rst
+++ b/Help/envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.27
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 A :ref:`semicolon-separated list <CMake Language Lists>` of directories
 to exclude from the :variable:`CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES`
@@ -11,3 +11,6 @@
 
 This may be used to work around misconfigured compiler drivers that pass
 extraneous implicit link directories to their linker.
+
+See also the :envvar:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES_EXCLUDE`
+environment variable.
diff --git a/Help/envvar/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES_EXCLUDE.rst b/Help/envvar/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES_EXCLUDE.rst
new file mode 100644
index 0000000..ef812d4
--- /dev/null
+++ b/Help/envvar/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES_EXCLUDE.rst
@@ -0,0 +1,17 @@
+CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES_EXCLUDE
+--------------------------------------------
+
+.. versionadded:: 4.1
+
+.. include:: include/ENV_VAR.rst
+
+A :ref:`semicolon-separated list <CMake Language Lists>` of libraries
+to exclude from the :variable:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES`
+variable when it is automatically detected from the ``<LANG>`` compiler.
+
+This may be used to work around detection limitations that result in
+extraneous implicit link libraries, e.g., when using compiler driver
+flags that affect the set of implicitly linked libraries.
+
+See also the :envvar:`CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES_EXCLUDE`
+environment variable.
diff --git a/Help/envvar/CMAKE_LANG_LINKER_LAUNCHER.rst b/Help/envvar/CMAKE_LANG_LINKER_LAUNCHER.rst
index 6251d9c..206caec 100644
--- a/Help/envvar/CMAKE_LANG_LINKER_LAUNCHER.rst
+++ b/Help/envvar/CMAKE_LANG_LINKER_LAUNCHER.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.21
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Default launcher to use when linking a target of the specified language. Will
 only be used by CMake to initialize the variable on the first configuration.
diff --git a/Help/envvar/CMAKE_LIBRARY_PATH.rst b/Help/envvar/CMAKE_LIBRARY_PATH.rst
index a51100d..0b5a997 100644
--- a/Help/envvar/CMAKE_LIBRARY_PATH.rst
+++ b/Help/envvar/CMAKE_LIBRARY_PATH.rst
@@ -1,7 +1,7 @@
 CMAKE_LIBRARY_PATH
 ------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_LIBRARY_PATH`` environment variable may be set to a list of
 directories to be searched by the :command:`find_library` command.
diff --git a/Help/envvar/CMAKE_MAXIMUM_RECURSION_DEPTH.rst b/Help/envvar/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
index 2d65b60..4a6cced 100644
--- a/Help/envvar/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
+++ b/Help/envvar/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.27
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Maximum recursion depth for CMake scripts.  This environment variable is
 used if the :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH` variable is not set.
diff --git a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
index bb04b30..3efb05f 100644
--- a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
+++ b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
@@ -1,7 +1,7 @@
 CMAKE_MSVCIDE_RUN_PATH
 ----------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Extra PATH locations for custom commands when using
 :ref:`Visual Studio Generators`.
diff --git a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
index ef7d547..141e594 100644
--- a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
+++ b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
@@ -1,7 +1,7 @@
 CMAKE_OSX_ARCHITECTURES
 -----------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Target specific architectures for macOS.
 
diff --git a/Help/envvar/CMAKE_POLICY_VERSION_MINIMUM.rst b/Help/envvar/CMAKE_POLICY_VERSION_MINIMUM.rst
index 0521f5c..dd881a6 100644
--- a/Help/envvar/CMAKE_POLICY_VERSION_MINIMUM.rst
+++ b/Help/envvar/CMAKE_POLICY_VERSION_MINIMUM.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 4.0
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The default value for :variable:`CMAKE_POLICY_VERSION_MINIMUM` when there
 is no explicit configuration given on the first run while creating a new
diff --git a/Help/envvar/CMAKE_PREFIX_PATH.rst b/Help/envvar/CMAKE_PREFIX_PATH.rst
index 276fdd6..f096cca 100644
--- a/Help/envvar/CMAKE_PREFIX_PATH.rst
+++ b/Help/envvar/CMAKE_PREFIX_PATH.rst
@@ -1,7 +1,7 @@
 CMAKE_PREFIX_PATH
 -----------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_PREFIX_PATH`` environment variable may be set to a list of
 directories specifying installation *prefixes* to be searched by the
diff --git a/Help/envvar/CMAKE_PROGRAM_PATH.rst b/Help/envvar/CMAKE_PROGRAM_PATH.rst
index bfc7a30..6d86548 100644
--- a/Help/envvar/CMAKE_PROGRAM_PATH.rst
+++ b/Help/envvar/CMAKE_PROGRAM_PATH.rst
@@ -1,7 +1,7 @@
 CMAKE_PROGRAM_PATH
 ------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_PROGRAM_PATH`` environment variable may be set to a list of
 directories to be searched by the :command:`find_program` command.
diff --git a/Help/envvar/CMAKE_TEST_LAUNCHER.rst b/Help/envvar/CMAKE_TEST_LAUNCHER.rst
index d620ce5..40a93e2 100644
--- a/Help/envvar/CMAKE_TEST_LAUNCHER.rst
+++ b/Help/envvar/CMAKE_TEST_LAUNCHER.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.29
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The default value for the :variable:`CMAKE_TEST_LAUNCHER` variable when there
 is no explicit configuration given on the first run while creating a new
diff --git a/Help/envvar/CMAKE_TLS_VERIFY.rst b/Help/envvar/CMAKE_TLS_VERIFY.rst
index 9571cb8..84471a4 100644
--- a/Help/envvar/CMAKE_TLS_VERIFY.rst
+++ b/Help/envvar/CMAKE_TLS_VERIFY.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.30
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specify the default value for the :command:`file(DOWNLOAD)` and
 :command:`file(UPLOAD)` commands' ``TLS_VERIFY`` option.
diff --git a/Help/envvar/CMAKE_TLS_VERSION.rst b/Help/envvar/CMAKE_TLS_VERSION.rst
index c411861..a9589f3 100644
--- a/Help/envvar/CMAKE_TLS_VERSION.rst
+++ b/Help/envvar/CMAKE_TLS_VERSION.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.30
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specify the default value for the :command:`file(DOWNLOAD)` and
 :command:`file(UPLOAD)` commands' ``TLS_VERSION`` option.
diff --git a/Help/envvar/CMAKE_TOOLCHAIN_FILE.rst b/Help/envvar/CMAKE_TOOLCHAIN_FILE.rst
index 7ea9cea..1b1c57c 100644
--- a/Help/envvar/CMAKE_TOOLCHAIN_FILE.rst
+++ b/Help/envvar/CMAKE_TOOLCHAIN_FILE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.21
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 The ``CMAKE_TOOLCHAIN_FILE`` environment variable specifies a default value
 for the :variable:`CMAKE_TOOLCHAIN_FILE` variable when there is no explicit
diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst
index 6e909fe..1a7c4c9 100644
--- a/Help/envvar/CSFLAGS.rst
+++ b/Help/envvar/CSFLAGS.rst
@@ -3,12 +3,12 @@
 
 .. versionadded:: 3.9.2
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``CSharp`` files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CSharp_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``CSharp``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_CSharp_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
index e1991b2..6d893f9 100644
--- a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
+++ b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
@@ -1,7 +1,7 @@
 CTEST_INTERACTIVE_DEBUG_MODE
 ----------------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Environment variable that will exist and be set to ``1`` when a test executed
 by :manual:`ctest(1)` is run in interactive mode.
diff --git a/Help/envvar/CTEST_NO_TESTS_ACTION.rst b/Help/envvar/CTEST_NO_TESTS_ACTION.rst
index 2bc86dc..c5f74a7 100644
--- a/Help/envvar/CTEST_NO_TESTS_ACTION.rst
+++ b/Help/envvar/CTEST_NO_TESTS_ACTION.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.26
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Environment variable that controls how :manual:`ctest <ctest(1)>` handles
 cases when there are no tests to run. Possible values are: ``error``,
diff --git a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
index d8b4262..7ec642c 100644
--- a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
+++ b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
@@ -1,7 +1,7 @@
 CTEST_OUTPUT_ON_FAILURE
 -----------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Boolean environment variable that controls if the output should be logged for
 failed tests. Set the value to ``1``, ``True``, or ``ON`` to enable output on failure.
diff --git a/Help/envvar/CTEST_PARALLEL_LEVEL.rst b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
index 0ef01d5..798c79b 100644
--- a/Help/envvar/CTEST_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
@@ -1,7 +1,7 @@
 CTEST_PARALLEL_LEVEL
 --------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specify the number of tests for CTest to run in parallel.
 For example, if ``CTEST_PARALLEL_LEVEL`` is set to 8, CTest will run
diff --git a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
index 348acc6..2e87acb 100644
--- a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
+++ b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.13
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Boolean environment variable that affects how :manual:`ctest <ctest(1)>`
 command output reports overall progress.  When set to ``1``, ``TRUE``, ``ON`` or anything
diff --git a/Help/envvar/CTEST_USE_INSTRUMENTATION.rst b/Help/envvar/CTEST_USE_INSTRUMENTATION.rst
index c6c7f70..6e33845 100644
--- a/Help/envvar/CTEST_USE_INSTRUMENTATION.rst
+++ b/Help/envvar/CTEST_USE_INSTRUMENTATION.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 4.0
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 .. note::
 
diff --git a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
index 79dbb79..c58128e 100644
--- a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
+++ b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
@@ -1,6 +1,6 @@
 CTEST_USE_LAUNCHERS_DEFAULT
 ---------------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Initializes the :variable:`CTEST_USE_LAUNCHERS` variable if not already defined.
diff --git a/Help/envvar/CTEST_USE_VERBOSE_INSTRUMENTATION.rst b/Help/envvar/CTEST_USE_VERBOSE_INSTRUMENTATION.rst
index d7f7477..95053e4 100644
--- a/Help/envvar/CTEST_USE_VERBOSE_INSTRUMENTATION.rst
+++ b/Help/envvar/CTEST_USE_VERBOSE_INSTRUMENTATION.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 4.0
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 .. note::
 
diff --git a/Help/envvar/CUDAARCHS.rst b/Help/envvar/CUDAARCHS.rst
index e9e6a42..e68d19f 100644
--- a/Help/envvar/CUDAARCHS.rst
+++ b/Help/envvar/CUDAARCHS.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.20
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Value used to initialize :variable:`CMAKE_CUDA_ARCHITECTURES` on the first
 configuration. Subsequent runs will use the value stored in the cache.
diff --git a/Help/envvar/CUDACXX.rst b/Help/envvar/CUDACXX.rst
index 1722128..08c1414 100644
--- a/Help/envvar/CUDACXX.rst
+++ b/Help/envvar/CUDACXX.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.8
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``CUDA`` language files. Will only be used by
 CMake on the first configuration to determine ``CUDA`` compiler, after which the
diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst
index 46a91df..66b84f3 100644
--- a/Help/envvar/CUDAFLAGS.rst
+++ b/Help/envvar/CUDAFLAGS.rst
@@ -3,12 +3,12 @@
 
 .. versionadded:: 3.8
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``CUDA`` files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CUDA_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``CUDA``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_CUDA_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/CUDAHOSTCXX.rst b/Help/envvar/CUDAHOSTCXX.rst
index 4e78afa..1836301 100644
--- a/Help/envvar/CUDAHOSTCXX.rst
+++ b/Help/envvar/CUDAHOSTCXX.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.8
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling host code when compiling ``CUDA``
 language files. Will only be used by CMake on the first configuration to
diff --git a/Help/envvar/CXX.rst b/Help/envvar/CXX.rst
index 61ba5b8..5b7b4ab 100644
--- a/Help/envvar/CXX.rst
+++ b/Help/envvar/CXX.rst
@@ -1,7 +1,7 @@
 CXX
 ---
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``CXX`` language files. Will only be used by
 CMake on the first configuration to determine ``CXX`` compiler, after which the
diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst
index f67431f..25b2613 100644
--- a/Help/envvar/CXXFLAGS.rst
+++ b/Help/envvar/CXXFLAGS.rst
@@ -1,12 +1,12 @@
 CXXFLAGS
 --------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``CXX`` (C++) files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``CXX``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_CXX_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
index 6a52d64..e25a31d 100644
--- a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
+++ b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
@@ -1,7 +1,7 @@
 DASHBOARD_TEST_FROM_CTEST
 -------------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Environment variable that will exist when a test executed by :manual:`ctest(1)`
 is run in non-interactive mode.  The value will be equal to
diff --git a/Help/envvar/DESTDIR.rst b/Help/envvar/DESTDIR.rst
index dec8430..dd18535 100644
--- a/Help/envvar/DESTDIR.rst
+++ b/Help/envvar/DESTDIR.rst
@@ -1,7 +1,7 @@
 DESTDIR
 -------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
 whole installation.  ``DESTDIR`` means DESTination DIRectory.  It is
diff --git a/Help/envvar/FC.rst b/Help/envvar/FC.rst
index 70e1475..17c7fee 100644
--- a/Help/envvar/FC.rst
+++ b/Help/envvar/FC.rst
@@ -1,7 +1,7 @@
 FC
 --
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``Fortran`` language files. Will only be used
 by CMake on the first configuration to determine ``Fortran`` compiler, after
diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst
index 23bc8d2..8b452e1 100644
--- a/Help/envvar/FFLAGS.rst
+++ b/Help/envvar/FFLAGS.rst
@@ -1,12 +1,12 @@
 FFLAGS
 ------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``Fortran`` files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``Fortran``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_Fortran_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/HIPCXX.rst b/Help/envvar/HIPCXX.rst
index 23329e9..ebffb56 100644
--- a/Help/envvar/HIPCXX.rst
+++ b/Help/envvar/HIPCXX.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.21
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``HIP`` language files. Will only be used by
 CMake on the first configuration to determine ``HIP`` compiler, after which the
diff --git a/Help/envvar/HIPFLAGS.rst b/Help/envvar/HIPFLAGS.rst
index 31e2390..866c87e 100644
--- a/Help/envvar/HIPFLAGS.rst
+++ b/Help/envvar/HIPFLAGS.rst
@@ -3,12 +3,12 @@
 
 .. versionadded:: 3.21
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``HIP`` files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_HIP_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``HIP``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_HIP_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/HIPHOSTCXX.rst b/Help/envvar/HIPHOSTCXX.rst
index 871fbfb..b12def6 100644
--- a/Help/envvar/HIPHOSTCXX.rst
+++ b/Help/envvar/HIPHOSTCXX.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.28
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling host code when compiling ``HIP``
 language files with the NVIDIA CUDA Compiler. Will only be used by CMake
diff --git a/Help/envvar/ISPC.rst b/Help/envvar/ISPC.rst
index bcd6260..4a9d700 100644
--- a/Help/envvar/ISPC.rst
+++ b/Help/envvar/ISPC.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.19
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``ISPC`` language files. Will only be used by
 CMake on the first configuration to determine ``ISPC`` compiler, after which the
diff --git a/Help/envvar/ISPCFLAGS.rst b/Help/envvar/ISPCFLAGS.rst
index b7a2bd5..4a45d7c 100644
--- a/Help/envvar/ISPCFLAGS.rst
+++ b/Help/envvar/ISPCFLAGS.rst
@@ -3,12 +3,12 @@
 
 .. versionadded:: 3.19
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``ISPC`` files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_ISPC_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``ISPC``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_ISPC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/LDFLAGS.rst b/Help/envvar/LDFLAGS.rst
index 816d6ef..03a70f5 100644
--- a/Help/envvar/LDFLAGS.rst
+++ b/Help/envvar/LDFLAGS.rst
@@ -1,7 +1,7 @@
 LDFLAGS
 -------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Will only be used by CMake on the first configuration to determine the default
 linker flags, after which the value for ``LDFLAGS`` is stored in the cache
diff --git a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
index 662bd03..53c6950 100644
--- a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
+++ b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
@@ -1,7 +1,7 @@
 MACOSX_DEPLOYMENT_TARGET
 ------------------------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specify the minimum version of macOS on which the target binaries are
 to be deployed.
diff --git a/Help/envvar/NO_COLOR.rst b/Help/envvar/NO_COLOR.rst
new file mode 100644
index 0000000..39fa218
--- /dev/null
+++ b/Help/envvar/NO_COLOR.rst
@@ -0,0 +1,19 @@
+NO_COLOR
+--------
+
+.. versionadded:: 4.1
+
+.. include:: include/ENV_VAR.rst
+
+Set to a non-empty value, other than ``0``, to tell command-line
+tools not to print color messages even if connected to a terminal.
+This is a `common convention`_ among command-line tools in general.
+
+See also the :envvar:`CLICOLOR_FORCE` and :envvar:`CLICOLOR` environment
+variables.  If :envvar:`!NO_COLOR` is activated, it takes precedence
+over both of them.
+
+See the :variable:`CMAKE_COLOR_DIAGNOSTICS` variable to control
+color in a generated build system.
+
+.. _`common convention`: https://web.archive.org/web/20250410160803/https://bixense.com/clicolors/
diff --git a/Help/envvar/OBJC.rst b/Help/envvar/OBJC.rst
index 2d95806..6317bdb 100644
--- a/Help/envvar/OBJC.rst
+++ b/Help/envvar/OBJC.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.16.7
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``OBJC`` language files. Will only be used
 by CMake on the first configuration to determine ``OBJC`` compiler, after
diff --git a/Help/envvar/OBJCFLAGS.rst b/Help/envvar/OBJCFLAGS.rst
index 2f30807..5d40b02 100644
--- a/Help/envvar/OBJCFLAGS.rst
+++ b/Help/envvar/OBJCFLAGS.rst
@@ -3,12 +3,12 @@
 
 .. versionadded:: 3.16
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``Objective C`` files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_OBJC_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``OBJC``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_OBJC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/OBJCXX.rst b/Help/envvar/OBJCXX.rst
index 71286d9..1e04e3b 100644
--- a/Help/envvar/OBJCXX.rst
+++ b/Help/envvar/OBJCXX.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.16.7
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``OBJCXX`` language files. Will only be used
 by CMake on the first configuration to determine ``OBJCXX`` compiler, after
diff --git a/Help/envvar/OBJCXXFLAGS.rst b/Help/envvar/OBJCXXFLAGS.rst
index 089222a..38c751d 100644
--- a/Help/envvar/OBJCXXFLAGS.rst
+++ b/Help/envvar/OBJCXXFLAGS.rst
@@ -3,12 +3,12 @@
 
 .. versionadded:: 3.16
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``Objective C++`` (.mm) files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_OBJCXX_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``OBJCXX``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_OBJCXX_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/PackageName_ROOT.rst b/Help/envvar/PackageName_ROOT.rst
index 6e9c744..f622916 100644
--- a/Help/envvar/PackageName_ROOT.rst
+++ b/Help/envvar/PackageName_ROOT.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.12
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Calls to :command:`find_package(<PackageName>)` will search in prefixes
 specified by the ``<PackageName>_ROOT`` environment variable, where
diff --git a/Help/envvar/RC.rst b/Help/envvar/RC.rst
index 8a9324d..5d5c4aa 100644
--- a/Help/envvar/RC.rst
+++ b/Help/envvar/RC.rst
@@ -1,7 +1,7 @@
 RC
 --
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``resource`` files. Will only be used by CMake
 on the first configuration to determine ``resource`` compiler, after which the
diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst
index 7df83a7..dd6d623 100644
--- a/Help/envvar/RCFLAGS.rst
+++ b/Help/envvar/RCFLAGS.rst
@@ -1,12 +1,12 @@
 RCFLAGS
 -------
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Add default compilation flags to be used when compiling ``RC`` (resource) files.
 
 .. |CMAKE_LANG_FLAGS| replace:: :variable:`CMAKE_RC_FLAGS <CMAKE_<LANG>_FLAGS>`
 .. |LANG| replace:: ``RC``
-.. include:: LANG_FLAGS.txt
+.. include:: include/LANG_FLAGS.rst
 
 See also :variable:`CMAKE_RC_FLAGS_INIT <CMAKE_<LANG>_FLAGS_INIT>`.
diff --git a/Help/envvar/SSL_CERT_DIR.rst b/Help/envvar/SSL_CERT_DIR.rst
index 1e678e4..93b4087 100644
--- a/Help/envvar/SSL_CERT_DIR.rst
+++ b/Help/envvar/SSL_CERT_DIR.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.25
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specify default directory containing CA certificates.  It overrides
 the default CA directory used.
diff --git a/Help/envvar/SSL_CERT_FILE.rst b/Help/envvar/SSL_CERT_FILE.rst
index 23216c0..5fabc4f 100644
--- a/Help/envvar/SSL_CERT_FILE.rst
+++ b/Help/envvar/SSL_CERT_FILE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.25
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Specify the file name containing CA certificates.  It overrides the
 default, os-specific CA file used.
diff --git a/Help/envvar/SWIFTC.rst b/Help/envvar/SWIFTC.rst
index 896e156..4d237a3 100644
--- a/Help/envvar/SWIFTC.rst
+++ b/Help/envvar/SWIFTC.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.15
 
-.. include:: ENV_VAR.txt
+.. include:: include/ENV_VAR.rst
 
 Preferred executable for compiling ``Swift`` language files. Will only be used by
 CMake on the first configuration to determine ``Swift`` compiler, after which the
diff --git a/Help/envvar/ENV_VAR.txt b/Help/envvar/include/ENV_VAR.rst
similarity index 100%
rename from Help/envvar/ENV_VAR.txt
rename to Help/envvar/include/ENV_VAR.rst
diff --git a/Help/envvar/LANG_FLAGS.txt b/Help/envvar/include/LANG_FLAGS.rst
similarity index 100%
rename from Help/envvar/LANG_FLAGS.txt
rename to Help/envvar/include/LANG_FLAGS.rst
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index 6629b68..a491193 100644
--- a/Help/generator/Visual Studio 14 2015.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -48,7 +48,7 @@
 .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
    By default this generator uses the 32-bit variant even on a 64-bit host.
 
-.. include:: VS_TOOLSET_HOST_ARCH_LEGACY.txt
+.. include:: include/VS_TOOLSET_HOST_ARCH_LEGACY.rst
 
 .. _`Windows 10 SDK Maximum Version for VS 2015`:
 
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index 3f29072..709b61f 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -57,4 +57,4 @@
 .. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
    By default this generator uses the 32-bit variant even on a 64-bit host.
 
-.. include:: VS_TOOLSET_HOST_ARCH_LEGACY.txt
+.. include:: include/VS_TOOLSET_HOST_ARCH_LEGACY.rst
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
index 2918a6e..4435487 100644
--- a/Help/generator/Visual Studio 16 2019.rst
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -44,4 +44,4 @@
    By default this generator uses the 64-bit variant on x64 hosts and
    the 32-bit variant otherwise.
 
-.. include:: VS_TOOLSET_HOST_ARCH.txt
+.. include:: include/VS_TOOLSET_HOST_ARCH.rst
diff --git a/Help/generator/Visual Studio 17 2022.rst b/Help/generator/Visual Studio 17 2022.rst
index ab101ac..7157dcf 100644
--- a/Help/generator/Visual Studio 17 2022.rst
+++ b/Help/generator/Visual Studio 17 2022.rst
@@ -44,4 +44,4 @@
    By default this generator uses the 64-bit variant on x64 hosts and
    the 32-bit variant otherwise.
 
-.. include:: VS_TOOLSET_HOST_ARCH.txt
+.. include:: include/VS_TOOLSET_HOST_ARCH.rst
diff --git a/Help/generator/VS_TOOLSET_HOST_ARCH.txt b/Help/generator/include/VS_TOOLSET_HOST_ARCH.rst
similarity index 100%
rename from Help/generator/VS_TOOLSET_HOST_ARCH.txt
rename to Help/generator/include/VS_TOOLSET_HOST_ARCH.rst
diff --git a/Help/generator/VS_TOOLSET_HOST_ARCH_LEGACY.txt b/Help/generator/include/VS_TOOLSET_HOST_ARCH_LEGACY.rst
similarity index 100%
rename from Help/generator/VS_TOOLSET_HOST_ARCH_LEGACY.txt
rename to Help/generator/include/VS_TOOLSET_HOST_ARCH_LEGACY.rst
diff --git a/Help/guide/ide-integration/index.rst b/Help/guide/ide-integration/index.rst
index 3a11a34..04ae7f9 100644
--- a/Help/guide/ide-integration/index.rst
+++ b/Help/guide/ide-integration/index.rst
@@ -115,8 +115,9 @@
 appropriate build tool.
 
 If an IDE project generator is used, such as :generator:`Xcode` or one of the
-Visual Studio generators, and the IDE understands the project format used, the
-IDE should read the project file and build it the same way it would otherwise.
+:ref:`Visual Studio Generators`, and the IDE understands the project format
+used, the IDE should read the project file and build it the same way it would
+otherwise.
 
 The :manual:`File API <cmake-file-api(7)>` can be used to obtain a list of
 build configurations from the build tree, and the IDE should present this list
@@ -154,7 +155,8 @@
 Additionally, CMake has builtin support for some IDEs:
 
 * :ref:`IDE Build Tool Generators`:
-  Generate IDE native build systems such as Visual Studio or Xcode.
+  Generate IDE native build systems such as
+  :ref:`Visual Studio <Visual Studio Generators>` or :generator:`Xcode`.
 * :ref:`Extra Generators`:
   Extend :ref:`Command-Line Build Tool Generators` to generate IDE
   project files that hook into the command-line build system.
diff --git a/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst b/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst
index 787e777..e91aa6a 100644
--- a/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst
+++ b/Help/guide/tutorial/Adding Support for a Testing Dashboard.rst
@@ -39,8 +39,6 @@
 top-level directory. When run, the :manual:`ctest <ctest(1)>` executable will
 read this file to gather information about the testing dashboard. It contains:
 
-* The project name
-
 * The project "Nightly" start time
 
   *  The time when a 24 hour "day" starts for this project.
diff --git a/Help/guide/tutorial/Adding System Introspection.rst b/Help/guide/tutorial/Adding System Introspection.rst
index 117b230..87070ed 100644
--- a/Help/guide/tutorial/Adding System Introspection.rst
+++ b/Help/guide/tutorial/Adding System Introspection.rst
@@ -35,7 +35,7 @@
 
 Start by editing ``MathFunctions/CMakeLists.txt``. Include the
 :module:`CheckCXXSourceCompiles` module. Then, use
-``check_cxx_source_compiles`` to determine whether ``log`` and ``exp`` are
+``check_cxx_source_compiles()`` to determine whether ``log`` and ``exp`` are
 available from ``cmath``. If they are available, use
 :command:`target_compile_definitions` to specify ``HAVE_LOG`` and ``HAVE_EXP``
 as compile definitions.
diff --git a/Help/guide/tutorial/Complete/CTestConfig.cmake b/Help/guide/tutorial/Complete/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Complete/CTestConfig.cmake
+++ b/Help/guide/tutorial/Complete/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/Step10/CTestConfig.cmake b/Help/guide/tutorial/Step10/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Step10/CTestConfig.cmake
+++ b/Help/guide/tutorial/Step10/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/Step11/CTestConfig.cmake b/Help/guide/tutorial/Step11/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Step11/CTestConfig.cmake
+++ b/Help/guide/tutorial/Step11/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/Step12/CTestConfig.cmake b/Help/guide/tutorial/Step12/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Step12/CTestConfig.cmake
+++ b/Help/guide/tutorial/Step12/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/Step6/CTestConfig.cmake b/Help/guide/tutorial/Step6/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Step6/CTestConfig.cmake
+++ b/Help/guide/tutorial/Step6/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/Step7/CTestConfig.cmake b/Help/guide/tutorial/Step7/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Step7/CTestConfig.cmake
+++ b/Help/guide/tutorial/Step7/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/Step8/CTestConfig.cmake b/Help/guide/tutorial/Step8/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Step8/CTestConfig.cmake
+++ b/Help/guide/tutorial/Step8/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/Step9/CTestConfig.cmake b/Help/guide/tutorial/Step9/CTestConfig.cmake
index 73efdb1..b2922fe 100644
--- a/Help/guide/tutorial/Step9/CTestConfig.cmake
+++ b/Help/guide/tutorial/Step9/CTestConfig.cmake
@@ -1,7 +1,3 @@
-set(CTEST_PROJECT_NAME "CMakeTutorial")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
 
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_SUBMIT_URL "https://my.cdash.org/submit.php?project=CMakeTutorial")
diff --git a/Help/guide/tutorial/source.txt b/Help/guide/tutorial/include/source.rst
similarity index 100%
rename from Help/guide/tutorial/source.txt
rename to Help/guide/tutorial/include/source.rst
diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst
index 1ab0009..438f368 100644
--- a/Help/guide/tutorial/index.rst
+++ b/Help/guide/tutorial/index.rst
@@ -11,7 +11,7 @@
 Steps
 =====
 
-.. include:: source.txt
+.. include:: include/source.rst
 
 |tutorial_source|
 Each step has its own subdirectory containing code that may be used as a
diff --git a/Help/guide/user-interaction/index.rst b/Help/guide/user-interaction/index.rst
index 0c3ef6a..fe8a45a 100644
--- a/Help/guide/user-interaction/index.rst
+++ b/Help/guide/user-interaction/index.rst
@@ -129,7 +129,7 @@
 command line environment when using a Visual Studio
 generator, doing so has no disadvantages.
 
-When using Xcode, there can be more than one Xcode
+When using :generator:`Xcode`, there can be more than one Xcode
 version installed.  Which one to use can be selected
 in a number of different ways, but the most common
 methods are:
@@ -195,7 +195,7 @@
   $ cmake .. -G "Visual Studio 16"
   $ cmake .. -G "Visual Studio 16 2019"
 
-Visual Studio generators can target different architectures.
+:ref:`Visual Studio Generators` can target different architectures.
 One can specify the target architecture using the
 :option:`-A <cmake -A>` option:
 
@@ -285,8 +285,10 @@
                                             ``Debug`` or ``Release``, determining
                                             debug/optimization flags.  This is only
                                             relevant for single-configuration buildsystems such
-                                            as ``Makefile`` and ``Ninja``.  Multi-configuration
-                                            buildsystems such as those for Visual Studio and Xcode
+                                            as :ref:`Makefile Generators` and
+                                            :ref:`Ninja Generators`.
+                                            Multi-configuration buildsystems such as those for
+                                            :ref:`Visual Studio Generators` and :generator:`Xcode`
                                             ignore this setting.
  :variable:`CMAKE_INSTALL_PREFIX`           Location to install the
                                             software to with the
@@ -572,21 +574,21 @@
 providing CMake files.
 
 ``all``
-  The default target used by ``Makefile`` and ``Ninja``
-  generators.  Builds all targets in the buildsystem,
-  except those which are excluded by their
-  :prop_tgt:`EXCLUDE_FROM_ALL` target property or
+  The default target used by :ref:`Makefile Generators`
+  and :ref:`Ninja Generators`.  Builds all targets in
+  the buildsystem, except those which are excluded by
+  their :prop_tgt:`EXCLUDE_FROM_ALL` target property or
   :prop_dir:`EXCLUDE_FROM_ALL` directory property.  The
   name ``ALL_BUILD`` is used for this purpose for the
-  Xcode and Visual Studio generators.
+  :generator:`Xcode` and :ref:`Visual Studio Generators`.
 ``help``
   Lists the targets available for build.  This target is
-  available when using the :generator:`Unix Makefiles` or
-  :generator:`Ninja` generator, and the exact output is
+  available when using the :ref:`Makefile Generators` or
+  :ref:`Ninja Generators`, and the exact output is
   tool-specific.
 ``clean``
   Delete built object files and other output files.  The
-  ``Makefile`` based generators create a ``clean`` target
+  :ref:`Makefile Generators` create a ``clean`` target
   per directory, so that an individual directory can be
   cleaned.  The ``Ninja`` tool provides its own granular
   ``-t clean`` system.
@@ -608,15 +610,15 @@
   automatically available if the CMake files provide
   CPack-based packages.
 
-For ``Makefile`` based systems, ``/fast`` variants of binary
+For :ref:`Makefile Generators`, ``/fast`` variants of binary
 build targets are provided. The ``/fast`` variants are used
 to build the specified target without regard for its
 dependencies.  The dependencies are not checked and
-are not rebuilt if out of date.  The :generator:`Ninja`
-generator is sufficiently fast at dependency checking that
+are not rebuilt if out of date.  The :ref:`Ninja Generators`
+are sufficiently fast at dependency checking that
 such targets are not provided for that generator.
 
-``Makefile`` based systems also provide build-targets to
+:ref:`Makefile Generators` also provide build-targets to
 preprocess, assemble and compile individual files in a
 particular directory.
 
diff --git a/Help/include/COMPILE_DEFINITIONS_DISCLAIMER.txt b/Help/include/COMPILE_DEFINITIONS_DISCLAIMER.rst
similarity index 100%
rename from Help/include/COMPILE_DEFINITIONS_DISCLAIMER.txt
rename to Help/include/COMPILE_DEFINITIONS_DISCLAIMER.rst
diff --git a/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt b/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.rst
similarity index 100%
rename from Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
rename to Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.rst
diff --git a/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt b/Help/include/INTERFACE_LINK_LIBRARIES_WARNING.rst
similarity index 100%
rename from Help/include/INTERFACE_LINK_LIBRARIES_WARNING.txt
rename to Help/include/INTERFACE_LINK_LIBRARIES_WARNING.rst
diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst
index 5b118d1..b5192cf 100644
--- a/Help/manual/ccmake.1.rst
+++ b/Help/manual/ccmake.1.rst
@@ -30,11 +30,11 @@
 
 .. program:: ccmake
 
-.. include:: OPTIONS_BUILD.txt
+.. include:: include/OPTIONS_BUILD.rst
 
-.. include:: OPTIONS_HELP.txt
+.. include:: include/OPTIONS_HELP.rst
 
 See Also
 ========
 
-.. include:: LINKS.txt
+.. include:: include/LINKS.rst
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index fb93222..141f714 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -115,7 +115,7 @@
 ``-std=gnu++11`` if necessary.  This applies to sources within ``mylib``
 as well as any dependents (that may include headers from ``mylib``).
 
-.. include:: ../prop_gbl/CMAKE_LANG_STD_FLAGS.txt
+.. include:: ../prop_gbl/include/CMAKE_LANG_STD_FLAGS.rst
 
 Availability of Compiler Extensions
 -----------------------------------
diff --git a/Help/manual/cmake-configure-log.7.rst b/Help/manual/cmake-configure-log.7.rst
index 2cf7580..05e8950 100644
--- a/Help/manual/cmake-configure-log.7.rst
+++ b/Help/manual/cmake-configure-log.7.rst
@@ -334,3 +334,381 @@
     An optional key that is present when the test project built successfully.
     Its value is an integer specifying the exit code, or a string containing
     an error message, from trying to run the test executable.
+
+.. _`find configure-log event`:
+
+Event Kind ``find``
+-------------------
+
+The :command:`find_file`, :command:`find_path`, :command:`find_library`, and
+:command:`find_program` commands log ``find`` events.
+
+There is only one ``find`` event major version, version 1.
+
+.. _`find-v1 event`:
+
+``find-v1`` Event
+^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+A ``find-v1`` event is a YAML mapping:
+
+.. code-block:: yaml
+
+  kind: "find-v1"
+  backtrace:
+    - "CMakeLists.txt:456 (find_program)"
+  mode: "program"
+  variable: "PROGRAM_PATH"
+  description: "Docstring for variable"
+  settings:
+    SearchFramework: "NEVER"
+    SearchAppBundle: "NEVER"
+    CMAKE_FIND_USE_CMAKE_PATH: true
+    CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
+    CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
+    CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
+    CMAKE_FIND_USE_INSTALL_PREFIX: true
+  names:
+    - "name1"
+    - "name2"
+  candidate_directories:
+    - "/path/to/search"
+    - "/other/path/to/search"
+    - "/path/to/found"
+    - "/further/path/to/search"
+  searched_directories:
+    - "/path/to/search"
+    - "/other/path/to/search"
+  found: "/path/to/found/program"
+
+The keys specific to ``find-v1`` mappings are:
+
+``mode``
+  A string describing the command using the search performed. One of ``file``,
+  ``path``, ``program``, or ``library``.
+
+``variable``
+  The variable to which the search stored its result.
+
+``description``
+  The documentation string of the variable.
+
+``settings``
+  Search settings active for the search.
+
+  ``SearchFramework``
+    A string describing how framework search is performed. One of ``FIRST``,
+    ``LAST``, ``ONLY``, or ``NEVER``. See :variable:`CMAKE_FIND_FRAMEWORK`.
+
+  ``SearchAppBundle``
+    A string describing how application bundle search is performed. One of
+    ``FIRST``, ``LAST``, ``ONLY``, or ``NEVER``. See
+    :variable:`CMAKE_FIND_APPBUNDLE`.
+
+  ``CMAKE_FIND_USE_CMAKE_PATH``
+    A boolean indicating whether or not CMake-specific cache variables are
+    used when searching. See :variable:`CMAKE_FIND_USE_CMAKE_PATH`.
+
+  ``CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH``
+    A boolean indicating whether or not CMake-specific environment variables
+    are used when searching. See
+    :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`.
+
+  ``CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH``
+    A boolean indicating whether or not platform-specific environment
+    variables are used when searching. See
+    :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`.
+
+  ``CMAKE_FIND_USE_CMAKE_SYSTEM_PATH``
+    A boolean indicating whether or not platform-specific CMake variables are
+    used when searching. See :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`.
+
+  ``CMAKE_FIND_USE_INSTALL_PREFIX``
+    A boolean indicating whether or not the install prefix is used when
+    searching. See :variable:`CMAKE_FIND_USE_INSTALL_PREFIX`.
+
+``names``
+  The names to look for the queries.
+
+``candidate_directories``
+  Candidate directories, in order, to look in during the search.
+
+``searched_directories``
+  Directories, in order, looked at during the search process.
+
+``found``
+  Either a string representing the found value or ``false`` if it was not
+  found.
+
+``search_context``
+  A mapping of variable names to search paths specified by them (either a
+  string or an array of strings depending on the variable). Environment
+  variables are wrapped with ``ENV{`` and ``}``, otherwise CMake variables are
+  used. Only variables with any paths specified are used.
+
+  ``package_stack``
+    An array of objects with paths which come from the stack of paths made
+    available by :command:`find_package` calls.
+
+    ``package_paths``
+      The paths made available by :command:`find_package` commands in the call
+      stack.
+
+.. _`find_package configure-log event`:
+
+Event Kind ``find_package``
+---------------------------
+
+.. versionadded:: 4.1
+
+The :command:`find_package` command logs ``find_package`` events.
+
+There is only one ``find_package`` event major version, version 1.
+
+.. _`find_package-v1 event`:
+
+``find_package-v1`` Event
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A ``find_package-v1`` event is a YAML mapping:
+
+.. code-block:: yaml
+
+  kind: "find_package-v1"
+  backtrace:
+    - "CMakeLists.txt:456 (find_program)"
+  name: "PackageName"
+  components:
+    -
+      name: "Component"
+      required: true
+      found: true
+  configs:
+    -
+      filename: PackageNameConfig.cmake
+      kind: "cmake"
+    -
+      filename: packagename-config.cmake
+      kind: "cmake"
+  version_request:
+    version: "1.0"
+    version_complete: "1.0...1.5"
+    min: "INCLUDE"
+    max: "INCLUDE"
+    exact: false
+  settings:
+    required: "optional"
+    quiet: false
+    global: false
+    policy_scope: true
+    bypass_provider: false
+    hints:
+      - "/hint/path"
+    names:
+      - "name1"
+      - "name2"
+    search_paths:
+      - "/search/path"
+    path_suffixes:
+      - ""
+      - "suffix"
+    registry_view: "HOST"
+    paths:
+      CMAKE_FIND_USE_CMAKE_PATH: true
+      CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true
+      CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true
+      CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true
+      CMAKE_FIND_USE_INSTALL_PREFIX: true
+      CMAKE_FIND_USE_PACKAGE_ROOT_PATH: true
+      CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY: true
+      CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY: true
+      CMAKE_FIND_ROOT_PATH_MODE: "BOTH"
+    candidates:
+      -
+        path: "/path/to/config/PackageName/PackageNameConfig.cmake"
+        mode: "config"
+        reason: "insufficient_version"
+      -
+        path: "/path/to/config/PackageName/packagename-config.cmake"
+        mode: "config"
+        reason: "no_exist"
+    found:
+      path: "/path/to/config/PackageName-2.5/PackageNameConfig.cmake"
+      mode: "config"
+      version: "2.5"
+
+The keys specific to ``find_package-v1`` mappings are:
+
+``name``
+  The name of the requested package.
+
+``components``
+  If present, an array of objects containing the fields:
+
+  ``name``
+    The name of the component.
+
+  ``required``
+    A boolean indicating whether the component is required or optional.
+
+  ``found``
+    A boolean indicating whether the component was found or not.
+
+``configs``
+  If present, an array of objects indicating the configuration files to search
+  for.
+
+  ``filename``
+    The filename of the configuration file.
+
+  ``kind``
+    The kind of file. Either ``cmake`` or ``cps``.
+
+``version_request``
+  An object indicating the version constraints on the search.
+
+  ``version``
+    The minimum version required.
+
+  ``version_complete``
+    The user-provided version range.
+
+  ``min``
+    Whether to ``INCLUDE`` or ``EXCLUDE`` the lower bound on the version
+    range.
+
+  ``max``
+    Whether to ``INCLUDE`` or ``EXCLUDE`` the upper bound on the version
+    range.
+
+  ``exact``
+    A boolean indicating whether an ``EXACT`` version match was requested.
+
+``settings``
+  Search settings active for the search.
+
+  ``required``
+    The requirement request of the search. One of ``optional``,
+    ``optional_explicit``, ``required_explicit``,
+    ``required_from_package_variable``, or ``required_from_find_variable``.
+
+  ``quiet``
+    A boolean indicating whether the search is ``QUIET`` or not.
+
+  ``global``
+    A boolean indicating whether the ``GLOBAL`` keyword has been provided or
+    not.
+
+  ``policy_scope``
+    A boolean indicating whether the ``NO_POLICY_SCOPE`` keyword has been
+    provided or not.
+
+  ``bypass_provider``
+    A boolean indicating whether the ``BYPASS_PROVIDER`` keyword has been
+    provided or not.
+
+  ``hints``
+    An array of paths provided as ``HINTS``.
+
+  ``names``
+    An array of package names to use when searching, provided by ``NAMES``.
+
+  ``search_paths``
+    An array of paths to search, provided by ``PATHS``.
+
+  ``path_suffixes``
+    An array of suffixes to use when searching, provided by ``PATH_SUFFIXES``.
+
+  ``registry_view``
+    The ``REGISTRY_VIEW`` requested for the search.
+
+  ``paths``
+    Path settings active for the search.
+
+    ``CMAKE_FIND_USE_CMAKE_PATH``
+      A boolean indicating whether or not CMake-specific cache variables are
+      used when searching. See :variable:`CMAKE_FIND_USE_CMAKE_PATH`.
+
+    ``CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH``
+      A boolean indicating whether or not CMake-specific environment variables
+      are used when searching. See
+      :variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`.
+
+    ``CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH``
+      A boolean indicating whether or not platform-specific environment
+      variables are used when searching. See
+      :variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`.
+
+    ``CMAKE_FIND_USE_CMAKE_SYSTEM_PATH``
+      A boolean indicating whether or not platform-specific CMake variables are
+      used when searching. See :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`.
+
+    ``CMAKE_FIND_USE_INSTALL_PREFIX``
+      A boolean indicating whether or not the install prefix is used when
+      searching. See :variable:`CMAKE_FIND_USE_INSTALL_PREFIX`.
+
+    ``CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY``
+      A boolean indicating whether or not to search the CMake package registry
+      for the package. See :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`.
+
+    ``CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY``
+      A boolean indicating whether or not to search the system CMake package
+      registry for the package. See
+      :variable:`CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY`.
+
+    ``CMAKE_FIND_ROOT_PATH_MODE``
+      A string indicating the root path mode in effect as selected by the
+      ``CMAKE_FIND_ROOT_PATH_BOTH``, ``ONLY_CMAKE_FIND_ROOT_PATH``, and
+      ``NO_CMAKE_FIND_ROOT_PATH`` arguments.
+
+``candidates``
+  An array of rejected candidate paths. Each element contains the following
+  keys:
+
+  ``path``
+    The path to the considered file. In the case of a dependency provider, the
+    value is in the form of ``dependency_provider::<COMMAND_NAME>``.
+
+  ``mode``
+    The mode which found the file. One of ``module``, ``cps``, ``cmake``, or
+    ``provider``.
+
+  ``reason``
+    The reason the path was rejected. One of ``insufficient_version``,
+    ``no_exist``, ``ignored``, ``no_config_file``, or ``not_found``.
+
+  ``message``
+    If present, a string describing why the package is considered as not
+    found.
+
+``found``
+  If the package has been found, information on the found file. If it is not
+  found, this is ``null``. Keys available:
+
+  ``path``
+    The path to the module or configuration that found the package. In the
+    case of a dependency provider, the value is in the form of
+    ``dependency_provider::<COMMAND_NAME>``.
+
+  ``mode``
+    The mode that considered the path. One of ``module``, ``cps``, ``cmake``,
+    or ``provider``.
+
+  ``version``
+    The reported version of the package.
+
+``search_context``
+  A mapping of variable names to search paths specified by them (either a
+  string or an array of strings depending on the variable). Environment
+  variables are wrapped with ``ENV{`` and ``}``, otherwise CMake variables are
+  used. Only variables with any paths specified are used.
+
+  ``package_stack``
+    An array of objects with paths which come from the stack of paths made
+    available by :command:`find_package` calls.
+
+    ``package_paths``
+      The paths made available by :command:`find_package` commands in the call
+      stack.
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index 2815e9c..f7896e5 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -270,8 +270,9 @@
   UNIX.  This should not be a cache entry.
 
 ``Xxx_VERSION``
-  The full version string of the package found, if any.  Note that many
-  existing modules provide ``Xxx_VERSION_STRING`` instead.
+  The full version string of the package found, if any.  Note that some existing
+  modules may also provide ``Xxx_VERSION_STRING``, as it was traditionally used
+  before the current naming convention.
 
 ``Xxx_VERSION_MAJOR``
   The major version of the package found, if any.
@@ -323,10 +324,10 @@
 ``Foo_LIBRARY_DEBUG``.  The :module:`SelectLibraryConfigurations` module
 can be helpful for such cases.
 
-While these are the standard variable names, you should provide
-backwards compatibility for any old names that were actually in use.
-Make sure you comment them as deprecated, so that no-one starts using
-them.
+While these are the standard variable names, backward compatibility should be
+provided for any previously used names in the find module that is replacing an
+older version.  Old variable names should be documented as deprecated to
+discourage further use.
 
 A Sample Find Module
 --------------------
@@ -437,9 +438,9 @@
     HINTS ${PC_Foo_LIBRARY_DIRS}
   )
 
-Alternatively, if the library is available with multiple configurations, you can
-use :module:`SelectLibraryConfigurations` to automatically set the
-``Foo_LIBRARY`` variable instead:
+Alternatively, if the library is available with multiple configurations, the
+:module:`SelectLibraryConfigurations` module can be used to automatically set
+the ``Foo_LIBRARY`` variable instead:
 
 .. code-block:: cmake
 
@@ -455,18 +456,16 @@
   include(SelectLibraryConfigurations)
   select_library_configurations(Foo)
 
-If you have a good way of getting the version (from a header file, for
-example), you can use that information to set ``Foo_VERSION`` (although
-note that find modules have traditionally used ``Foo_VERSION_STRING``,
-so you may want to set both).  Otherwise, attempt to use the information
-from ``pkg-config``
+If there is a good way of getting the version (from a header file, for
+example), that information can be used to set ``Foo_VERSION``.  Otherwise,
+attempt to use the information from the ``pkg-config``:
 
 .. code-block:: cmake
 
   set(Foo_VERSION ${PC_Foo_VERSION})
 
-Now we can use :module:`FindPackageHandleStandardArgs` to do most of the
-rest of the work for us
+Now we can use the :module:`FindPackageHandleStandardArgs` module to handle most
+of the remaining steps for us:
 
 .. code-block:: cmake
 
@@ -568,8 +567,9 @@
 so that the variant is chosen if the user uses a configuration which is
 not an exact match for any listed ``IMPORTED_CONFIGURATIONS``.
 
-Most of the cache variables should be hidden in the :program:`ccmake` interface unless
-the user explicitly asks to edit them.
+Most of the cache variables should be marked as advanced to remain hidden in GUI
+interfaces such as :manual:`cmake-gui(1)` or :manual:`ccmake(1)`, unless the
+user explicitly chooses to display and modify them:
 
 .. code-block:: cmake
 
@@ -578,10 +578,12 @@
     Foo_LIBRARY
   )
 
-If this module replaces an older version, you should set compatibility variables
-to cause the least disruption possible.
+If this find module replaces an older module version that provided variables
+before the current standard variables naming conventions, also backward
+compatibility variables should be provided to cause the least disruption
+possible.  For example:
 
 .. code-block:: cmake
 
-  # compatibility variables
+  # Backward compatibility variables
   set(Foo_VERSION_STRING ${Foo_VERSION})
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 198e71f..e493655 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -32,6 +32,7 @@
    /envvar/CMAKE_PROGRAM_PATH
    /envvar/CMAKE_TLS_VERIFY
    /envvar/CMAKE_TLS_VERSION
+   /envvar/NO_COLOR
    /envvar/SSL_CERT_DIR
    /envvar/SSL_CERT_FILE
 
@@ -61,6 +62,7 @@
    /envvar/CMAKE_INSTALL_PREFIX
    /envvar/CMAKE_LANG_COMPILER_LAUNCHER
    /envvar/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES_EXCLUDE
+   /envvar/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES_EXCLUDE
    /envvar/CMAKE_LANG_LINKER_LAUNCHER
    /envvar/CMAKE_MSVCIDE_RUN_PATH
    /envvar/CMAKE_NO_VERBOSE
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
index 561791c..058e4aa 100644
--- a/Help/manual/cmake-file-api.7.rst
+++ b/Help/manual/cmake-file-api.7.rst
@@ -41,14 +41,22 @@
   `v1 Client Stateless Query Files`_, or `v1 Client Stateful Query Files`_.
 
 ``reply/``
-  Holds reply files written by CMake whenever it runs to generate a build
-  system.  These are indexed by a `v1 Reply Index File`_ file that may
-  reference additional `v1 Reply Files`_.  CMake owns all reply files.
-  Clients must never remove them.
+  Holds reply files written by CMake when it runs to generate a build system.
+  Clients may read reply files only when referenced by a reply index:
 
-  Clients may look for and read a reply index file at any time.
+  ``index-*.json``
+    A `v1 Reply Index File`_ written when CMake generates a build system.
+
+  ``error-*.json``
+    .. versionadded:: 4.1
+
+    A `v1 Reply Error Index`_ written when CMake fails to generate a build
+    system due to an error.
+
+  Clients may look for and read a reply index at any time.
   Clients may optionally create the ``reply/`` directory at any time
-  and monitor it for the appearance of a new reply index file.
+  and monitor it for the appearance of a new reply index.
+  CMake owns all reply files.  Clients must never remove them.
 
 .. versionadded:: 3.31
   Users can add query files to ``api/v1/query`` inside the
@@ -179,7 +187,7 @@
 -------------------
 
 CMake writes an ``index-*.json`` file to the ``v1/reply/`` directory
-whenever it runs to generate a build system.  Clients must read the
+when it successfully generates a build system.  Clients must read the
 reply index file first and may read other `v1 Reply Files`_ only by
 following references.  The form of the reply index file name is::
 
@@ -300,8 +308,12 @@
     A member of this form appears for each of the
     `v1 Shared Stateless Query Files`_ that CMake recognized as a
     request for object kind ``<kind>`` with major version ``<major>``.
-    The value is a `v1 Reply File Reference`_ to the corresponding
-    reply file for that object kind and version.
+    The value is
+
+    * a `v1 Reply File Reference`_ to the corresponding reply file for
+      that object kind and version, or
+    * in a `v1 Reply Error Index`_, a JSON object with a single ``error``
+      member containing a string with an error message.
 
   ``<unknown>``
     A member of this form appears for each of the
@@ -320,8 +332,12 @@
       A member of this form appears for each of the
       `v1 Client Stateless Query Files`_ that CMake recognized as a
       request for object kind ``<kind>`` with major version ``<major>``.
-      The value is a `v1 Reply File Reference`_ to the corresponding
-      reply file for that object kind and version.
+      The value is
+
+      * a `v1 Reply File Reference`_ to the corresponding reply file for
+        that object kind and version, or
+      * in a `v1 Reply Error Index`_, a JSON object with a single ``error``
+        member containing a string with an error message.
 
     ``<unknown>``
       A member of this form appears for each of the
@@ -352,10 +368,10 @@
         contains a JSON array with a response for each entry of the
         ``requests`` array, in the same order.  Each response is
 
-        * a JSON object with a single ``error`` member containing a string
-          with an error message, or
         * a `v1 Reply File Reference`_ to the corresponding reply file for
-          the requested object kind and selected version.
+          the requested object kind and selected version, or
+        * a JSON object with a single ``error`` member containing a string
+          with an error message.
 
 After reading the reply index file, clients may read the other
 `v1 Reply Files`_ it references.
@@ -375,6 +391,35 @@
   A JSON string specifying a path relative to the reply index file
   to another JSON file containing the object.
 
+.. _`file-api reply error index`:
+
+v1 Reply Error Index
+^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+CMake writes an ``error-*.json`` file to the ``v1/reply/`` directory
+when it fails to generate a build system.  This reply error index
+follows the same naming pattern, syntax, and semantics of a
+`v1 Reply Index File`_, with the following exceptions:
+
+* The ``index-`` prefix is replaced by an ``error-`` prefix.
+
+* When a new error index is generated, old index files are *not*
+  deleted.  If a `v1 Reply Index File`_ exists, it indexes replies
+  from the most recent successful run.  If multiple ``index-*.json``
+  and/or ``error-*.json`` files are present, the one with the largest
+  name in lexicographic order, excluding the ``index-`` or ``error-``
+  prefix, is the current index.
+
+* Only a subset of `Object Kinds`_ are provided:
+
+  `configureLog <file-api configureLog_>`_
+    .. versionadded:: 4.1
+
+  Index entries for other object kinds contain an ``error`` message
+  instead of a `v1 Reply File Reference`_.
+
 v1 Reply Files
 --------------
 
@@ -777,6 +822,13 @@
 
       This type was added in codemodel version 2.4.
 
+    ``cxxModuleBmi``
+      An :command:`install(TARGETS)` call with ``CXX_MODULES_BMI``.
+      The ``destination`` member is populated and the ``isOptional`` member
+      may exist.  This type has an additional ``cxxModuleBmiTarget`` member.
+
+      This type was added in codemodel version 2.5.
+
   ``isExcludeFromAll``
     Optional member that is present with boolean value ``true`` when
     :command:`install` is called with the ``EXCLUDE_FROM_ALL`` option.
@@ -889,6 +941,21 @@
 
     This field was added in codemodel version 2.4.
 
+  ``cxxModuleBmiTarget``
+    Optional member that is present when ``type`` is ``cxxModuleBmi``.
+    The value is a JSON object with members:
+
+    ``id``
+      A string uniquely identifying the target.  This matches
+      the ``id`` member of the target in the main "codemodel"
+      object's ``targets`` array.
+
+    ``index``
+      An unsigned integer 0-based index into the main "codemodel"
+      object's ``targets`` array for the target.
+
+    This field was added in codemodel version 2.5.
+
   ``scriptFile``
     Optional member that is present when ``type`` is ``script``.
     The value is a string specifying the path to the script file on disk,
@@ -1058,6 +1125,13 @@
       * ``libraryPath``: library search path flags.
       * ``frameworkPath``: macOS framework search path flags.
 
+    ``backtrace``
+      Optional member that is present when a CMake language backtrace to
+      the :command:`target_link_libraries`, :command:`target_link_options`,
+      or other command invocation that added this link fragment is available.
+      The value is an unsigned integer 0-based index into the ``backtraceGraph``
+      member's ``nodes`` array.
+
   ``lto``
     Optional member that is present with boolean value ``true``
     when link-time optimization (a.k.a. interprocedural optimization
@@ -1104,10 +1178,10 @@
   This field was added in codemodel version 2.8.
 
   ``workingDirectory``
-    Optional member that is present when the DEBUGGER_WORKING_DIRECTORY
-    target property is set.
-    The member will also be present in Visual Studio Generator
-    scenarios when VS_DEBUGGER_WORKING_DIRECTORY is set.
+    Optional member that is present when the
+    :prop_tgt:`DEBUGGER_WORKING_DIRECTORY` target property is set.
+    The member will also be present in :ref:`Visual Studio Generators`
+    when :prop_tgt:`VS_DEBUGGER_WORKING_DIRECTORY` is set.
 
     This field was added in codemodel version 2.8.
 
@@ -1128,8 +1202,9 @@
     the ``backtraceGraph`` member's ``nodes`` array.
 
 ``fileSets``
-  A JSON array of entries corresponding to the target's file sets. Each entry
-  is a JSON object with members:
+  An optional member that is present when a target defines one or more
+  file sets.  The value is a JSON array of entries corresponding to the
+  target's file sets.  Each entry is a JSON object with members:
 
   ``name``
     A string specifying the name of the file set.
@@ -1249,6 +1324,12 @@
       A string specifying a fragment of the compile command line invocation.
       The value is encoded in the build system's native shell format.
 
+    ``backtrace``
+      Optional member that is present when a CMake language backtrace to
+      the command invocation that added this fragment is available.
+      The value is an unsigned integer 0-based index into the
+      ``backtraceGraph`` member's ``nodes`` array.
+
   ``includes``
     Optional member that is present when there are include directories.
     The value is a JSON array with an entry for each directory.  Each
@@ -1776,6 +1857,6 @@
   ``sourceFileExtensions``
     Optional member that is present when the
     :variable:`CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS` variable is defined for
-    the current language. Its value is a JSON array of JSON strings where each
+    the current language. Its value is a JSON array of JSON strings where
     each string holds a file extension (without the leading dot) for the
     language.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 271d7a9..4bc0435 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -532,6 +532,11 @@
 
         $<LIST:TRANSFORM,list,REPLACE,regular_expression,replace_expression[,SELECTOR]>
 
+      .. versionchanged:: 4.1
+        The ``^`` anchor now matches only at the beginning of the input
+        element instead of the beginning of each repeated search.
+        See policy :policy:`CMP0186`.
+
   ``SELECTOR`` determines which items of the list will be transformed.
   Only one type of selector can be specified at a time. When given,
   ``SELECTOR`` must be one of the following:
@@ -566,7 +571,7 @@
   :ref:`$\<LIST:JOIN,list,glue\> <GenEx LIST-JOIN>`, but the two have
   different behavior with regard to empty items.
   :ref:`$\<LIST:JOIN,list,glue\> <GenEx LIST-JOIN>` preserves all empty items,
-  whereas ``$<JOIN,list,glue>`` drops all empty items from the list.
+  whereas ``$<JOIN:list,glue>`` drops all empty items from the list.
 
 .. genex:: $<REMOVE_DUPLICATES:list>
 
@@ -1283,14 +1288,12 @@
   .. versionadded:: 3.3
 
   The compile language of source files when evaluating compile options.
-  See :ref:`the related boolean expression
-  <Boolean COMPILE_LANGUAGE Generator Expression>`
-  ``$<COMPILE_LANGUAGE:language>``
+  See the related boolean expression
+  :genex:`$<COMPILE_LANGUAGE:languages> <COMPILE_LANGUAGE:languages>`
   for notes about the portability of this generator expression.
 
-.. _`Boolean COMPILE_LANGUAGE Generator Expression`:
-
 .. genex:: $<COMPILE_LANGUAGE:languages>
+  :target: COMPILE_LANGUAGE:languages
 
   .. versionadded:: 3.3
 
@@ -1568,7 +1571,7 @@
   underscores.  Feature names defined in all uppercase are reserved for CMake's
   own built-in features.  The pre-defined built-in library features are:
 
-  .. include:: ../variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt
+  .. include:: ../variable/include/LINK_LIBRARY_PREDEFINED_FEATURES.rst
 
   Built-in and custom library features are defined in terms of the following
   variables:
@@ -1660,7 +1663,7 @@
   own built-in features.  Currently, there is only one pre-defined built-in
   group feature:
 
-  .. include:: ../variable/LINK_GROUP_PREDEFINED_FEATURES.txt
+  .. include:: ../variable/include/LINK_GROUP_PREDEFINED_FEATURES.rst
 
   Built-in and custom group features are defined in terms of the following
   variables:
@@ -1914,7 +1917,10 @@
     :prop_tgt:`INTERFACE_LINK_LIBRARIES` *including* entries guarded by the
     :genex:`LINK_ONLY` generator expression.  See policy :policy:`CMP0166`.
 
-  Evaluation of :prop_tgt:`LINK_LIBRARIES` itself is not transitive.
+  .. versionchanged:: 4.1
+
+    Evaluation of :prop_tgt:`LINK_LIBRARIES` itself is now transitive.
+    See policy :policy:`CMP0189`.
 
 :ref:`Target Usage Requirement Properties <Target Usage Requirements>`
   These evaluate as a :ref:`semicolon-separated list <CMake Language Lists>`
@@ -1931,7 +1937,10 @@
     *including* entries guarded by the :genex:`LINK_ONLY` generator expression.
     See policy :policy:`CMP0166`.
 
-  Evaluation of :prop_tgt:`INTERFACE_LINK_LIBRARIES` itself is not transitive.
+  .. versionchanged:: 4.1
+
+    Evaluation of :prop_tgt:`INTERFACE_LINK_LIBRARIES` itself is now
+    transitive.  See policy :policy:`CMP0189`.
 
 :ref:`Custom Transitive Properties`
   .. versionadded:: 3.30
@@ -2033,13 +2042,12 @@
 
   See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
   :prop_tgt:`LIBRARY_OUTPUT_NAME` and :prop_tgt:`RUNTIME_OUTPUT_NAME`
-  target properties and their configuration specific variants
+  target properties, their configuration-specific variants
   :prop_tgt:`OUTPUT_NAME_<CONFIG>`, :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`,
   :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>` and
-  :prop_tgt:`RUNTIME_OUTPUT_NAME_<CONFIG>`.
-
-  The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
-  properties can also be considered.
+  :prop_tgt:`RUNTIME_OUTPUT_NAME_<CONFIG>`, and
+  the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+  properties.
 
   Note that ``tgt`` is not added as a dependency of the target this
   expression is evaluated on.
@@ -2101,11 +2109,11 @@
   name is ``base``.
 
   See also the :prop_tgt:`OUTPUT_NAME` and :prop_tgt:`ARCHIVE_OUTPUT_NAME`
-  target properties and their configuration specific variants
-  :prop_tgt:`OUTPUT_NAME_<CONFIG>` and :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`.
-
-  The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
-  properties can also be considered.
+  target properties, their configuration-specific variants
+  :prop_tgt:`OUTPUT_NAME_<CONFIG>` and
+  :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`, and
+  the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+  properties.
 
   Note that ``tgt`` is not added as a dependency of the target this
   expression is evaluated on.
@@ -2177,13 +2185,12 @@
   example, if target file name is ``libbase.a``, the base name is ``base``.
 
   See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
-  and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties and their configuration
-  specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
+  and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties, their
+  configuration-specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
   :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>` and
-  :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`.
-
-  The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
-  properties can also be considered.
+  :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`, and
+  the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+  properties.
 
   Note that ``tgt`` is not added as a dependency of the target this
   expression is evaluated on.
@@ -2246,13 +2253,12 @@
   For example, if target file name is ``libbase.a``, the base name is ``base``.
 
   See also the :prop_tgt:`OUTPUT_NAME`, :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
-  and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties and their configuration
-  specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
+  and :prop_tgt:`LIBRARY_OUTPUT_NAME` target properties, their
+  configuration-specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>`,
   :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>` and
-  :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`.
-
-  The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
-  properties can also be considered.
+  :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>`, and
+  the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+  properties.
 
   Note that ``tgt`` is not added as a dependency of the target this
   expression is evaluated on.
@@ -2317,12 +2323,11 @@
   For example, if target file name is ``libbase.tbd``, the base name is ``base``.
 
   See also the :prop_tgt:`OUTPUT_NAME` and :prop_tgt:`ARCHIVE_OUTPUT_NAME`,
-  target properties and their configuration
-  specific variants :prop_tgt:`OUTPUT_NAME_<CONFIG>` and
-  :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`.
-
-  The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
-  properties can also be considered.
+  target properties, their configuration-specific variants
+  :prop_tgt:`OUTPUT_NAME_<CONFIG>` and
+  :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>`, and
+  the :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
+  properties.
 
   Note that ``tgt`` is not added as a dependency of the target this
   expression is evaluated on.
@@ -2433,11 +2438,8 @@
   ``$<TARGET_PDB_FILE_NAME:tgt>``) without prefix and suffix. For example,
   if target file name is ``base.pdb``, the base name is ``base``.
 
-  See also the :prop_tgt:`PDB_NAME` target property and its configuration
-  specific variant :prop_tgt:`PDB_NAME_<CONFIG>`.
-
-  The :prop_tgt:`<CONFIG>_POSTFIX` and :prop_tgt:`DEBUG_POSTFIX` target
-  properties can also be considered.
+  See also the :prop_tgt:`PDB_NAME` target property, and its
+  configuration-specific variant :prop_tgt:`PDB_NAME_<CONFIG>`.
 
   Note that ``tgt`` is not added as a dependency of the target this
   expression is evaluated on.
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index 26083ca..c270ab9 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -52,9 +52,9 @@
  ``<filename>`` is specified, open that file within the reference manual
  instead of ``index.html``.
 
-.. include:: OPTIONS_HELP.txt
+.. include:: include/OPTIONS_HELP.rst
 
 See Also
 ========
 
-.. include:: LINKS.txt
+.. include:: include/LINKS.rst
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index dba953d..d590b5a 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -572,7 +572,7 @@
 that are provided by CMake or have meaning to CMake when set
 by project code.
 
-.. include:: ID_RESERVE.txt
+.. include:: include/ID_RESERVE.rst
 
 .. _`CMake Language Environment Variables`:
 
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index e758637..d9b9f2e 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -8,7 +8,7 @@
 can be specified in the :variable:`CMAKE_MODULE_PATH` variable.
 
 Utility Modules
-^^^^^^^^^^^^^^^
+===============
 
 These modules are loaded using the :command:`include` command.
 
@@ -95,7 +95,7 @@
    /module/UsewxWidgets
 
 Find Modules
-^^^^^^^^^^^^
+============
 
 These modules search for third-party software.
 They are normally called through the :command:`find_package` command.
@@ -112,7 +112,6 @@
    /module/FindBLAS
    /module/FindBullet
    /module/FindBZip2
-   /module/FindCABLE
    /module/FindCoin3D
    /module/FindCUDAToolkit
    /module/FindCups
@@ -131,7 +130,6 @@
    /module/FindFLTK2
    /module/FindFontconfig
    /module/FindFreetype
-   /module/FindGCCXML
    /module/FindGettext
    /module/FindGIF
    /module/FindGit
@@ -227,8 +225,8 @@
    /module/FindRTI
    /module/FindRuby
    /module/FindSDL
-   /module/FindSDL_image
    /module/FindSDL_gfx
+   /module/FindSDL_image
    /module/FindSDL_mixer
    /module/FindSDL_net
    /module/FindSDL_sound
@@ -255,10 +253,10 @@
    /module/FindZLIB
 
 Deprecated Modules
-^^^^^^^^^^^^^^^^^^^
+==================
 
 Deprecated Utility Modules
-==========================
+--------------------------
 
 .. toctree::
    :maxdepth: 1
@@ -284,14 +282,16 @@
    /module/WriteCompilerDetectionHeader
 
 Deprecated Find Modules
-=======================
+-----------------------
 
 .. toctree::
    :maxdepth: 1
 
    /module/FindBoost
+   /module/FindCABLE
    /module/FindCUDA
    /module/FindDart
+   /module/FindGCCXML
    /module/FindGDAL
    /module/FindITK
    /module/FindPythonInterp
@@ -302,7 +302,7 @@
    /module/FindwxWindows
 
 Legacy CPack Modules
-====================
+--------------------
 
 These modules used to be mistakenly exposed to the user, and have been moved
 out of user visibility. They are for CPack internal use, and should never be
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 0165d6a..45e0ca0 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -34,10 +34,10 @@
 
 .. code-block:: cmake
 
-  cmake_minimum_required(VERSION 3.10...3.31)
+  cmake_minimum_required(VERSION 3.10...4.0)
 
 This uses the ``<min>...<max>`` syntax to enable the ``NEW`` behaviors
-of policies introduced in CMake 3.31 and earlier while only requiring a
+of policies introduced in CMake 4.0 and earlier while only requiring a
 minimum version of CMake 3.10.  The project is expected to work with
 both the ``OLD`` and ``NEW`` behaviors of policies introduced between
 those versions.
@@ -92,6 +92,25 @@
 
 The following policies are supported.
 
+Policies Introduced by CMake 4.1
+--------------------------------
+
+.. toctree::
+   :maxdepth: 1
+
+   CMP0197: MSVC link -machine: flag is not in CMAKE_*_LINKER_FLAGS. </policy/CMP0197>
+   CMP0196: The CMakeDetermineVSServicePack module is removed. </policy/CMP0196>
+   CMP0195: Swift modules in build trees use the Swift module directory structure. </policy/CMP0195>
+   CMP0194: MSVC is not an assembler for language ASM. </policy/CMP0194>
+   CMP0193: GNUInstallDirs caches CMAKE_INSTALL_* with leading 'usr/' for install prefix '/'. </policy/CMP0193>
+   CMP0192: GNUInstallDirs uses absolute SYSCONFDIR, LOCALSTATEDIR, and RUNSTATEDIR in special prefixes. </policy/CMP0192>
+   CMP0191: The FindCABLE module is removed. </policy/CMP0191>
+   CMP0190: FindPython enforce consistency in cross-compiling mode. </policy/CMP0190>
+   CMP0189: TARGET_PROPERTY evaluates LINK_LIBRARIES properties transitively. </policy/CMP0189>
+   CMP0188: The FindGCCXML module is removed. </policy/CMP0188>
+   CMP0187: Include source file without an extension after the same name with an extension. </policy/CMP0187>
+   CMP0186: Regular expressions match ^ at most once in repeated searches. </policy/CMP0186>
+
 Policies Introduced by CMake 4.0
 --------------------------------
 
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 224f1d8..a2b88dd 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -145,6 +145,7 @@
    /prop_tgt/AUTOMOC_COMPILER_PREDEFINES
    /prop_tgt/AUTOMOC_DEPEND_FILTERS
    /prop_tgt/AUTOMOC_EXECUTABLE
+   /prop_tgt/AUTOMOC_INCLUDE_DIRECTORIES
    /prop_tgt/AUTOMOC_MACRO_NAMES
    /prop_tgt/AUTOMOC_MOC_OPTIONS
    /prop_tgt/AUTOMOC_PATH_PREFIX
@@ -318,6 +319,7 @@
    /prop_tgt/LANG_CPPCHECK
    /prop_tgt/LANG_CPPLINT
    /prop_tgt/LANG_EXTENSIONS
+   /prop_tgt/LANG_ICSTAT
    /prop_tgt/LANG_INCLUDE_WHAT_YOU_USE
    /prop_tgt/LANG_LINKER_LAUNCHER
    /prop_tgt/LANG_STANDARD
@@ -327,6 +329,7 @@
    /prop_tgt/LIBRARY_OUTPUT_DIRECTORY_CONFIG
    /prop_tgt/LIBRARY_OUTPUT_NAME
    /prop_tgt/LIBRARY_OUTPUT_NAME_CONFIG
+   /prop_tgt/SPDX_LICENSE
    /prop_tgt/LINK_DEPENDS
    /prop_tgt/LINK_DEPENDS_NO_SHARED
    /prop_tgt/LINK_DIRECTORIES
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 27230c8..f9729b3 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -250,7 +250,7 @@
 Visual Studio Generators
 ========================
 
-When using the :manual:`Visual Studio generators <cmake-generators(7)>`, CMake
+When using the :ref:`Visual Studio Generators`, CMake
 generates a ``PRE_BUILD`` :command:`custom command <add_custom_command>`
 instead of the :ref:`<ORIGIN>_autogen`
 :command:`custom target <add_custom_target>` (for :prop_tgt:`AUTOMOC` and
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index c872143..9eee219 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -83,7 +83,7 @@
 Toolchain Features
 ==================
 
-CMake provides the :command:`try_compile` command and wrapper macros such as
+CMake provides the :command:`try_compile` command and modules such as
 :module:`CheckSourceCompiles`, :module:`CheckCXXSymbolExists` and
 :module:`CheckIncludeFile` to test capability and availability of various
 toolchain features. These APIs test the toolchain in some way and cache the
@@ -251,7 +251,7 @@
 installed on your system.  These SDKs are usually installed under
 ``C:/Program Files (x86)/Windows CE Tools/SDKs``.
 
-A toolchain file to configure a Visual Studio generator for
+A toolchain file to configure :ref:`Visual Studio Generators` for
 Windows CE may look like this:
 
 .. code-block:: cmake
@@ -291,7 +291,7 @@
 Cross Compiling for Windows Phone
 ---------------------------------
 
-A toolchain file to configure a Visual Studio generator for
+A toolchain file to configure :ref:`Visual Studio Generators` for
 Windows Phone may look like this:
 
 .. code-block:: cmake
@@ -302,7 +302,7 @@
 Cross Compiling for Windows Store
 ---------------------------------
 
-A toolchain file to configure a Visual Studio generator for
+A toolchain file to configure a :ref:`Visual Studio Generators` for
 Windows Store may look like this:
 
 .. code-block:: cmake
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 16c072d..d3ff681 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -14,7 +14,7 @@
 :ref:`Variables <CMake Language Variables>`
 section in the cmake-language manual.
 
-.. include:: ID_RESERVE.txt
+.. include:: include/ID_RESERVE.rst
 
 Variables that Provide Information
 ==================================
@@ -31,7 +31,6 @@
    /variable/CMAKE_CACHE_MINOR_VERSION
    /variable/CMAKE_CACHE_PATCH_VERSION
    /variable/CMAKE_CACHEFILE_DIR
-   /variable/CMAKE_CFG_INTDIR
    /variable/CMAKE_COMMAND
    /variable/CMAKE_CPACK_COMMAND
    /variable/CMAKE_CROSSCOMPILING
@@ -57,10 +56,12 @@
    /variable/CMAKE_EXECUTABLE_SUFFIX_LANG
    /variable/CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES
    /variable/CMAKE_FIND_DEBUG_MODE
+   /variable/CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG
    /variable/CMAKE_FIND_PACKAGE_NAME
    /variable/CMAKE_FIND_PACKAGE_REDIRECTS_DIR
    /variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION
    /variable/CMAKE_FIND_PACKAGE_SORT_ORDER
+   /variable/CMAKE_FIND_REQUIRED
    /variable/CMAKE_GENERATOR
    /variable/CMAKE_GENERATOR_INSTANCE
    /variable/CMAKE_GENERATOR_PLATFORM
@@ -72,6 +73,7 @@
    /variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER
    /variable/CMAKE_JOB_POOLS
    /variable/CMAKE_LANG_COMPILER_AR
+   /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
    /variable/CMAKE_LANG_COMPILER_FRONTEND_VARIANT
    /variable/CMAKE_LANG_COMPILER_LINKER
    /variable/CMAKE_LANG_COMPILER_LINKER_FRONTEND_VARIANT
@@ -104,6 +106,7 @@
    /variable/CMAKE_PROJECT_VERSION_MINOR
    /variable/CMAKE_PROJECT_VERSION_PATCH
    /variable/CMAKE_PROJECT_VERSION_TWEAK
+   /variable/CMAKE_PROJECT_COMPAT_VERSION
    /variable/CMAKE_RANLIB
    /variable/CMAKE_ROOT
    /variable/CMAKE_RULE_MESSAGES
@@ -160,6 +163,7 @@
    /variable/PROJECT-NAME_VERSION_MINOR
    /variable/PROJECT-NAME_VERSION_PATCH
    /variable/PROJECT-NAME_VERSION_TWEAK
+   /variable/PROJECT-NAME_COMPAT_VERSION
    /variable/PROJECT_BINARY_DIR
    /variable/PROJECT_DESCRIPTION
    /variable/PROJECT_HOMEPAGE_URL
@@ -171,6 +175,7 @@
    /variable/PROJECT_VERSION_MINOR
    /variable/PROJECT_VERSION_PATCH
    /variable/PROJECT_VERSION_TWEAK
+   /variable/PROJECT_COMPAT_VERSION
 
 Variables that Change Behavior
 ==============================
@@ -423,6 +428,7 @@
    /variable/CMAKE_AUTOMOC
    /variable/CMAKE_AUTOMOC_COMPILER_PREDEFINES
    /variable/CMAKE_AUTOMOC_DEPEND_FILTERS
+   /variable/CMAKE_AUTOMOC_INCLUDE_DIRECTORIES
    /variable/CMAKE_AUTOMOC_MACRO_NAMES
    /variable/CMAKE_AUTOMOC_MOC_OPTIONS
    /variable/CMAKE_AUTOMOC_PATH_PREFIX
@@ -488,6 +494,8 @@
    /variable/CMAKE_LANG_COMPILER_LAUNCHER
    /variable/CMAKE_LANG_CPPCHECK
    /variable/CMAKE_LANG_CPPLINT
+   /variable/CMAKE_LANG_LINK_DEF_FILE_FLAG
+   /variable/CMAKE_LANG_ICSTAT
    /variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE
    /variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE
    /variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE_SUPPORTED
@@ -815,7 +823,6 @@
    /variable/CMAKE_HOME_DIRECTORY
    /variable/CMAKE_INTERNAL_PLATFORM_ABI
    /variable/CMAKE_LANG_COMPILER_ABI
-   /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
    /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
    /variable/CMAKE_LANG_LINKER_PREFERENCE
    /variable/CMAKE_LANG_LINKER_PREFERENCE_PROPAGATES
@@ -829,6 +836,7 @@
 .. toctree::
    :maxdepth: 1
 
+   /variable/CMAKE_CFG_INTDIR
    /variable/CMAKE_EXTRA_GENERATOR
 
 Deprecated Variables that Change Behavior
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index e20cb9c..46ad589 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -203,7 +203,7 @@
 
 .. program:: cmake
 
-.. include:: OPTIONS_BUILD.txt
+.. include:: include/OPTIONS_BUILD.rst
 
 .. option:: --fresh
 
@@ -712,7 +712,7 @@
   specific cache variable will be evaluated to decide, if package restoration
   should be performed.
 
-  When using the Visual Studio generator, package references are defined
+  When using :ref:`Visual Studio Generators`, package references are defined
   using the :prop_tgt:`VS_PACKAGE_REFERENCES` property. Package references
   are restored using NuGet. It can be disabled by setting the
   ``CMAKE_VS_NUGET_PACKAGE_RESTORE`` variable to ``OFF``.
@@ -736,6 +736,19 @@
 
 Run :option:`cmake --build` with no options for quick help.
 
+Generator-Specific Build Tool Behavior
+--------------------------------------
+
+``cmake --build`` has special behavior with some generators:
+
+:generator:`Xcode`
+
+  .. versionadded:: 4.1
+
+    If a third-party tool has written a ``.xcworkspace`` next to
+    the CMake-generated ``.xcodeproj``, ``cmake --build`` drives
+    the build through the workspace instead.
+
 Install a Project
 =================
 
@@ -1389,15 +1402,52 @@
 
   cmake --find-package [<options>]
 
-It searches a package using :command:`find_package()` and prints the
-resulting flags to stdout.  This can be used instead of pkg-config
-to find installed libraries in plain Makefile-based projects or in
-autoconf-based projects (via ``share/aclocal/cmake.m4``).
-
 .. note::
   This mode is not well-supported due to some technical limitations.
   It is kept for compatibility but should not be used in new projects.
 
+.. option:: --find-package
+
+  It searches a package using the :command:`find_package` command and prints the
+  resulting flags to stdout.  This can be used instead of pkg-config to find
+  installed libraries in plain Makefile-based projects or in Autoconf-based
+  projects, using auxiliary macros installed in ``share/aclocal/cmake.m4`` on
+  the system.
+
+  When using this option, the following variables are expected:
+
+  ``NAME``
+    Name of the package as called in ``find_package(<PackageName>)``.
+
+  ``COMPILER_ID``
+    :variable:`Compiler ID <CMAKE_<LANG>_COMPILER_ID>` used for searching the
+    package, i.e. GNU/Intel/Clang/MSVC, etc.
+
+  ``LANGUAGE``
+    Language used for searching the package, i.e. C/CXX/Fortran/ASM, etc.
+
+  ``MODE``
+    The package search mode.  Value can be one of:
+
+    ``EXIST``
+      Only checks for existence of the given package.
+
+    ``COMPILE``
+      Prints the flags needed for compiling an object file which uses the given
+      package.
+
+    ``LINK``
+      Prints the flags needed for linking when using the given package.
+
+  ``SILENT``
+    (Optional) If TRUE, find result message is not printed.
+
+  For example:
+
+  .. code-block:: shell
+
+    cmake --find-package -DNAME=CURL -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=LINK
+
 .. _`Workflow Mode`:
 
 Run a Workflow Preset
@@ -1461,7 +1511,7 @@
 
 with one of the following options:
 
-.. include:: OPTIONS_HELP.txt
+.. include:: include/OPTIONS_HELP.rst
 
 To view the presets available for a project, use
 
@@ -1484,4 +1534,4 @@
 See Also
 ========
 
-.. include:: LINKS.txt
+.. include:: include/LINKS.rst
diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst
index 1a101a4..d1ca268 100644
--- a/Help/manual/cpack.1.rst
+++ b/Help/manual/cpack.1.rst
@@ -51,13 +51,14 @@
   the :variable:`CPACK_GENERATOR` variable determines the default set of
   generators that will be used.
 
-.. option:: -C <configs>
+.. option:: -C <configurations>
 
   Specify the project configuration(s) to be packaged (e.g. ``Debug``,
-  ``Release``, etc.), where ``<configs>`` is a
+  ``Release``, etc.), where ``<configurations>`` is a
   :ref:`semicolon-separated list <CMake Language Lists>`.
   When the CMake project uses a multi-configuration
-  generator such as Xcode or Visual Studio, this option is needed to tell
+  generator such as :generator:`Xcode` or
+  :ref:`Visual Studio <Visual Studio Generators>`, this option is needed to tell
   :program:`cpack` which built executables to include in the package.
   The user is responsible for ensuring that the configuration(s) listed
   have already been built before invoking :program:`cpack`.
@@ -127,9 +128,9 @@
 
   List presets from :manual:`cmake-presets(7)`.
 
-.. include:: OPTIONS_HELP.txt
+.. include:: include/OPTIONS_HELP.rst
 
 See Also
 ========
 
-.. include:: LINKS.txt
+.. include:: include/LINKS.rst
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 132dc80..3a871bb 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -445,6 +445,15 @@
  This option will run the tests in a random order.  It is commonly
  used to detect implicit dependencies in a test suite.
 
+.. option:: --schedule-random-seed
+
+ .. versionadded:: 4.1
+
+ Override the random order seed
+
+ This option is used to allow recreating failures owing to
+ random order of execution by ``--schedule-random``.
+
 .. option:: --submit-index
 
  Legacy option for old Dart2 dashboard server feature.
@@ -494,7 +503,7 @@
 To print version details or selected pages from the CMake documentation,
 use one of the following options:
 
-.. include:: OPTIONS_HELP.txt
+.. include:: include/OPTIONS_HELP.rst
 
 .. _`Label Matching`:
 
@@ -1610,12 +1619,14 @@
   The string "ctestInfo".
 
 ``version``
-  A JSON object specifying the version components.  Its members are
+  A JSON object specifying the version components.  Its members are:
 
   ``major``
-    A non-negative integer specifying the major version component.
+    A positive integer specifying the major version component
+    of the JSON object model.
   ``minor``
-    A non-negative integer specifying the minor version component.
+    A non-negative integer specifying the minor version component
+    of the JSON object model.
 
 ``backtraceGraph``
     JSON object representing backtrace information with the
@@ -1629,32 +1640,54 @@
       List of node JSON objects with members:
 
       ``command``
-        Index into the ``commands`` member of the ``backtraceGraph``.
+        An optional member present when the node represents a command
+        invocation within the file.  The value is an unsigned integer 0-based
+        index into the ``commands`` member of the ``backtraceGraph``.
       ``file``
-        Index into the ``files`` member of the ``backtraceGraph``.
+        An unsigned integer 0-based index into the ``files`` member of the
+        ``backtraceGraph``.
       ``line``
-        Line number in the file where the backtrace was added.
+        An optional member present when the node represents a line within
+        the file.  The value is an unsigned integer 1-based line number
+        in the file where the backtrace was added.
       ``parent``
-        Index into the ``nodes`` member of the ``backtraceGraph``
-        representing the parent in the graph.
+        An optional member present when the node is not the bottom of the
+        call stack.  The value is an unsigned integer 0-based index into the
+        ``nodes`` member of the ``backtraceGraph`` representing the parent
+        in the graph.
 
 ``tests``
   A JSON array listing information about each test.  Each entry
   is a JSON object with members:
 
   ``name``
-    Test name.
+    Test name. This cannot be empty.
   ``config``
-    Configuration that the test can run on.
-    Empty string means any config.
+    Optional field specifying the configuration for which the test will run.
+    This will always match the :option:`-C <ctest -C>` option specified on the
+    ``ctest`` command line.  If no such option was given, this field will not
+    be present.
   ``command``
-    List where the first element is the test command and the
-    remaining elements are the command arguments.
+    Optional array where the first element is the test command and the
+    remaining elements are the command arguments.  Normally, this field should
+    be present and non-empty, but in certain corner cases involving generator
+    expressions, it is possible for a test to have no command and therefore
+    this field can be missing.
   ``backtrace``
     Index into the ``nodes`` member of the ``backtraceGraph``.
   ``properties``
-    Test properties.
-    Can contain keys for each of the supported test properties.
+    Optional array of test properties.
+    Each array item will be a JSON object with the following members:
+
+    ``name``
+      The name of the test property. This cannot be empty.
+    ``value``
+      The property value, which can be a string, a number, a boolean, or an
+      array of strings.
+
+.. versionadded:: 4.1
+  The JSON output format is described in machine-readable form by
+  :download:`this JSON schema </manual/ctest/show-only-schema.json>`.
 
 .. _`ctest-resource-allocation`:
 
@@ -1969,4 +2002,4 @@
 See Also
 ========
 
-.. include:: LINKS.txt
+.. include:: include/LINKS.rst
diff --git a/Help/manual/ctest/show-only-schema.json b/Help/manual/ctest/show-only-schema.json
new file mode 100644
index 0000000..351101e
--- /dev/null
+++ b/Help/manual/ctest/show-only-schema.json
@@ -0,0 +1,121 @@
+{
+  "$schema": "http://json-schema.org/draft-07/schema#",
+  "type": "object",
+  "required": ["kind", "version", "backtraceGraph", "tests"],
+  "properties": {
+    "kind": {
+      "type": "string",
+      "const": "ctestInfo"
+    },
+    "version": {
+      "type": "object",
+      "required": ["major", "minor"],
+      "properties": {
+        "major": {
+          "const": 1,
+          "description": "A positive integer specifying the major version component of the JSON object model."
+        },
+        "minor": {
+          "const": 0,
+          "description": "A non-negative integer specifying the minor version component of the JSON object model."
+        }
+      }
+    },
+    "backtraceGraph": {
+      "type": "object",
+      "required": ["commands", "files", "nodes"],
+      "properties": {
+        "commands": {
+          "type": "array",
+          "description": "List of CMake command names.",
+          "items": {
+            "type": "string"
+          }
+        },
+        "files": {
+          "type": "array",
+          "description": "List of file paths, which may be relative or absolute. Relative paths are relative to the top-level source directory.",
+          "items": {
+            "type": "string"
+          }
+        },
+        "nodes": {
+          "type": "array",
+          "items": {
+            "type": "object",
+            "required": ["file"],
+            "properties": {
+              "command": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "An optional member present when the node represents a command invocation within the file. The value is an unsigned integer 0-based index into the commands member of the backtraceGraph."
+              },
+              "file": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "An unsigned integer 0-based index into the files member of the backtraceGraph."
+              },
+              "line": {
+                "type": "integer",
+                "minimum": 1,
+                "description": "An optional member present when the node represents a line within the file. The value is an unsigned integer 1-based line number in the file where the backtrace was added."
+              },
+              "parent": {
+                "type": "integer",
+                "minimum": 0,
+                "description": "An optional member present when the node is not the bottom of the call stack. The value is an unsigned integer 0-based index into the nodes member of the backtraceGraph representing the parent in the graph."
+              }
+            }
+          }
+        }
+      }
+    },
+    "tests": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": ["name", "backtrace"],
+        "properties": {
+          "name": {
+            "type": "string",
+            "description": "Test name",
+            "minLength": 1
+          },
+          "config": {
+            "type": "string",
+            "description": "Optional field specifying the configuration for which the test will run. This will always match the -C option specified on the ctest command line. If no such option was given, this field will not be present."
+          },
+          "command": {
+            "type": "array",
+            "items": {
+              "type": "string"
+            },
+            "minItems": 1,
+            "description": "Optional array where the first element is the test command and the remaining elements are the command arguments. Normally, this field should be present and non-empty, but in certain corner cases involving generator expressions, it is possible for a test to have no command and therefore this field can be missing."
+          },
+          "backtrace": {
+            "type": "integer",
+            "description": "Index into the nodes member of the backtraceGraph."
+          },
+          "properties": {
+            "type": "array",
+            "description": "Optional list of test properties associated with the test.",
+            "items": {
+              "type": "object",
+              "properties": {
+                "name": {
+                  "type": "string",
+                  "description": "Test property name.",
+                  "minLength": 1
+                },
+                "value": {
+                  "description": "Value of the test property. Any valid JSON type might be present."
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/Help/manual/ID_RESERVE.txt b/Help/manual/include/ID_RESERVE.rst
similarity index 100%
rename from Help/manual/ID_RESERVE.txt
rename to Help/manual/include/ID_RESERVE.rst
diff --git a/Help/manual/LINKS.txt b/Help/manual/include/LINKS.rst
similarity index 100%
rename from Help/manual/LINKS.txt
rename to Help/manual/include/LINKS.rst
diff --git a/Help/manual/OPTIONS_BUILD.txt b/Help/manual/include/OPTIONS_BUILD.rst
similarity index 100%
rename from Help/manual/OPTIONS_BUILD.txt
rename to Help/manual/include/OPTIONS_BUILD.rst
diff --git a/Help/manual/OPTIONS_HELP.txt b/Help/manual/include/OPTIONS_HELP.rst
similarity index 100%
rename from Help/manual/OPTIONS_HELP.txt
rename to Help/manual/include/OPTIONS_HELP.rst
diff --git a/Help/module/CMAKE_REQUIRED_DEFINITIONS.txt b/Help/module/CMAKE_REQUIRED_DEFINITIONS.txt
deleted file mode 100644
index 17289c3..0000000
--- a/Help/module/CMAKE_REQUIRED_DEFINITIONS.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-  ``CMAKE_REQUIRED_DEFINITIONS``
-    A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
-    ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
-    ``<resultVar>`` will also be added automatically.
diff --git a/Help/module/CMAKE_REQUIRED_FLAGS.txt b/Help/module/CMAKE_REQUIRED_FLAGS.txt
deleted file mode 100644
index 80ae239..0000000
--- a/Help/module/CMAKE_REQUIRED_FLAGS.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-  ``CMAKE_REQUIRED_FLAGS``
-    String of additional flags to pass to the compiler. The string must be
-    space-delimited--a :ref:`;-list <CMake Language Lists>` will not work.
-    The contents of :variable:`CMAKE_<LANG>_FLAGS <CMAKE_<LANG>_FLAGS>` and
-    its associated configuration-specific variable are automatically added
-    to the compiler command before the contents of ``CMAKE_REQUIRED_FLAGS``.
diff --git a/Help/module/CMAKE_REQUIRED_INCLUDES.txt b/Help/module/CMAKE_REQUIRED_INCLUDES.txt
deleted file mode 100644
index c8993bb..0000000
--- a/Help/module/CMAKE_REQUIRED_INCLUDES.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-  ``CMAKE_REQUIRED_INCLUDES``
-    A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
-    the compiler. These will be the only header search paths used--the contents
-    of the :prop_dir:`INCLUDE_DIRECTORIES` directory property will be ignored.
diff --git a/Help/module/CMAKE_REQUIRED_LIBRARIES.txt b/Help/module/CMAKE_REQUIRED_LIBRARIES.txt
deleted file mode 100644
index 8611b9e..0000000
--- a/Help/module/CMAKE_REQUIRED_LIBRARIES.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-  ``CMAKE_REQUIRED_LIBRARIES``
-    A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
-    command. These can be the name of system libraries or they can be
-    :ref:`Imported Targets <Imported Targets>` (see :command:`try_compile` for
-    further details).
diff --git a/Help/module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt b/Help/module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
deleted file mode 100644
index 35f433b..0000000
--- a/Help/module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-  ``CMAKE_REQUIRED_LINK_DIRECTORIES``
-    .. versionadded:: 3.31
-
-    A :ref:`;-list <CMake Language Lists>` of libraries search paths to pass to
-    the linker (see :command:`try_compile` for further details).
diff --git a/Help/module/CMAKE_REQUIRED_LINK_OPTIONS.txt b/Help/module/CMAKE_REQUIRED_LINK_OPTIONS.txt
deleted file mode 100644
index f2a2474..0000000
--- a/Help/module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-  ``CMAKE_REQUIRED_LINK_OPTIONS``
-    .. versionadded:: 3.14
-
-    A :ref:`;-list <CMake Language Lists>` of options to add to the link
-    command (see :command:`try_compile` for further details).
diff --git a/Help/module/CMAKE_REQUIRED_QUIET.txt b/Help/module/CMAKE_REQUIRED_QUIET.txt
deleted file mode 100644
index aae8059..0000000
--- a/Help/module/CMAKE_REQUIRED_QUIET.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-  ``CMAKE_REQUIRED_QUIET``
-    .. versionadded:: 3.1
-
-    If this variable evaluates to a boolean true value, all status messages
-    associated with the check will be suppressed.
diff --git a/Help/module/include/CMAKE_REQUIRED_DEFINITIONS.rst b/Help/module/include/CMAKE_REQUIRED_DEFINITIONS.rst
new file mode 100644
index 0000000..03b5124
--- /dev/null
+++ b/Help/module/include/CMAKE_REQUIRED_DEFINITIONS.rst
@@ -0,0 +1,5 @@
+``CMAKE_REQUIRED_DEFINITIONS``
+  A :ref:`semicolon-separated list <CMake Language Lists>` of compiler
+  definitions, each of the form ``-DFOO`` or ``-DFOO=bar``.  A definition for
+  the name specified by the result variable argument of the check
+  command is also added automatically.
diff --git a/Help/module/include/CMAKE_REQUIRED_FLAGS.rst b/Help/module/include/CMAKE_REQUIRED_FLAGS.rst
new file mode 100644
index 0000000..24ac0b6
--- /dev/null
+++ b/Help/module/include/CMAKE_REQUIRED_FLAGS.rst
@@ -0,0 +1,7 @@
+``CMAKE_REQUIRED_FLAGS``
+  A space-separated string of additional flags to pass to the compiler.
+  A :ref:`semicolon-separated list <CMake Language Lists>` will not work.
+  The contents of :variable:`CMAKE_<LANG>_FLAGS` and its associated
+  configuration-specific :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` variables
+  are automatically prepended to the compiler command before the contents of
+  this variable.
diff --git a/Help/module/include/CMAKE_REQUIRED_INCLUDES.rst b/Help/module/include/CMAKE_REQUIRED_INCLUDES.rst
new file mode 100644
index 0000000..f0d14fa
--- /dev/null
+++ b/Help/module/include/CMAKE_REQUIRED_INCLUDES.rst
@@ -0,0 +1,5 @@
+``CMAKE_REQUIRED_INCLUDES``
+  A :ref:`semicolon-separated list <CMake Language Lists>` of header
+  search paths to pass to the compiler.  These will be the only header
+  search paths used; the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+  directory property will be ignored.
diff --git a/Help/module/include/CMAKE_REQUIRED_LIBRARIES.rst b/Help/module/include/CMAKE_REQUIRED_LIBRARIES.rst
new file mode 100644
index 0000000..15ffd00
--- /dev/null
+++ b/Help/module/include/CMAKE_REQUIRED_LIBRARIES.rst
@@ -0,0 +1,5 @@
+``CMAKE_REQUIRED_LIBRARIES``
+  A :ref:`semicolon-separated list <CMake Language Lists>` of libraries to
+  add to the link command.  These can be the names of system libraries, or
+  they can be :ref:`Imported Targets` (see :command:`try_compile` for further
+  details).
diff --git a/Help/module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst b/Help/module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
new file mode 100644
index 0000000..5557cb3
--- /dev/null
+++ b/Help/module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
@@ -0,0 +1,6 @@
+``CMAKE_REQUIRED_LINK_DIRECTORIES``
+  .. versionadded:: 3.31
+
+  A :ref:`semicolon-separated list <CMake Language Lists>` of library search
+  paths to pass to the linker (see :command:`try_compile` for further
+  details).
diff --git a/Help/module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst b/Help/module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
new file mode 100644
index 0000000..9a37fef
--- /dev/null
+++ b/Help/module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
@@ -0,0 +1,5 @@
+``CMAKE_REQUIRED_LINK_OPTIONS``
+  .. versionadded:: 3.14
+
+  A :ref:`semicolon-separated list <CMake Language Lists>` of options to
+  add to the link command (see :command:`try_compile` for further details).
diff --git a/Help/module/include/CMAKE_REQUIRED_QUIET.rst b/Help/module/include/CMAKE_REQUIRED_QUIET.rst
new file mode 100644
index 0000000..874812a
--- /dev/null
+++ b/Help/module/include/CMAKE_REQUIRED_QUIET.rst
@@ -0,0 +1,5 @@
+``CMAKE_REQUIRED_QUIET``
+  .. versionadded:: 3.1
+
+  If this variable evaluates to a boolean true value, all status messages
+  associated with the check will be suppressed.
diff --git a/Help/module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst b/Help/module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
new file mode 100644
index 0000000..af855f8
--- /dev/null
+++ b/Help/module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
@@ -0,0 +1,6 @@
+:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE`
+  Internally, the :command:`try_compile` command is used to perform the
+  check, and this variable controls the type of target it creates.  If this
+  variable is set to ``EXECUTABLE`` (the default), the check compiles and
+  links the test source code as an executable program.  If set to
+  ``STATIC_LIBRARY``, the test source code is compiled but not linked.
diff --git a/Help/policy/CMP0000.rst b/Help/policy/CMP0000.rst
index e06a4c2..1c723c6 100644
--- a/Help/policy/CMP0000.rst
+++ b/Help/policy/CMP0000.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 A minimum required CMake version must be specified.
 
@@ -30,4 +30,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0001.rst b/Help/policy/CMP0001.rst
index 3a3c442..f35a61b 100644
--- a/Help/policy/CMP0001.rst
+++ b/Help/policy/CMP0001.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 ``CMAKE_BACKWARDS_COMPATIBILITY`` should no longer be used.
 
@@ -19,4 +19,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0002.rst b/Help/policy/CMP0002.rst
index 02fbf57..9b40444 100644
--- a/Help/policy/CMP0002.rst
+++ b/Help/policy/CMP0002.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Logical target names must be globally unique.
 
@@ -12,7 +12,8 @@
 
 * Unique names may be referenced unambiguously both in CMake
   code and on make tool command lines.
-* Logical names are used by Xcode and VS IDE generators
+* Logical names are used by :generator:`Xcode` and
+  :ref:`Visual Studio <Visual Studio Generators>` IDE generators
   to produce meaningful project names for the targets.
 
 The logical name of executable and library targets does not have to
@@ -24,4 +25,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0003.rst b/Help/policy/CMP0003.rst
index e3c8fa6..417d23d 100644
--- a/Help/policy/CMP0003.rst
+++ b/Help/policy/CMP0003.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Libraries linked via full path no longer produce linker search paths.
 
@@ -102,4 +102,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0004.rst b/Help/policy/CMP0004.rst
index 94d04fe..2d62d8e 100644
--- a/Help/policy/CMP0004.rst
+++ b/Help/policy/CMP0004.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Libraries linked may not have leading or trailing whitespace.
 
@@ -24,4 +24,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0005.rst b/Help/policy/CMP0005.rst
index 9163845..1c1f41a 100644
--- a/Help/policy/CMP0005.rst
+++ b/Help/policy/CMP0005.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Preprocessor definition values are now escaped automatically.
 
@@ -24,4 +24,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0006.rst b/Help/policy/CMP0006.rst
index 08776f2..2afc222 100644
--- a/Help/policy/CMP0006.rst
+++ b/Help/policy/CMP0006.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Installing :prop_tgt:`MACOSX_BUNDLE` targets requires a ``BUNDLE DESTINATION``.
 
@@ -22,4 +22,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0007.rst b/Help/policy/CMP0007.rst
index 7b013db..37f90eb 100644
--- a/Help/policy/CMP0007.rst
+++ b/Help/policy/CMP0007.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 list command no longer ignores empty elements.
 
@@ -15,4 +15,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0008.rst b/Help/policy/CMP0008.rst
index 8a4b8c5..a66f174 100644
--- a/Help/policy/CMP0008.rst
+++ b/Help/policy/CMP0008.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Libraries linked by full-path must have a valid library file name.
 
@@ -33,4 +33,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.1
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0009.rst b/Help/policy/CMP0009.rst
index aeef533..7c9b6b1 100644
--- a/Help/policy/CMP0009.rst
+++ b/Help/policy/CMP0009.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 FILE GLOB_RECURSE calls should not follow symlinks by default.
 
@@ -19,4 +19,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.2
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0010.rst b/Help/policy/CMP0010.rst
index 1f32283..501ee38 100644
--- a/Help/policy/CMP0010.rst
+++ b/Help/policy/CMP0010.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Bad variable reference syntax is an error.
 
@@ -18,4 +18,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0011.rst b/Help/policy/CMP0011.rst
index 98614b9..0f20f87 100644
--- a/Help/policy/CMP0011.rst
+++ b/Help/policy/CMP0011.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Included scripts do automatic :command:`cmake_policy` PUSH and POP.
 
@@ -23,4 +23,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0012.rst b/Help/policy/CMP0012.rst
index 24cc20b..8a6639b 100644
--- a/Help/policy/CMP0012.rst
+++ b/Help/policy/CMP0012.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 :command:`if` recognizes numbers and boolean constants.
 
@@ -26,4 +26,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0013.rst b/Help/policy/CMP0013.rst
index c22d5c9..c396096 100644
--- a/Help/policy/CMP0013.rst
+++ b/Help/policy/CMP0013.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Duplicate binary directories are not allowed.
 
@@ -19,4 +19,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0014.rst b/Help/policy/CMP0014.rst
index e147705..49b9046 100644
--- a/Help/policy/CMP0014.rst
+++ b/Help/policy/CMP0014.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Input directories must have ``CMakeLists.txt``.
 
@@ -15,4 +15,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0015.rst b/Help/policy/CMP0015.rst
index 6fbe833..de4cbe8 100644
--- a/Help/policy/CMP0015.rst
+++ b/Help/policy/CMP0015.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 :command:`link_directories` treats paths relative to the source dir.
 
@@ -17,4 +17,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.1
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0016.rst b/Help/policy/CMP0016.rst
index 2e5ac53..3da7280 100644
--- a/Help/policy/CMP0016.rst
+++ b/Help/policy/CMP0016.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 :command:`target_link_libraries` reports error if its only argument
 is not a target.
@@ -14,4 +14,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0017.rst b/Help/policy/CMP0017.rst
index 7bac8a6..65714ae 100644
--- a/Help/policy/CMP0017.rst
+++ b/Help/policy/CMP0017.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Prefer files from the CMake module directory when including from there.
 
@@ -19,4 +19,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.4
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0018.rst b/Help/policy/CMP0018.rst
index c3ae66f..322045c 100644
--- a/Help/policy/CMP0018.rst
+++ b/Help/policy/CMP0018.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Ignore ``CMAKE_SHARED_LIBRARY_<Lang>_FLAGS`` variable.
 
@@ -32,4 +32,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.9
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0019.rst b/Help/policy/CMP0019.rst
index 004316f..0fece7e 100644
--- a/Help/policy/CMP0019.rst
+++ b/Help/policy/CMP0019.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Do not re-expand variables in include and link information.
 
@@ -20,4 +20,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0020.rst b/Help/policy/CMP0020.rst
index ceace31..7eee5af 100644
--- a/Help/policy/CMP0020.rst
+++ b/Help/policy/CMP0020.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Automatically link Qt executables to ``qtmain`` target on Windows.
 
@@ -25,4 +25,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.11
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0021.rst b/Help/policy/CMP0021.rst
index b9074ab..7cb5fb8 100644
--- a/Help/policy/CMP0021.rst
+++ b/Help/policy/CMP0021.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Fatal error on relative paths in :prop_tgt:`INCLUDE_DIRECTORIES` target
 property.
@@ -19,4 +19,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0022.rst b/Help/policy/CMP0022.rst
index 91e7aa3..584b05e 100644
--- a/Help/policy/CMP0022.rst
+++ b/Help/policy/CMP0022.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 :prop_tgt:`INTERFACE_LINK_LIBRARIES` defines the link interface.
 
@@ -37,4 +37,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0023.rst b/Help/policy/CMP0023.rst
index 6f582ec..e147d7c 100644
--- a/Help/policy/CMP0023.rst
+++ b/Help/policy/CMP0023.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Plain and keyword :command:`target_link_libraries` signatures cannot be mixed.
 
@@ -33,4 +33,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.12
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0024.rst b/Help/policy/CMP0024.rst
index 72dbc0e..02be08f 100644
--- a/Help/policy/CMP0024.rst
+++ b/Help/policy/CMP0024.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Disallow include export result.
 
@@ -22,4 +22,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0025.rst b/Help/policy/CMP0025.rst
index d0f67f9..481189e 100644
--- a/Help/policy/CMP0025.rst
+++ b/Help/policy/CMP0025.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Compiler id for Apple Clang is now ``AppleClang``.
 
@@ -23,7 +23,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0025 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
diff --git a/Help/policy/CMP0026.rst b/Help/policy/CMP0026.rst
index 06b1dd1..339d325 100644
--- a/Help/policy/CMP0026.rst
+++ b/Help/policy/CMP0026.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Disallow use of the LOCATION property for build targets.
 
@@ -27,4 +27,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0027.rst b/Help/policy/CMP0027.rst
index eaf1929..98581a7 100644
--- a/Help/policy/CMP0027.rst
+++ b/Help/policy/CMP0027.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Conditionally linked imported targets with missing include directories.
 
@@ -25,4 +25,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0028.rst b/Help/policy/CMP0028.rst
index c0ba715..f7c5c9a 100644
--- a/Help/policy/CMP0028.rst
+++ b/Help/policy/CMP0028.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Double colon in target name means ``ALIAS`` or ``IMPORTED`` target.
 
@@ -25,4 +25,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0029.rst b/Help/policy/CMP0029.rst
index b5cca1e..afa27c3 100644
--- a/Help/policy/CMP0029.rst
+++ b/Help/policy/CMP0029.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`subdir_depends` command should not be called.
 
@@ -10,4 +10,4 @@
 but was kept in CMake for compatibility for a long time.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0030.rst b/Help/policy/CMP0030.rst
index a0b11d5..5a88881 100644
--- a/Help/policy/CMP0030.rst
+++ b/Help/policy/CMP0030.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`use_mangled_mesa` command should not be called.
 
@@ -11,4 +11,4 @@
 not used it in years.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0031.rst b/Help/policy/CMP0031.rst
index 7e5f22d..ca9bc81 100644
--- a/Help/policy/CMP0031.rst
+++ b/Help/policy/CMP0031.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`load_command` command should not be called.
 
@@ -13,4 +13,4 @@
 :command:`macro` and :command:`function` commands.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0032.rst b/Help/policy/CMP0032.rst
index 26a9c15..554d56e 100644
--- a/Help/policy/CMP0032.rst
+++ b/Help/policy/CMP0032.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`output_required_files` command should not be called.
 
@@ -13,4 +13,4 @@
 functionality is better achieved through dedicated outside tools.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0033.rst b/Help/policy/CMP0033.rst
index 7f84dc0..ccb659e 100644
--- a/Help/policy/CMP0033.rst
+++ b/Help/policy/CMP0033.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`export_library_dependencies` command should not be called.
 
@@ -14,4 +14,4 @@
 :command:`install(EXPORT)` commands.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0034.rst b/Help/policy/CMP0034.rst
index 386cd34..a9646dd 100644
--- a/Help/policy/CMP0034.rst
+++ b/Help/policy/CMP0034.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`utility_source` command should not be called.
 
@@ -11,4 +11,4 @@
 :command:`add_executable` combined with :command:`add_custom_command`.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0035.rst b/Help/policy/CMP0035.rst
index b3e818e..f63a5d4 100644
--- a/Help/policy/CMP0035.rst
+++ b/Help/policy/CMP0035.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`variable_requires` command should not be called.
 
@@ -10,4 +10,4 @@
 logic.  It has long been replaced by the :command:`if` command.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0036.rst b/Help/policy/CMP0036.rst
index 0d1f857..17dfa7b 100644
--- a/Help/policy/CMP0036.rst
+++ b/Help/policy/CMP0036.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`build_name` command should not be called.
 
@@ -12,4 +12,4 @@
 and :variable:`CMAKE_<LANG>_COMPILER` variables.
 
 .. |disallowed_version| replace:: 3.0
-.. include:: REMOVED_COMMAND.txt
+.. include:: include/REMOVED_COMMAND.rst
diff --git a/Help/policy/CMP0037.rst b/Help/policy/CMP0037.rst
index 5d3f518..e74f49a 100644
--- a/Help/policy/CMP0037.rst
+++ b/Help/policy/CMP0037.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Target names should not be reserved and should match a validity pattern.
 
@@ -32,4 +32,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0038.rst b/Help/policy/CMP0038.rst
index df147de..b29fbd6 100644
--- a/Help/policy/CMP0038.rst
+++ b/Help/policy/CMP0038.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Targets may not link directly to themselves.
 
@@ -16,4 +16,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0039.rst b/Help/policy/CMP0039.rst
index 4a0a7aa..136696d 100644
--- a/Help/policy/CMP0039.rst
+++ b/Help/policy/CMP0039.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Utility targets may not have link dependencies.
 
@@ -17,4 +17,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0040.rst b/Help/policy/CMP0040.rst
index 7d7bec0..6772ac0 100644
--- a/Help/policy/CMP0040.rst
+++ b/Help/policy/CMP0040.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The target in the ``TARGET`` signature of :command:`add_custom_command`
 must exist and must be defined in the current directory.
@@ -18,4 +18,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0041.rst b/Help/policy/CMP0041.rst
index d3f0043..bbc3c2f 100644
--- a/Help/policy/CMP0041.rst
+++ b/Help/policy/CMP0041.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Error on relative include with generator expression.
 
@@ -25,4 +25,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0042.rst b/Help/policy/CMP0042.rst
index 3985e21..22ddf78 100644
--- a/Help/policy/CMP0042.rst
+++ b/Help/policy/CMP0042.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 :prop_tgt:`MACOSX_RPATH` is enabled by default.
 
@@ -19,4 +19,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0043.rst b/Help/policy/CMP0043.rst
index 5b248b9..05a429b 100644
--- a/Help/policy/CMP0043.rst
+++ b/Help/policy/CMP0043.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Ignore COMPILE_DEFINITIONS_<Config> properties
 
@@ -45,4 +45,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0044.rst b/Help/policy/CMP0044.rst
index 9ee1be1..fa96435 100644
--- a/Help/policy/CMP0044.rst
+++ b/Help/policy/CMP0044.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Case sensitive ``<LANG>_COMPILER_ID`` generator expressions
 
@@ -19,4 +19,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0045.rst b/Help/policy/CMP0045.rst
index 5dea2b6..192b16f 100644
--- a/Help/policy/CMP0045.rst
+++ b/Help/policy/CMP0045.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Error on non-existent target in get_target_property.
 
@@ -17,4 +17,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0046.rst b/Help/policy/CMP0046.rst
index cf45945..e61c71f 100644
--- a/Help/policy/CMP0046.rst
+++ b/Help/policy/CMP0046.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Error on non-existent dependency in add_dependencies.
 
@@ -16,4 +16,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0047.rst b/Help/policy/CMP0047.rst
index e890260..876375f 100644
--- a/Help/policy/CMP0047.rst
+++ b/Help/policy/CMP0047.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Use ``QCC`` compiler id for the qcc drivers on QNX.
 
@@ -24,7 +24,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0047 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
diff --git a/Help/policy/CMP0048.rst b/Help/policy/CMP0048.rst
index 76a74ce..07e5abd 100644
--- a/Help/policy/CMP0048.rst
+++ b/Help/policy/CMP0048.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 The :command:`project` command manages ``VERSION`` variables.
 
@@ -21,4 +21,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0049.rst b/Help/policy/CMP0049.rst
index c2500cd..c34f35e 100644
--- a/Help/policy/CMP0049.rst
+++ b/Help/policy/CMP0049.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Do not expand variables in target source entries.
 
@@ -22,4 +22,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0050.rst b/Help/policy/CMP0050.rst
index dcd68a6..5a59019 100644
--- a/Help/policy/CMP0050.rst
+++ b/Help/policy/CMP0050.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 Disallow add_custom_command SOURCE signatures.
 
@@ -17,4 +17,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0051.rst b/Help/policy/CMP0051.rst
index ae4498a..aa4ec0c 100644
--- a/Help/policy/CMP0051.rst
+++ b/Help/policy/CMP0051.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.1
 
@@ -25,4 +25,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0052.rst b/Help/policy/CMP0052.rst
index c4cd981..f88b44b 100644
--- a/Help/policy/CMP0052.rst
+++ b/Help/policy/CMP0052.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.1
 
@@ -26,4 +26,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst
index 82ab716..f61427d 100644
--- a/Help/policy/CMP0053.rst
+++ b/Help/policy/CMP0053.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.1
 
@@ -49,4 +49,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0054.rst b/Help/policy/CMP0054.rst
index 560b706..cbdbdf3 100644
--- a/Help/policy/CMP0054.rst
+++ b/Help/policy/CMP0054.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.1
 
@@ -51,4 +51,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.1
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0055.rst b/Help/policy/CMP0055.rst
index eda4700..d6e9f81 100644
--- a/Help/policy/CMP0055.rst
+++ b/Help/policy/CMP0055.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.2
 
@@ -18,4 +18,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.2
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0056.rst b/Help/policy/CMP0056.rst
index 41ca3ba..2158f14 100644
--- a/Help/policy/CMP0056.rst
+++ b/Help/policy/CMP0056.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.2
 
@@ -32,7 +32,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.2
 .. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0056 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
diff --git a/Help/policy/CMP0057.rst b/Help/policy/CMP0057.rst
index 4c78568..e1b1bb1 100644
--- a/Help/policy/CMP0057.rst
+++ b/Help/policy/CMP0057.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.3
 
@@ -15,4 +15,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0058.rst b/Help/policy/CMP0058.rst
index 7069a93..605797b 100644
--- a/Help/policy/CMP0058.rst
+++ b/Help/policy/CMP0058.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.3
 
@@ -113,4 +113,4 @@
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
 .. |WARNED_OR_DID_NOT_WARN| replace::
    warned when it saw unknown dependencies in out-of-source build trees
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0059.rst b/Help/policy/CMP0059.rst
index 3dfc81b..7ca407e 100644
--- a/Help/policy/CMP0059.rst
+++ b/Help/policy/CMP0059.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.3
 
@@ -18,4 +18,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0060.rst b/Help/policy/CMP0060.rst
index 078f22e..e1c0b22 100644
--- a/Help/policy/CMP0060.rst
+++ b/Help/policy/CMP0060.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.3
 
@@ -63,7 +63,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0060 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
diff --git a/Help/policy/CMP0061.rst b/Help/policy/CMP0061.rst
index 765ecb7..52a4ee1 100644
--- a/Help/policy/CMP0061.rst
+++ b/Help/policy/CMP0061.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.3
 
@@ -26,4 +26,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0062.rst b/Help/policy/CMP0062.rst
index c785b46..c90efcb 100644
--- a/Help/policy/CMP0062.rst
+++ b/Help/policy/CMP0062.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.3
 
@@ -28,4 +28,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0063.rst b/Help/policy/CMP0063.rst
index 1f00c20..2446b7a 100644
--- a/Help/policy/CMP0063.rst
+++ b/Help/policy/CMP0063.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.3
 
@@ -27,4 +27,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.3
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0064.rst b/Help/policy/CMP0064.rst
index fca428b..8174eac 100644
--- a/Help/policy/CMP0064.rst
+++ b/Help/policy/CMP0064.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.4
 
@@ -16,4 +16,4 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.4
 .. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/CMP0065.rst b/Help/policy/CMP0065.rst
index 7d70899..baabe0c 100644
--- a/Help/policy/CMP0065.rst
+++ b/Help/policy/CMP0065.rst
@@ -2,7 +2,7 @@
 -------
 
 .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
-.. include:: REMOVED_PROLOGUE.txt
+.. include:: include/REMOVED_PROLOGUE.rst
 
 .. versionadded:: 3.4
 
@@ -25,7 +25,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.4
 .. |WARNED_OR_DID_NOT_WARN| replace:: did *not* warn by default
-.. include:: REMOVED_EPILOGUE.txt
+.. include:: include/REMOVED_EPILOGUE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0065 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
diff --git a/Help/policy/CMP0066.rst b/Help/policy/CMP0066.rst
index 947a186..e3dfc52 100644
--- a/Help/policy/CMP0066.rst
+++ b/Help/policy/CMP0066.rst
@@ -22,10 +22,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.7
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0066 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0067.rst b/Help/policy/CMP0067.rst
index 0696131..19ce293 100644
--- a/Help/policy/CMP0067.rst
+++ b/Help/policy/CMP0067.rst
@@ -32,10 +32,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.8
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0067 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0068.rst b/Help/policy/CMP0068.rst
index aad8c3a..5535e91 100644
--- a/Help/policy/CMP0068.rst
+++ b/Help/policy/CMP0068.rst
@@ -31,6 +31,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.9
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0069.rst b/Help/policy/CMP0069.rst
index 97665e6..3bc7ca4 100644
--- a/Help/policy/CMP0069.rst
+++ b/Help/policy/CMP0069.rst
@@ -28,9 +28,9 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.9
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
 
 Examples
 ^^^^^^^^
diff --git a/Help/policy/CMP0070.rst b/Help/policy/CMP0070.rst
index 33b5a97..cb9bed7 100644
--- a/Help/policy/CMP0070.rst
+++ b/Help/policy/CMP0070.rst
@@ -21,6 +21,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.10
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0071.rst b/Help/policy/CMP0071.rst
index 5c86f55..88bf2a8 100644
--- a/Help/policy/CMP0071.rst
+++ b/Help/policy/CMP0071.rst
@@ -40,6 +40,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.10
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0072.rst b/Help/policy/CMP0072.rst
index 430cb5a..9b20db0 100644
--- a/Help/policy/CMP0072.rst
+++ b/Help/policy/CMP0072.rst
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.11
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0073.rst b/Help/policy/CMP0073.rst
index 897092e..8be6db3 100644
--- a/Help/policy/CMP0073.rst
+++ b/Help/policy/CMP0073.rst
@@ -21,6 +21,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.12
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0074.rst b/Help/policy/CMP0074.rst
index fff843f..6eacf98 100644
--- a/Help/policy/CMP0074.rst
+++ b/Help/policy/CMP0074.rst
@@ -19,6 +19,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.12
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0075.rst b/Help/policy/CMP0075.rst
index 479c629..8d04474 100644
--- a/Help/policy/CMP0075.rst
+++ b/Help/policy/CMP0075.rst
@@ -7,21 +7,21 @@
 
 In CMake 3.12 and above, the
 
-* ``check_include_file`` macro in the :module:`CheckIncludeFile` module, the
-* ``check_include_file_cxx`` macro in the
+* ``check_include_file()`` command in the :module:`CheckIncludeFile` module, the
+* ``check_include_file_cxx()`` command in the
   :module:`CheckIncludeFileCXX` module, and the
-* ``check_include_files`` macro in the :module:`CheckIncludeFiles` module
+* ``check_include_files()`` command in the :module:`CheckIncludeFiles` module
 
 now prefer to link the check executable to the libraries listed in the
 ``CMAKE_REQUIRED_LIBRARIES`` variable.  This policy provides compatibility
 with projects that have not been updated to expect this behavior.
 
 The ``OLD`` behavior for this policy is to ignore ``CMAKE_REQUIRED_LIBRARIES``
-in the include file check macros.  The ``NEW`` behavior of this policy is to
-honor ``CMAKE_REQUIRED_LIBRARIES`` in the include file check macros.
+in the include file check commands.  The ``NEW`` behavior of this policy is to
+honor ``CMAKE_REQUIRED_LIBRARIES`` in the include file check commands.
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.12
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0076.rst b/Help/policy/CMP0076.rst
index a30b4c9..453bcf3 100644
--- a/Help/policy/CMP0076.rst
+++ b/Help/policy/CMP0076.rst
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0077.rst b/Help/policy/CMP0077.rst
index f64f92f..cefef61 100644
--- a/Help/policy/CMP0077.rst
+++ b/Help/policy/CMP0077.rst
@@ -52,10 +52,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 Use the :variable:`CMAKE_POLICY_DEFAULT_CMP0077
 <CMAKE_POLICY_DEFAULT_CMP\<NNNN\>>` variable to set the policy for
 a third-party project in a subdirectory without modifying it.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0078.rst b/Help/policy/CMP0078.rst
index c4b8a64..6fc199f 100644
--- a/Help/policy/CMP0078.rst
+++ b/Help/policy/CMP0078.rst
@@ -20,6 +20,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0079.rst b/Help/policy/CMP0079.rst
index 039ac7b..1a8eb35 100644
--- a/Help/policy/CMP0079.rst
+++ b/Help/policy/CMP0079.rst
@@ -36,6 +36,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0080.rst b/Help/policy/CMP0080.rst
index cface96..040bf97 100644
--- a/Help/policy/CMP0080.rst
+++ b/Help/policy/CMP0080.rst
@@ -21,6 +21,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0081.rst b/Help/policy/CMP0081.rst
index b89a353..6df7d9d 100644
--- a/Help/policy/CMP0081.rst
+++ b/Help/policy/CMP0081.rst
@@ -19,6 +19,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.13
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst
index 2de0cd9..e5bc6f6 100644
--- a/Help/policy/CMP0082.rst
+++ b/Help/policy/CMP0082.rst
@@ -21,10 +21,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0082 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
index 2ba9e14..d00390b 100644
--- a/Help/policy/CMP0083.rst
+++ b/Help/policy/CMP0083.rst
@@ -27,7 +27,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 .. Note::
 
@@ -35,7 +35,7 @@
    to use the :module:`CheckPIESupported` module to ensure flags are passed to
    the linker.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
 
 Examples
 ^^^^^^^^
diff --git a/Help/policy/CMP0084.rst b/Help/policy/CMP0084.rst
index 3b86a73..827f40b 100644
--- a/Help/policy/CMP0084.rst
+++ b/Help/policy/CMP0084.rst
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0085.rst b/Help/policy/CMP0085.rst
index 783c644..f1b080c 100644
--- a/Help/policy/CMP0085.rst
+++ b/Help/policy/CMP0085.rst
@@ -17,6 +17,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0086.rst b/Help/policy/CMP0086.rst
index c1abffe..2534e5a 100644
--- a/Help/policy/CMP0086.rst
+++ b/Help/policy/CMP0086.rst
@@ -16,6 +16,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0087.rst b/Help/policy/CMP0087.rst
index 3ef2c60..605e658 100644
--- a/Help/policy/CMP0087.rst
+++ b/Help/policy/CMP0087.rst
@@ -25,6 +25,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0088.rst b/Help/policy/CMP0088.rst
index e53078c..886796f 100644
--- a/Help/policy/CMP0088.rst
+++ b/Help/policy/CMP0088.rst
@@ -6,8 +6,8 @@
 :module:`FindBISON` runs bison in :variable:`CMAKE_CURRENT_BINARY_DIR`
 when executing.
 
-The module provides a ``BISON_TARGET`` macro which generates BISON output.
-In CMake 3.13 and below the macro would generate a custom command that runs
+The module provides a ``bison_target()`` command which generates BISON output.
+In CMake 3.13 and below the command would generate a custom build rule that runs
 ``bison`` in the source directory.  CMake 3.14 and later prefer to run it
 in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR` as the
 ``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation.
@@ -17,7 +17,7 @@
 This policy provides compatibility for projects that have not been updated
 to expect the new behavior.
 
-The ``OLD`` behavior for this policy is for ``BISON_TARGET`` to use
+The ``OLD`` behavior for this policy is for ``bison_target()`` to use
 the current source directory for the ``WORKING_DIRECTORY`` and where
 to generate implicit files. The ``NEW`` behavior of this policy is to
 use the current binary directory for the ``WORKING_DIRECTORY`` and where
@@ -25,6 +25,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.14
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0089.rst b/Help/policy/CMP0089.rst
index 5f548c0..b5284fb 100644
--- a/Help/policy/CMP0089.rst
+++ b/Help/policy/CMP0089.rst
@@ -23,10 +23,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0089 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0090.rst b/Help/policy/CMP0090.rst
index df7726c..42c7aac 100644
--- a/Help/policy/CMP0090.rst
+++ b/Help/policy/CMP0090.rst
@@ -23,6 +23,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0091.rst b/Help/policy/CMP0091.rst
index 110e655..5e140ec 100644
--- a/Help/policy/CMP0091.rst
+++ b/Help/policy/CMP0091.rst
@@ -45,6 +45,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0092.rst b/Help/policy/CMP0092.rst
index 03a9975..fed18cd 100644
--- a/Help/policy/CMP0092.rst
+++ b/Help/policy/CMP0092.rst
@@ -34,6 +34,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0093.rst b/Help/policy/CMP0093.rst
index 5f7ae7d..27762d3 100644
--- a/Help/policy/CMP0093.rst
+++ b/Help/policy/CMP0093.rst
@@ -20,6 +20,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0094.rst b/Help/policy/CMP0094.rst
index 1b88a22..d465f48 100644
--- a/Help/policy/CMP0094.rst
+++ b/Help/policy/CMP0094.rst
@@ -18,6 +18,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.15
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0095.rst b/Help/policy/CMP0095.rst
index cbeffc7..5237379 100644
--- a/Help/policy/CMP0095.rst
+++ b/Help/policy/CMP0095.rst
@@ -27,6 +27,6 @@
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.16
 .. |WARNS_OR_DOES_NOT_WARN| replace::
    warns when it detects use of CMake-like syntax
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0096.rst b/Help/policy/CMP0096.rst
index 8ea3784..3772ec9 100644
--- a/Help/policy/CMP0096.rst
+++ b/Help/policy/CMP0096.rst
@@ -21,6 +21,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.16
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0097.rst b/Help/policy/CMP0097.rst
index d9141f5..89fb977 100644
--- a/Help/policy/CMP0097.rst
+++ b/Help/policy/CMP0097.rst
@@ -21,7 +21,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.16
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 .. note::
 
@@ -34,4 +34,4 @@
   :command:`FetchContent_Declare` will continue to apply in future CMake
   releases.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0098.rst b/Help/policy/CMP0098.rst
index 42c900b..d81dde4 100644
--- a/Help/policy/CMP0098.rst
+++ b/Help/policy/CMP0098.rst
@@ -6,8 +6,8 @@
 :module:`FindFLEX` runs ``flex`` in directory
 :variable:`CMAKE_CURRENT_BINARY_DIR` when executing.
 
-The module provides a ``FLEX_TARGET`` macro which generates FLEX output.
-In CMake 3.16 and below the macro would generate a custom command that runs
+The module provides a ``flex_target()`` command which generates FLEX output.
+In CMake 3.16 and below the command would generate a custom build rule that runs
 ``flex`` in the current source directory.  CMake 3.17 and later prefer to
 run it in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR`
 as the ``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation.
@@ -18,7 +18,7 @@
 This policy provides compatibility for projects that have not been updated
 to expect the new behavior.
 
-The ``OLD`` behavior for this policy is for ``FLEX_TARGET`` to use
+The ``OLD`` behavior for this policy is for ``flex_target()`` to use
 the current source directory for the ``WORKING_DIRECTORY`` and where
 to generate implicit files. The ``NEW`` behavior of this policy is to
 use the current binary directory for the ``WORKING_DIRECTORY`` relative to
@@ -26,6 +26,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0099.rst b/Help/policy/CMP0099.rst
index 0a2b786..5ea6d94 100644
--- a/Help/policy/CMP0099.rst
+++ b/Help/policy/CMP0099.rst
@@ -29,6 +29,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0100.rst b/Help/policy/CMP0100.rst
index c3b782b..359b618 100644
--- a/Help/policy/CMP0100.rst
+++ b/Help/policy/CMP0100.rst
@@ -36,6 +36,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17.0
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0101.rst b/Help/policy/CMP0101.rst
index ceefcda..699a893 100644
--- a/Help/policy/CMP0101.rst
+++ b/Help/policy/CMP0101.rst
@@ -24,6 +24,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0102.rst b/Help/policy/CMP0102.rst
index 8590979..b4d7ca3 100644
--- a/Help/policy/CMP0102.rst
+++ b/Help/policy/CMP0102.rst
@@ -21,9 +21,9 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the :variable:`CMAKE_POLICY_WARNING_CMP0102
 <CMAKE_POLICY_WARNING_CMP<NNNN>>` variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0103.rst b/Help/policy/CMP0103.rst
index 50bceba..e0740bd 100644
--- a/Help/policy/CMP0103.rst
+++ b/Help/policy/CMP0103.rst
@@ -18,6 +18,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0104.rst b/Help/policy/CMP0104.rst
index 9e8d222..4c82969 100644
--- a/Help/policy/CMP0104.rst
+++ b/Help/policy/CMP0104.rst
@@ -31,9 +31,9 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
 
 Examples
 ^^^^^^^^
diff --git a/Help/policy/CMP0105.rst b/Help/policy/CMP0105.rst
index 8726997..a2a1b5f 100644
--- a/Help/policy/CMP0105.rst
+++ b/Help/policy/CMP0105.rst
@@ -16,6 +16,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0106.rst b/Help/policy/CMP0106.rst
index 5f7e078..46c1281 100644
--- a/Help/policy/CMP0106.rst
+++ b/Help/policy/CMP0106.rst
@@ -16,6 +16,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.18
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0107.rst b/Help/policy/CMP0107.rst
index ece0b23..8332712 100644
--- a/Help/policy/CMP0107.rst
+++ b/Help/policy/CMP0107.rst
@@ -15,6 +15,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0108.rst b/Help/policy/CMP0108.rst
index fbb72b3..d6ce7e5 100644
--- a/Help/policy/CMP0108.rst
+++ b/Help/policy/CMP0108.rst
@@ -15,6 +15,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0109.rst b/Help/policy/CMP0109.rst
index 2073d72..a51a3f8 100644
--- a/Help/policy/CMP0109.rst
+++ b/Help/policy/CMP0109.rst
@@ -19,6 +19,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0110.rst b/Help/policy/CMP0110.rst
index ad9e096..a916fb4 100644
--- a/Help/policy/CMP0110.rst
+++ b/Help/policy/CMP0110.rst
@@ -23,6 +23,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0111.rst b/Help/policy/CMP0111.rst
index 33a925b..2d3322a 100644
--- a/Help/policy/CMP0111.rst
+++ b/Help/policy/CMP0111.rst
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0112.rst b/Help/policy/CMP0112.rst
index 2b21eaf..8706c31 100644
--- a/Help/policy/CMP0112.rst
+++ b/Help/policy/CMP0112.rst
@@ -36,10 +36,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0112 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0113.rst b/Help/policy/CMP0113.rst
index 1908727..09a0d15 100644
--- a/Help/policy/CMP0113.rst
+++ b/Help/policy/CMP0113.rst
@@ -38,6 +38,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0114.rst b/Help/policy/CMP0114.rst
index f4ca7ef..f1a59fc 100644
--- a/Help/policy/CMP0114.rst
+++ b/Help/policy/CMP0114.rst
@@ -81,6 +81,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.19
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0115.rst b/Help/policy/CMP0115.rst
index b11f97d..867b883 100644
--- a/Help/policy/CMP0115.rst
+++ b/Help/policy/CMP0115.rst
@@ -29,6 +29,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0116.rst b/Help/policy/CMP0116.rst
index b0fc896..14a6e6a 100644
--- a/Help/policy/CMP0116.rst
+++ b/Help/policy/CMP0116.rst
@@ -36,10 +36,10 @@
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |WARNS_OR_DOES_NOT_WARN| replace::
    does *not* warn by default (unless ``DEPFILE`` is used in a subdirectory)
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0116 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0117.rst b/Help/policy/CMP0117.rst
index e1a0ee9..3b945a0 100644
--- a/Help/policy/CMP0117.rst
+++ b/Help/policy/CMP0117.rst
@@ -37,6 +37,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0118.rst b/Help/policy/CMP0118.rst
index 5c04927..9fc1d43 100644
--- a/Help/policy/CMP0118.rst
+++ b/Help/policy/CMP0118.rst
@@ -33,6 +33,6 @@
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |WARNS_OR_DOES_NOT_WARN| replace::
    warns about setting the ``GENERATED`` property to a non-boolean value
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0119.rst b/Help/policy/CMP0119.rst
index 78e9894..0050564 100644
--- a/Help/policy/CMP0119.rst
+++ b/Help/policy/CMP0119.rst
@@ -30,6 +30,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0120.rst b/Help/policy/CMP0120.rst
index bba2291..08573e9 100644
--- a/Help/policy/CMP0120.rst
+++ b/Help/policy/CMP0120.rst
@@ -40,8 +40,8 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
 
 .. _`Hedley`: https://nemequ.github.io/hedley/
diff --git a/Help/policy/CMP0121.rst b/Help/policy/CMP0121.rst
index 6e08cb5..a2e1a95 100644
--- a/Help/policy/CMP0121.rst
+++ b/Help/policy/CMP0121.rst
@@ -16,6 +16,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0122.rst b/Help/policy/CMP0122.rst
index 0b2da6c..908b4bb 100644
--- a/Help/policy/CMP0122.rst
+++ b/Help/policy/CMP0122.rst
@@ -11,6 +11,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0123.rst b/Help/policy/CMP0123.rst
index 85f23a4..608efe0 100644
--- a/Help/policy/CMP0123.rst
+++ b/Help/policy/CMP0123.rst
@@ -27,6 +27,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0124.rst b/Help/policy/CMP0124.rst
index 2c19cac..a98e4b1 100644
--- a/Help/policy/CMP0124.rst
+++ b/Help/policy/CMP0124.rst
@@ -44,6 +44,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0125.rst b/Help/policy/CMP0125.rst
index 8c5e23a..9acb696 100644
--- a/Help/policy/CMP0125.rst
+++ b/Help/policy/CMP0125.rst
@@ -36,6 +36,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0126.rst b/Help/policy/CMP0126.rst
index ca40709..83dfb02 100644
--- a/Help/policy/CMP0126.rst
+++ b/Help/policy/CMP0126.rst
@@ -26,7 +26,7 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.21
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0126 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
@@ -36,4 +36,4 @@
 variable may be used to set the policy for a third-party project in a
 subdirectory without modifying it.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0127.rst b/Help/policy/CMP0127.rst
index 3de4f5e..a9c838d 100644
--- a/Help/policy/CMP0127.rst
+++ b/Help/policy/CMP0127.rst
@@ -5,7 +5,7 @@
 
 :command:`cmake_dependent_option` supports full :ref:`Condition Syntax`.
 
-The ``<depends>`` parameter accepts a :ref:`semicolon-separated list <CMake
+The ``<condition>`` parameter accepts a :ref:`semicolon-separated list <CMake
 Language Lists>` of conditions.  CMake 3.21 and lower evaluates each
 ``condition`` as ``if(${condition})``, which does not properly handle
 conditions with nested paren groups.  CMake 3.22 and above instead prefer
@@ -28,6 +28,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.22
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0128.rst b/Help/policy/CMP0128.rst
index 7d2c537..6817a71 100644
--- a/Help/policy/CMP0128.rst
+++ b/Help/policy/CMP0128.rst
@@ -63,10 +63,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.22
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0128 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0129.rst b/Help/policy/CMP0129.rst
index 08ef8d1..7664fcd 100644
--- a/Help/policy/CMP0129.rst
+++ b/Help/policy/CMP0129.rst
@@ -25,10 +25,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.23
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0129 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0130.rst b/Help/policy/CMP0130.rst
index 79f1ebb..25ccf0a 100644
--- a/Help/policy/CMP0130.rst
+++ b/Help/policy/CMP0130.rst
@@ -27,6 +27,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0131.rst b/Help/policy/CMP0131.rst
index 8899943..cead486 100644
--- a/Help/policy/CMP0131.rst
+++ b/Help/policy/CMP0131.rst
@@ -25,6 +25,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0132.rst b/Help/policy/CMP0132.rst
index 11a1212..bb85dcf 100644
--- a/Help/policy/CMP0132.rst
+++ b/Help/policy/CMP0132.rst
@@ -5,9 +5,9 @@
 
 Do not set compiler environment variables on first run.
 
-Apart from when using the Xcode generator and some Visual Studio generators,
-CMake 3.23 and below will set environment variables like :envvar:`CC`,
-:envvar:`CXX`, etc. when the corresponding language is enabled.
+Apart from when using the :generator:`Xcode` generator and some :ref:`Visual
+Studio Generators`, CMake 3.23 and below will set environment variables like
+:envvar:`CC`, :envvar:`CXX`, etc. when the corresponding language is enabled.
 This only occurs on the very first time CMake is run in a build directory,
 and the environment variables are only defined at configure time, not build
 time. On subsequent CMake runs, these environment variables are not set,
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0133.rst b/Help/policy/CMP0133.rst
index 3bccd15..bbce7a9 100644
--- a/Help/policy/CMP0133.rst
+++ b/Help/policy/CMP0133.rst
@@ -23,10 +23,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0133 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0134.rst b/Help/policy/CMP0134.rst
index 986d58e..ec4d963 100644
--- a/Help/policy/CMP0134.rst
+++ b/Help/policy/CMP0134.rst
@@ -30,6 +30,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0135.rst b/Help/policy/CMP0135.rst
index 09c688d..142302c 100644
--- a/Help/policy/CMP0135.rst
+++ b/Help/policy/CMP0135.rst
@@ -24,6 +24,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0136.rst b/Help/policy/CMP0136.rst
index 0980c87..00b9636 100644
--- a/Help/policy/CMP0136.rst
+++ b/Help/policy/CMP0136.rst
@@ -44,6 +44,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0137.rst b/Help/policy/CMP0137.rst
index 3d879d1..e784fab 100644
--- a/Help/policy/CMP0137.rst
+++ b/Help/policy/CMP0137.rst
@@ -27,6 +27,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0138.rst b/Help/policy/CMP0138.rst
index f933b90..6c98c2b 100644
--- a/Help/policy/CMP0138.rst
+++ b/Help/policy/CMP0138.rst
@@ -25,6 +25,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0139.rst b/Help/policy/CMP0139.rst
index 640055d..115cfbe 100644
--- a/Help/policy/CMP0139.rst
+++ b/Help/policy/CMP0139.rst
@@ -11,6 +11,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.24
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0140.rst b/Help/policy/CMP0140.rst
index 4236017..bcb2319 100644
--- a/Help/policy/CMP0140.rst
+++ b/Help/policy/CMP0140.rst
@@ -11,6 +11,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.25
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0141.rst b/Help/policy/CMP0141.rst
index ac3160c..daaaa3b 100644
--- a/Help/policy/CMP0141.rst
+++ b/Help/policy/CMP0141.rst
@@ -49,6 +49,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.25
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0142.rst b/Help/policy/CMP0142.rst
index e4b1440..5de544f 100644
--- a/Help/policy/CMP0142.rst
+++ b/Help/policy/CMP0142.rst
@@ -21,6 +21,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.25
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0143.rst b/Help/policy/CMP0143.rst
index ce13752..85be4e7 100644
--- a/Help/policy/CMP0143.rst
+++ b/Help/policy/CMP0143.rst
@@ -26,6 +26,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.26
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0144.rst b/Help/policy/CMP0144.rst
index 81e622a..57c1c3a 100644
--- a/Help/policy/CMP0144.rst
+++ b/Help/policy/CMP0144.rst
@@ -20,6 +20,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0145.rst b/Help/policy/CMP0145.rst
index 9b0d43f..1bd6644 100644
--- a/Help/policy/CMP0145.rst
+++ b/Help/policy/CMP0145.rst
@@ -24,6 +24,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0146.rst b/Help/policy/CMP0146.rst
index 7d6ba19..2f24d2b 100644
--- a/Help/policy/CMP0146.rst
+++ b/Help/policy/CMP0146.rst
@@ -23,6 +23,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0147.rst b/Help/policy/CMP0147.rst
index 1790678..50baaa5 100644
--- a/Help/policy/CMP0147.rst
+++ b/Help/policy/CMP0147.rst
@@ -19,6 +19,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0148.rst b/Help/policy/CMP0148.rst
index c522c6a..1436fb7 100644
--- a/Help/policy/CMP0148.rst
+++ b/Help/policy/CMP0148.rst
@@ -23,6 +23,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0149.rst b/Help/policy/CMP0149.rst
index 11e935d..de3f862 100644
--- a/Help/policy/CMP0149.rst
+++ b/Help/policy/CMP0149.rst
@@ -48,6 +48,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0150.rst b/Help/policy/CMP0150.rst
index e8c58ef..c0be926 100644
--- a/Help/policy/CMP0150.rst
+++ b/Help/policy/CMP0150.rst
@@ -34,6 +34,6 @@
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace::
    warns when a relative path is encountered
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0151.rst b/Help/policy/CMP0151.rst
index 49b0811..0e29f80 100644
--- a/Help/policy/CMP0151.rst
+++ b/Help/policy/CMP0151.rst
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.27
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0152.rst b/Help/policy/CMP0152.rst
index 94109e3..02c7923 100644
--- a/Help/policy/CMP0152.rst
+++ b/Help/policy/CMP0152.rst
@@ -16,6 +16,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.28
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0153.rst b/Help/policy/CMP0153.rst
index 838f082..187107c 100644
--- a/Help/policy/CMP0153.rst
+++ b/Help/policy/CMP0153.rst
@@ -9,6 +9,6 @@
 command and has been deprecated since CMake 3.0.
 
 .. |disallowed_version| replace:: 3.28
-.. include:: DISALLOWED_COMMAND.txt
+.. include:: include/DISALLOWED_COMMAND.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0154.rst b/Help/policy/CMP0154.rst
index ebd6561..4c3f7bc 100644
--- a/Help/policy/CMP0154.rst
+++ b/Help/policy/CMP0154.rst
@@ -54,6 +54,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.28
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0155.rst b/Help/policy/CMP0155.rst
index 5397c0d..9e8571c 100644
--- a/Help/policy/CMP0155.rst
+++ b/Help/policy/CMP0155.rst
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.28
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0156.rst b/Help/policy/CMP0156.rst
index 7956742..2258d44 100644
--- a/Help/policy/CMP0156.rst
+++ b/Help/policy/CMP0156.rst
@@ -46,6 +46,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0157.rst b/Help/policy/CMP0157.rst
index c607203..c8f5ea8 100644
--- a/Help/policy/CMP0157.rst
+++ b/Help/policy/CMP0157.rst
@@ -42,6 +42,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0158.rst b/Help/policy/CMP0158.rst
index 66e5a62..4882e15 100644
--- a/Help/policy/CMP0158.rst
+++ b/Help/policy/CMP0158.rst
@@ -23,6 +23,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0159.rst b/Help/policy/CMP0159.rst
index 908ef0f..365fc28 100644
--- a/Help/policy/CMP0159.rst
+++ b/Help/policy/CMP0159.rst
@@ -18,6 +18,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0160.rst b/Help/policy/CMP0160.rst
index 46318ab..2b12358 100644
--- a/Help/policy/CMP0160.rst
+++ b/Help/policy/CMP0160.rst
@@ -34,6 +34,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0161.rst b/Help/policy/CMP0161.rst
index 34bb64c..94e1803 100644
--- a/Help/policy/CMP0161.rst
+++ b/Help/policy/CMP0161.rst
@@ -28,9 +28,9 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 Note that a warning will only be emitted if the
 :variable:`CPACK_BINARY_PRODUCTBUILD <CPACK_BINARY_<GENNAME>>` variable is
 set to true and the project is being built for an Apple platform.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0162.rst b/Help/policy/CMP0162.rst
index df46d96..26c7b4b 100644
--- a/Help/policy/CMP0162.rst
+++ b/Help/policy/CMP0162.rst
@@ -42,6 +42,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0163.rst b/Help/policy/CMP0163.rst
index 40b3535..c710c8b 100644
--- a/Help/policy/CMP0163.rst
+++ b/Help/policy/CMP0163.rst
@@ -32,6 +32,6 @@
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace::
    does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0164.rst b/Help/policy/CMP0164.rst
index 9702cc2..dd7b8b3 100644
--- a/Help/policy/CMP0164.rst
+++ b/Help/policy/CMP0164.rst
@@ -26,6 +26,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn about the behavior change
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0165.rst b/Help/policy/CMP0165.rst
index 7a79c44..4741f04 100644
--- a/Help/policy/CMP0165.rst
+++ b/Help/policy/CMP0165.rst
@@ -21,6 +21,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0166.rst b/Help/policy/CMP0166.rst
index 0534559..fa0c31b 100644
--- a/Help/policy/CMP0166.rst
+++ b/Help/policy/CMP0166.rst
@@ -35,6 +35,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0167.rst b/Help/policy/CMP0167.rst
index 763ef69..2812378 100644
--- a/Help/policy/CMP0167.rst
+++ b/Help/policy/CMP0167.rst
@@ -23,6 +23,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0168.rst b/Help/policy/CMP0168.rst
index ec8ef2a..e39a35c 100644
--- a/Help/policy/CMP0168.rst
+++ b/Help/policy/CMP0168.rst
@@ -67,6 +67,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0169.rst b/Help/policy/CMP0169.rst
index 38b8dcb..5e8ce90 100644
--- a/Help/policy/CMP0169.rst
+++ b/Help/policy/CMP0169.rst
@@ -44,6 +44,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0170.rst b/Help/policy/CMP0170.rst
index 9d7860a..65d47aa 100644
--- a/Help/policy/CMP0170.rst
+++ b/Help/policy/CMP0170.rst
@@ -25,6 +25,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0171.rst b/Help/policy/CMP0171.rst
index c364bf4..904af65 100644
--- a/Help/policy/CMP0171.rst
+++ b/Help/policy/CMP0171.rst
@@ -21,6 +21,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0172.rst b/Help/policy/CMP0172.rst
index c316975..bb5718a 100644
--- a/Help/policy/CMP0172.rst
+++ b/Help/policy/CMP0172.rst
@@ -30,10 +30,10 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
 See documentation of the
 :variable:`CMAKE_POLICY_WARNING_CMP0172 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
 variable to control the warning.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0173.rst b/Help/policy/CMP0173.rst
index 30de19f..39e1e9f 100644
--- a/Help/policy/CMP0173.rst
+++ b/Help/policy/CMP0173.rst
@@ -17,6 +17,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0174.rst b/Help/policy/CMP0174.rst
index 748fdba..3cecc0a 100644
--- a/Help/policy/CMP0174.rst
+++ b/Help/policy/CMP0174.rst
@@ -32,6 +32,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0175.rst b/Help/policy/CMP0175.rst
index a71aadf..13ce568 100644
--- a/Help/policy/CMP0175.rst
+++ b/Help/policy/CMP0175.rst
@@ -35,6 +35,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0176.rst b/Help/policy/CMP0176.rst
index 4683174..7acdd8a 100644
--- a/Help/policy/CMP0176.rst
+++ b/Help/policy/CMP0176.rst
@@ -22,6 +22,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0177.rst b/Help/policy/CMP0177.rst
index 3eca9f3..bfe8f7c 100644
--- a/Help/policy/CMP0177.rst
+++ b/Help/policy/CMP0177.rst
@@ -35,4 +35,4 @@
 if normalized, and uses ``OLD`` behavior.  If a destination path contains a
 generator expression, no such warning will be issued regardless of the value.
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0178.rst b/Help/policy/CMP0178.rst
index f6152eb..d4878c4 100644
--- a/Help/policy/CMP0178.rst
+++ b/Help/policy/CMP0178.rst
@@ -32,6 +32,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0179.rst b/Help/policy/CMP0179.rst
index 7c9498f..7aa83c5 100644
--- a/Help/policy/CMP0179.rst
+++ b/Help/policy/CMP0179.rst
@@ -23,6 +23,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0180.rst b/Help/policy/CMP0180.rst
index f69c0bc..7e42b0f 100644
--- a/Help/policy/CMP0180.rst
+++ b/Help/policy/CMP0180.rst
@@ -31,6 +31,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.31
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0181.rst b/Help/policy/CMP0181.rst
index 807ab05..88c0527 100644
--- a/Help/policy/CMP0181.rst
+++ b/Help/policy/CMP0181.rst
@@ -36,6 +36,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.0
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0182.rst b/Help/policy/CMP0182.rst
index 4cc8603..63f346d 100644
--- a/Help/policy/CMP0182.rst
+++ b/Help/policy/CMP0182.rst
@@ -26,6 +26,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.0
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0183.rst b/Help/policy/CMP0183.rst
index 5d1b59d..6804c3b 100644
--- a/Help/policy/CMP0183.rst
+++ b/Help/policy/CMP0183.rst
@@ -28,6 +28,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.0
 .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0184.rst b/Help/policy/CMP0184.rst
index 5020829..140aaa3 100644
--- a/Help/policy/CMP0184.rst
+++ b/Help/policy/CMP0184.rst
@@ -49,6 +49,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.0
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0185.rst b/Help/policy/CMP0185.rst
index 2020d21..6efa3e7 100644
--- a/Help/policy/CMP0185.rst
+++ b/Help/policy/CMP0185.rst
@@ -20,6 +20,6 @@
 
 .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.0
 .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
-.. include:: STANDARD_ADVICE.txt
+.. include:: include/STANDARD_ADVICE.rst
 
-.. include:: DEPRECATED.txt
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0186.rst b/Help/policy/CMP0186.rst
new file mode 100644
index 0000000..9078a03
--- /dev/null
+++ b/Help/policy/CMP0186.rst
@@ -0,0 +1,43 @@
+CMP0186
+-------
+
+.. versionadded:: 4.1
+
+Regular expressions match ``^`` at most once in repeated searches.
+
+This policy affects commands that perform multiple regular expression
+searches:
+
+* :command:`string(REGEX MATCHALL)`
+* :command:`string(REGEX REPLACE)`
+* :command:`list(TRANSFORM REPLACE)`
+
+and the generator expression :genex:`$<LIST:TRANSFORM,list,REPLACE>`.
+
+CMake 4.0 and below match the ``^`` anchor at the start of every
+successive search, leading to multiple matches:
+
+.. code-block:: cmake
+
+  string(REGEX REPLACE "^a" "b" result "aaaa") # result="bbbb"
+  string(REGEX MATCHALL "^a" result "aaaa")    # result="a;a;a;a"
+
+CMake 4.1 and above prefer to match the ``^`` anchor at most once,
+at the start of the input string:
+
+.. code-block:: cmake
+
+  string(REGEX REPLACE "^a" "b" result "aaaa") # result="abbb"
+  string(REGEX MATCHALL "^a" result "aaaa")    # result="a"
+
+This policy provides compatibility for projects that have not been updated.
+
+The ``OLD`` behavior for this policy is to match ``^`` multiple times,
+at the start of each search.  The ``NEW`` behavior for this policy is
+to match ``^`` at most once, at the start of the input string.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0187.rst b/Help/policy/CMP0187.rst
new file mode 100644
index 0000000..b5664d0
--- /dev/null
+++ b/Help/policy/CMP0187.rst
@@ -0,0 +1,33 @@
+CMP0187
+-------
+
+.. versionadded:: 4.1
+
+Include source file without an extension after the same name with an extension.
+
+In CMake 4.0 and below, if two source files have the same filename and only one
+file has a file extension and the file with the extension is listed first, the
+file without the extension is omitted from the target.
+
+For example, the following library target only include ``hello.c`` in the
+target, but omits the file ``hello``.
+
+.. code-block:: cmake
+
+   add_library(library hello.c hello)
+
+If the file without the extension is listed before the file with the extension,
+both files are included in the target.
+
+Starting in CMake 4.1, CMake includes both files in the library target.
+
+This policy has no effect if :policy:`CMP0115` uses the ``OLD`` behavior.
+
+The ``OLD`` behavior for this policy is to omit the file without the extension.
+The ``NEW`` behavior for this policy is to include it.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0188.rst b/Help/policy/CMP0188.rst
new file mode 100644
index 0000000..98165d1
--- /dev/null
+++ b/Help/policy/CMP0188.rst
@@ -0,0 +1,21 @@
+CMP0188
+-------
+
+.. versionadded:: 4.1
+
+The :module:`FindGCCXML` module is removed.
+
+CMake 4.0 and below provide the :module:`FindGCCXML` module, but the GCC-XML
+tool has long been superseded by CastXML.  CMake 4.1 and above prefer to not
+provide the :module:`FindGCCXML` module.  This policy provides compatibility
+for projects that have not been ported away from it.
+
+The ``OLD`` behavior of this policy is for ``find_package(GCCXML)`` to load
+the deprecated module.  The ``NEW`` behavior is for ``find_package(GCCXML)``
+to fail as if the module does not exist.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0189.rst b/Help/policy/CMP0189.rst
new file mode 100644
index 0000000..71d3520
--- /dev/null
+++ b/Help/policy/CMP0189.rst
@@ -0,0 +1,35 @@
+CMP0189
+-------
+
+.. versionadded:: 4.1
+
+:genex:`TARGET_PROPERTY` evaluates ``LINK_LIBRARIES`` properties transitively.
+
+The :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+target properties record link dependencies through which the
+:genex:`TARGET_PROPERTY` generator expression evaluates transitive properties.
+However, in CMake 4.0 and below, the properties themselves were not evaluated
+transitively.  CMake 4.1 and above prefer to evaluate the
+:prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+target properties transitively because they are among the
+:ref:`build specification <Target Build Specification>` and
+:ref:`usage requirement <Target Usage Requirements>` properties, respectively.
+
+This policy provides compatibility for projects that have not been updated to
+expect the new behavior.  It takes effect during buildsystem generation.
+Generator expressions are evaluated in each directory using the policy setting
+as of the end of its ``CMakeLists.txt``.  As an exception, generator
+expressions evaluated by the :command:`file(GENERATE)` command use the
+policy setting as of its call site.
+
+The ``OLD`` behavior of this policy is for :genex:`TARGET_PROPERTY` to not
+evaluate :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+transitively.  The ``NEW`` behavior is for :genex:`TARGET_PROPERTY` to
+evaluate :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+transitively.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0190.rst b/Help/policy/CMP0190.rst
new file mode 100644
index 0000000..d100649
--- /dev/null
+++ b/Help/policy/CMP0190.rst
@@ -0,0 +1,31 @@
+CMP0190
+-------
+
+.. versionadded:: 4.1
+
+Modules :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
+enforce consistency of artifacts in cross-compiling mode.
+
+Starting with CMake 4.1, Modules :module:`FindPython3`, :module:`FindPython2`
+and :module:`FindPython` apply, in cross-compiling mode (i.e. the
+:variable:`CMAKE_CROSSCOMPILING` variable is set to true), the following
+constraints to the requested components:
+
+* ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+* ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+  The target artifacts will be searched. In this case, the
+  :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+  be used to execute the interpreter or the compiler.
+
+This policy provides compatibility with projects that expect the legacy
+behavior.
+
+The ``OLD`` behavior for this policy does not enforce consistency in
+cross-compiling mode and will, potentially, returns a mix of artifacts
+(i.e. host and target artifacts).
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0191.rst b/Help/policy/CMP0191.rst
new file mode 100644
index 0000000..839bf4a
--- /dev/null
+++ b/Help/policy/CMP0191.rst
@@ -0,0 +1,21 @@
+CMP0191
+-------
+
+.. versionadded:: 4.1
+
+The :module:`FindCABLE` module is removed.
+
+CMake 4.0 and below provide the :module:`FindCABLE` module, but the CABLE
+tool is no longer maintained.  CMake 4.1 and above prefer to not provide
+the :module:`FindCABLE` module.  This policy provides compatibility for
+projects that have not been ported away from it.
+
+The ``OLD`` behavior of this policy is for ``find_package(CABLE)`` to load
+the deprecated module.  The ``NEW`` behavior is for ``find_package(CABLE)``
+to fail as if the module does not exist.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0192.rst b/Help/policy/CMP0192.rst
new file mode 100644
index 0000000..cd86d6d
--- /dev/null
+++ b/Help/policy/CMP0192.rst
@@ -0,0 +1,41 @@
+CMP0192
+-------
+
+.. versionadded:: 4.1
+
+:module:`GNUInstallDirs` uses absolute ``SYSCONFDIR``, ``LOCALSTATEDIR``,
+and ``RUNSTATEDIR`` in special prefixes.
+
+The :module:`GNUInstallDirs` module documents
+:ref:`special cases <GNUInstallDirs special cases>`
+for ``SYSCONFDIR``, ``LOCALSTATEDIR``, and ``RUNSTATEDIR``.
+When :variable:`CMAKE_INSTALL_PREFIX` is a special prefix, e.g., ``/usr``,
+the absolute paths for these directories may be outside the prefix, e.g.,
+``/etc``, ``/var``, and ``/var/run``.
+
+In CMake 4.0 and below, the default values for the ``CMAKE_INSTALL_<dir>``
+variables, for ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR``, and
+``RUNSTATEDIR``, always used relative paths (``etc``, ``var``, ``var/run``),
+and the special cases were implemented only when computing absolute paths
+for the ``CMAKE_INSTALL_FULL_<dir>`` variables.
+CMake 4.1 and above prefer to default ``CMAKE_INSTALL_<dir>`` variables to
+absolute paths, for ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR``,
+and ``RUNSTATEDIR``, when :variable:`CMAKE_INSTALL_PREFIX` is a special
+prefix.  This policy provides compatibility for projects that have not
+been updated to expect this behavior.
+
+The ``OLD`` behavior for this policy is to default ``CMAKE_INSTALL_<dir>``
+variables to relative paths.  The ``NEW`` behavior for this policy is to
+default ``CMAKE_INSTALL_<dir>`` variables to absolute paths, for ``<dir>``
+equal to ``SYSCONFDIR``, ``LOCALSTATEDIR``, and ``RUNSTATEDIR``, when
+:variable:`CMAKE_INSTALL_PREFIX` is a special prefix.
+
+This policy takes effect at the first call of ``include(GNUInstallDirs)``.
+Subsequent calls of ``include(GNUInstallDirs)`` reuse cached
+``CMAKE_INSTALL_<dir>`` values from the first call.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0193.rst b/Help/policy/CMP0193.rst
new file mode 100644
index 0000000..1067cfe
--- /dev/null
+++ b/Help/policy/CMP0193.rst
@@ -0,0 +1,31 @@
+CMP0193
+-------
+
+.. versionadded:: 4.1
+
+:module:`GNUInstallDirs` caches ``CMAKE_INSTALL_*`` with leading ``usr/`` for
+install prefix ``/``.
+
+When :variable:`CMAKE_INSTALL_PREFIX` is ``/``, the ``CMAKE_INSTALL_<dir>``
+variables, for ``<dir>`` equal to ``BINDIR``, ``SBINDIR``, ``LIBEXECDIR``,
+``SHAREDSTATEDIR``, ``INCLUDEDIR``, ``OLDINCLUDEDIR``, ``DATAROOTDIR``, and
+``LIBDIR``, are prepended with a leading ``usr/`` as documented among the
+:ref:`special cases <GNUInstallDirs special cases>`.
+In CMake 4.0 and below, these ``CMAKE_INSTALL_<dir>`` variables were cached
+without their leading ``usr/``, and it was prepended in normal variables that
+shadow their cache entries.
+CMake 4.1 and above prefer to cache ``CMAKE_INSTALL_<dir>`` with their leading
+``usr/``.  Consequently, the :command:`GNUInstallDirs_get_absolute_install_dir`
+command no longer alters the relative input variable argument ``<input-var>``.
+This policy provides compatibility for projects that have not been updated to
+expect the new behavior.
+
+The ``OLD`` behavior for this policy is to cache ``CMAKE_INSTALL_<dir>``
+variables without the leading ``usr/``.  The ``NEW`` behavior for this
+policy is to cache ``CMAKE_INSTALL_<dir>`` variables with the leading ``usr/``.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0194.rst b/Help/policy/CMP0194.rst
new file mode 100644
index 0000000..8b47438
--- /dev/null
+++ b/Help/policy/CMP0194.rst
@@ -0,0 +1,27 @@
+CMP0194
+-------
+
+.. versionadded:: 4.1
+
+MSVC is not an assembler for language ASM.
+
+When enabling the ``ASM`` language, CMake considers C compiler drivers
+as assembler candidates.  CMake 4.0 and below accidentally selected
+MSVC's ``cl`` compiler as the ``CMAKE_ASM_COMPILER``, allowing the ``ASM``
+language to be enabled on Windows even though ``cl`` does not support
+assembler sources.  CMake 4.1 and above prefer to reject ``cl`` as an
+assembler candidate, but some existing projects unconditionally enable
+``ASM`` on Windows even though they add no assembler sources.  This
+policy provides compatibility for such projects to allow them to
+configure as before.
+
+The ``OLD`` behavior for this policy is to successfully enable ``ASM``
+even if ``cl`` is the only available candidate.  The ``NEW`` behavior
+for this policy is to not consider ``cl`` as a candidate assembler
+for the ``ASM`` language.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0195.rst b/Help/policy/CMP0195.rst
new file mode 100644
index 0000000..09f81aa
--- /dev/null
+++ b/Help/policy/CMP0195.rst
@@ -0,0 +1,27 @@
+CMP0195
+-------
+
+.. versionadded:: 4.1
+
+Swift modules in build trees use the Swift module directory structure.
+
+The Swift compiler emits several supplementary files that make up the
+interface to a Swift library.  It accepts finding these files separately
+or in a single swiftmodule directory.  The single file keeps things better
+organized and makes it easier to install the resulting products.
+
+CMake versions 4.1 and above prefer to generate the modules in the
+directory structure when working with a new enough Swift compiler.
+This policy provides compatibility for projects that have not been
+updated to expect the new behavior.
+
+The ``OLD`` behavior for this policy is to emit the interface files directly
+into the current binary directory.
+The ``NEW`` behavior for this policy is to gather the binary swiftmodule and
+other supplemental compiler outputs in a single Swift module directory.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0196.rst b/Help/policy/CMP0196.rst
new file mode 100644
index 0000000..9dfa3cd
--- /dev/null
+++ b/Help/policy/CMP0196.rst
@@ -0,0 +1,23 @@
+CMP0196
+-------
+
+.. versionadded:: 4.1
+
+The :module:`CMakeDetermineVSServicePack` module is removed.
+
+The ``CMakeDetermineVSServicePack`` module has long been superseded by
+the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable, and the module
+has been documented as deprecated since CMake 3.0.  CMake 4.1 and above
+prefer to not provide the module.  This policy provides compatibility
+for projects that have not been ported away from it.
+
+The ``OLD`` behavior of this policy is for
+``include(CMakeDetermineVSServicePack)`` to load the deprecated module.
+The ``NEW`` behavior halts with a fatal error if anything tries to include
+the module.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/CMP0197.rst b/Help/policy/CMP0197.rst
new file mode 100644
index 0000000..6742f7c
--- /dev/null
+++ b/Help/policy/CMP0197.rst
@@ -0,0 +1,45 @@
+CMP0197
+-------
+
+.. versionadded:: 4.1
+
+MSVC link ``-machine:`` flag is not in ``CMAKE_*_LINKER_FLAGS``.
+
+When using MSVC-like compilers in CMake 4.0 and below, the linker's
+``-machine:`` flag is added via language-agnostic linker flag variables:
+
+* :variable:`CMAKE_EXE_LINKER_FLAGS`
+* :variable:`CMAKE_SHARED_LINKER_FLAGS`
+* :variable:`CMAKE_MODULE_LINKER_FLAGS`
+* :variable:`CMAKE_STATIC_LINKER_FLAGS`
+
+This is problematic when multiple languages' toolchains disagree about
+if/how to pass the flag through a compiler driver to the linker.
+Furthermore, carrying the flag in public-facing variables allows projects
+or users to change it even though it is required.
+
+CMake 4.1 and above prefer to leave the ``-machine:`` flag out of
+``CMAKE_*_LINKER_FLAGS`` variables, and instead generate the link
+flag automatically where needed.
+
+This policy provides compatibility with projects that have not been updated
+to expect the lack of the ``-machine:`` flags.  The policy setting takes
+effect as of the first :command:`project` or :command:`enable_language`
+command that initializes the above-listed ``CMAKE_*_LINKER_FLAGS`` variables.
+
+.. note::
+
+  Once the policy has taken effect at the top of a project for a given
+  language, that choice must be used throughout the tree for that language.
+  In projects that have nested projects in subdirectories, be sure to
+  convert everything together.
+
+The ``OLD`` behavior for this policy is to place the MSVC ``-machine:``
+flag in ``CMAKE_*_LINKER_FLAGS``.  The ``NEW`` behavior for this policy
+is to *not* place the MSVC ``-machine:`` flag in ``CMAKE_*_LINKER_FLAGS``.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
+.. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
+.. include:: include/STANDARD_ADVICE.rst
+
+.. include:: include/DEPRECATED.rst
diff --git a/Help/policy/DISALLOWED_COMMAND.txt b/Help/policy/DISALLOWED_COMMAND.txt
deleted file mode 100644
index 506f2bb..0000000
--- a/Help/policy/DISALLOWED_COMMAND.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-CMake >= |disallowed_version| prefer that this command never be called.
-The ``OLD`` behavior for this policy is to allow the command to be called.
-The ``NEW`` behavior for this policy is to issue a ``FATAL_ERROR`` when the
-command is called.
-
-.. |INTRODUCED_IN_CMAKE_VERSION| replace:: |disallowed_version|
-.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
-.. include:: STANDARD_ADVICE.txt
diff --git a/Help/policy/REMOVED_COMMAND.txt b/Help/policy/REMOVED_COMMAND.txt
deleted file mode 100644
index 1c8c963..0000000
--- a/Help/policy/REMOVED_COMMAND.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-CMake >= |disallowed_version| prefer that this command never be called.
-The ``OLD`` behavior for this policy is to allow the command to be called.
-The ``NEW`` behavior for this policy is to issue a ``FATAL_ERROR`` when the
-command is called.
-
-.. |INTRODUCED_IN_CMAKE_VERSION| replace:: |disallowed_version|
-.. |WARNED_OR_DID_NOT_WARN| replace:: warned
-.. include:: REMOVED_EPILOGUE.txt
diff --git a/Help/policy/DEPRECATED.txt b/Help/policy/include/DEPRECATED.rst
similarity index 100%
rename from Help/policy/DEPRECATED.txt
rename to Help/policy/include/DEPRECATED.rst
diff --git a/Help/policy/include/DISALLOWED_COMMAND.rst b/Help/policy/include/DISALLOWED_COMMAND.rst
new file mode 100644
index 0000000..723054d
--- /dev/null
+++ b/Help/policy/include/DISALLOWED_COMMAND.rst
@@ -0,0 +1,8 @@
+CMake >= |disallowed_version| prefer that this command never be called.
+The ``OLD`` behavior for this policy is to allow the command to be called.
+The ``NEW`` behavior for this policy is to issue a ``FATAL_ERROR`` when the
+command is called.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: |disallowed_version|
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: include/STANDARD_ADVICE.rst
diff --git a/Help/policy/include/REMOVED_COMMAND.rst b/Help/policy/include/REMOVED_COMMAND.rst
new file mode 100644
index 0000000..dd6184d
--- /dev/null
+++ b/Help/policy/include/REMOVED_COMMAND.rst
@@ -0,0 +1,8 @@
+CMake >= |disallowed_version| prefer that this command never be called.
+The ``OLD`` behavior for this policy is to allow the command to be called.
+The ``NEW`` behavior for this policy is to issue a ``FATAL_ERROR`` when the
+command is called.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: |disallowed_version|
+.. |WARNED_OR_DID_NOT_WARN| replace:: warned
+.. include:: include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/REMOVED_EPILOGUE.txt b/Help/policy/include/REMOVED_EPILOGUE.rst
similarity index 100%
rename from Help/policy/REMOVED_EPILOGUE.txt
rename to Help/policy/include/REMOVED_EPILOGUE.rst
diff --git a/Help/policy/REMOVED_PROLOGUE.txt b/Help/policy/include/REMOVED_PROLOGUE.rst
similarity index 100%
rename from Help/policy/REMOVED_PROLOGUE.txt
rename to Help/policy/include/REMOVED_PROLOGUE.rst
diff --git a/Help/policy/STANDARD_ADVICE.txt b/Help/policy/include/STANDARD_ADVICE.rst
similarity index 100%
rename from Help/policy/STANDARD_ADVICE.txt
rename to Help/policy/include/STANDARD_ADVICE.rst
diff --git a/Help/prop_dir/COMPILE_DEFINITIONS.rst b/Help/prop_dir/COMPILE_DEFINITIONS.rst
index 5a12c1e..fe31cdb 100644
--- a/Help/prop_dir/COMPILE_DEFINITIONS.rst
+++ b/Help/prop_dir/COMPILE_DEFINITIONS.rst
@@ -22,7 +22,7 @@
 .. versionadded:: 3.26
   Any leading ``-D`` on an item will be removed.
 
-.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
+.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst
 
 Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with
 the syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)`
diff --git a/Help/prop_dir/TEST_INCLUDE_FILE.rst b/Help/prop_dir/TEST_INCLUDE_FILE.rst
index 31b2382..883b124 100644
--- a/Help/prop_dir/TEST_INCLUDE_FILE.rst
+++ b/Help/prop_dir/TEST_INCLUDE_FILE.rst
@@ -1,9 +1,14 @@
 TEST_INCLUDE_FILE
 -----------------
 
-Deprecated.  Use :prop_dir:`TEST_INCLUDE_FILES` instead.
+.. deprecated:: 3.10
 
-A cmake file that will be included when ctest is run.
+  Use the :prop_dir:`TEST_INCLUDE_FILES` directory property instead, which
+  supports specifying multiple files.
 
-If you specify ``TEST_INCLUDE_FILE``, that file will be included and
-processed when ctest is run on the directory.
+The ``TEST_INCLUDE_FILE`` directory property specifies a CMake script that is
+included and processed when ``ctest`` is run on the directory.
+
+If both the ``TEST_INCLUDE_FILE`` and :prop_dir:`TEST_INCLUDE_FILES` directory
+properties are set, the script specified in ``TEST_INCLUDE_FILE`` is included
+first, followed by the scripts listed in ``TEST_INCLUDE_FILES``.
diff --git a/Help/prop_dir/TEST_INCLUDE_FILES.rst b/Help/prop_dir/TEST_INCLUDE_FILES.rst
index f9a66f4..f1c583f 100644
--- a/Help/prop_dir/TEST_INCLUDE_FILES.rst
+++ b/Help/prop_dir/TEST_INCLUDE_FILES.rst
@@ -3,7 +3,38 @@
 
 .. versionadded:: 3.10
 
-A list of cmake files that will be included when ctest is run.
+This directory property specifies a list of CMake scripts to be included and
+processed when ``ctest`` runs on the directory.  Use absolute paths, to avoid
+ambiguity.  Script files are included in the specified order.
 
-If you specify ``TEST_INCLUDE_FILES``, those files will be included and
-processed when ctest is run on the directory.
+``TEST_INCLUDE_FILES`` scripts are processed when running ``ctest``, not during
+the ``cmake`` configuration phase.  These scripts should be written as if they
+were CTest dashboard scripts.  It is common to generate such scripts dynamically
+since many variables and commands available during configuration are not
+accessible at test phase.
+
+Examples
+^^^^^^^^
+
+Setting this directory property to append one or more CMake scripts:
+
+.. code-block:: cmake
+  :caption: CMakeLists.txt
+
+  configure_file(script.cmake.in script.cmake)
+
+  set_property(
+    DIRECTORY
+    APPEND
+    PROPERTY TEST_INCLUDE_FILES
+      ${CMAKE_CURRENT_BINARY_DIR}/script.cmake
+      ${CMAKE_CURRENT_SOURCE_DIR}/foo.cmake
+      ${dir}/bar.cmake
+  )
+
+.. code-block:: cmake
+  :caption: script.cmake.in
+
+  execute_process(
+    COMMAND "@CMAKE_COMMAND@" -E echo "script.cmake executed during CTest"
+  )
diff --git a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
index fd2f941..88ad10e 100644
--- a/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES.rst
@@ -41,4 +41,4 @@
 
   Compiler mode is at least CUDA/C++ 26.
 
-.. include:: CMAKE_LANG_STD_FLAGS.txt
+.. include:: include/CMAKE_LANG_STD_FLAGS.rst
diff --git a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
index 177659a..6c1f234 100644
--- a/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -51,7 +51,7 @@
 
   Compiler mode is at least C++ 26.
 
-.. include:: CMAKE_LANG_STD_FLAGS.txt
+.. include:: include/CMAKE_LANG_STD_FLAGS.rst
 
 Low level individual compile features
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
index 7aca9e8..ccb452b 100644
--- a/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_C_KNOWN_FEATURES.rst
@@ -39,7 +39,7 @@
 
   Compiler mode is at least C 23.
 
-.. include:: CMAKE_LANG_STD_FLAGS.txt
+.. include:: include/CMAKE_LANG_STD_FLAGS.rst
 
 Low level individual compile features
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst
index 9d13c81..d6d2099 100644
--- a/Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst
+++ b/Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst
@@ -39,4 +39,4 @@
 
   Compiler mode is at least HIP/C++ 26.
 
-.. include:: CMAKE_LANG_STD_FLAGS.txt
+.. include:: include/CMAKE_LANG_STD_FLAGS.rst
diff --git a/Help/prop_gbl/CMAKE_ROLE.rst b/Help/prop_gbl/CMAKE_ROLE.rst
index 963dce7..e01443f 100644
--- a/Help/prop_gbl/CMAKE_ROLE.rst
+++ b/Help/prop_gbl/CMAKE_ROLE.rst
@@ -10,10 +10,10 @@
   Running in project mode (processing a ``CMakeLists.txt`` file).
 
 ``SCRIPT``
-  Running in ``-P`` script mode.
+  Running in :ref:`cmake -P <Script Processing Mode>` script mode.
 
 ``FIND_PACKAGE``
-  Running in ``--find-package`` mode.
+  Running in :ref:`cmake --find-package <Find-Package Tool Mode>` mode.
 
 ``CTEST``
   Running in CTest script mode.
diff --git a/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst b/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst
index fec6fda..6ce6da7 100644
--- a/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst
+++ b/Help/prop_gbl/DEBUG_CONFIGURATIONS.rst
@@ -1,13 +1,34 @@
 DEBUG_CONFIGURATIONS
 --------------------
 
-Specify which configurations are for debugging.
+This property specifies which :ref:`Build Configurations` are for debugging.
 
-The value must be a semi-colon separated list of configuration names.
+The value must be a :ref:`semicolon-separated list <CMake Language Lists>` of
+build configuration names.
 Currently this property is used only by the :command:`target_link_libraries`
 command.  Additional uses may be defined in the future.
 
 This property must be set at the top level of the project and before
 the first :command:`target_link_libraries` command invocation.  If any entry in
-the list does not match a valid configuration for the project the
+the list does not match a valid configuration for the project, the
 behavior is undefined.
+
+By default, this property is **not set**.
+
+Examples
+^^^^^^^^
+
+The following example adds a custom configuration to non-optimized debug
+configurations while preserving any existing ones.  If the project uses the
+default ``Debug`` configuration, it should be included as well.
+
+.. code-block:: cmake
+
+  set_property(GLOBAL APPEND PROPERTY DEBUG_CONFIGURATIONS Debug CustomBuild)
+
+See Also
+^^^^^^^^
+
+* The :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` target property, which maps build
+  configurations when linking to :ref:`Imported Targets` that have the
+  :prop_tgt:`IMPORTED_CONFIGURATIONS` property set.
diff --git a/Help/prop_gbl/CMAKE_LANG_STD_FLAGS.txt b/Help/prop_gbl/include/CMAKE_LANG_STD_FLAGS.rst
similarity index 100%
rename from Help/prop_gbl/CMAKE_LANG_STD_FLAGS.txt
rename to Help/prop_gbl/include/CMAKE_LANG_STD_FLAGS.rst
diff --git a/Help/prop_sf/COMPILE_DEFINITIONS.rst b/Help/prop_sf/COMPILE_DEFINITIONS.rst
index d14d637..9c75d40 100644
--- a/Help/prop_sf/COMPILE_DEFINITIONS.rst
+++ b/Help/prop_sf/COMPILE_DEFINITIONS.rst
@@ -13,13 +13,13 @@
 name (ex.  ``COMPILE_DEFINITIONS_DEBUG``).
 
 CMake will automatically drop some definitions that are not supported
-by the native build tool.  Xcode does not support per-configuration
+by the native build tool.  :generator:`Xcode` does not support per-configuration
 definitions on source files.
 
 .. versionadded:: 3.26
   Any leading ``-D`` on an item will be removed.
 
-.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
+.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst
 
 Contents of ``COMPILE_DEFINITIONS`` may use :manual:`cmake-generator-expressions(7)`
 with the syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)`
diff --git a/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst b/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst
index d185d91..ee5624a 100644
--- a/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst
+++ b/Help/prop_sf/MACOSX_PACKAGE_LOCATION.rst
@@ -28,3 +28,8 @@
 into the respective sub-folder. Note: For iOS Apple uses a flat bundle layout
 where no ``Resources`` folder exist. Therefore CMake strips the ``Resources``
 folder name from the specified location.
+
+.. versionadded:: 4.1
+
+  ``MACOSX_PACKAGE_LOCATION`` may be set on a source directory
+  to copy its entire tree into the bundle.
diff --git a/Help/prop_sf/SKIP_LINTING.rst b/Help/prop_sf/SKIP_LINTING.rst
index 0e0a616..fe0f2d4 100644
--- a/Help/prop_sf/SKIP_LINTING.rst
+++ b/Help/prop_sf/SKIP_LINTING.rst
@@ -6,11 +6,11 @@
 This property allows you to exclude a specific source file
 from the linting process. The linting process involves running
 tools such as :prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
-:prop_tgt:`<LANG>_CPPCHECK`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`
-on the source files, as well as compiling header files as part of
-:prop_tgt:`VERIFY_INTERFACE_HEADER_SETS`. By setting ``SKIP_LINTING`` on a
-source file, the mentioned linting tools will not be executed for that
-particular file.
+:prop_tgt:`<LANG>_CPPCHECK`, :prop_tgt:`<LANG>_ICSTAT` and
+:prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE` on the source files, as well
+as compiling header files as part of :prop_tgt:`VERIFY_INTERFACE_HEADER_SETS`.
+By setting ``SKIP_LINTING`` on a source file, the mentioned linting tools
+will not be executed for that particular file.
 
 Example
 ^^^^^^^
@@ -33,8 +33,9 @@
 In the provided code snippet, the ``SKIP_LINTING`` property is set to true
 for the ``generatedBindings.cpp`` source file. As a result, when the linting
 tools specified by :prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
-:prop_tgt:`<LANG>_CPPCHECK`, or :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`
-are executed, they will skip analyzing the ``generatedBindings.cpp`` file.
+:prop_tgt:`<LANG>_CPPCHECK`, :prop_tgt:`<LANG>_ICSTAT` or
+:prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE` are executed, they will skip analyzing
+the ``generatedBindings.cpp`` file.
 
 By using the ``SKIP_LINTING`` property, you can selectively exclude specific
 source files from the linting process. This allows you to focus the
diff --git a/Help/prop_sf/VS_CSHARP_tagname.rst b/Help/prop_sf/VS_CSHARP_tagname.rst
index 77b1e16..1ad7281 100644
--- a/Help/prop_sf/VS_CSHARP_tagname.rst
+++ b/Help/prop_sf/VS_CSHARP_tagname.rst
@@ -5,13 +5,16 @@
 
 Visual Studio and CSharp source-file-specific configuration.
 
-Tell the :manual:`Visual Studio generators <cmake-generators(7)>`
+Tell the :ref:`Visual Studio Generators`
 to set the source file tag ``<tagname>``
 to a given value in the generated Visual Studio CSharp
 project. Ignored on other generators and languages. This property
 can be used to define dependencies between source files or set any
 other Visual Studio specific parameters.
 
+Examples
+^^^^^^^^
+
 Example usage:
 
 .. code-block:: cmake
@@ -20,3 +23,8 @@
            PROPERTIES
            VS_CSHARP_DependentUpon <other file>
            VS_CSHARP_SubType "Form")
+
+See Also
+^^^^^^^^
+
+* The :module:`CSharpUtilities` module for configuring CSharp/.NET targets.
diff --git a/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
index ee49b27..51eb5de 100644
--- a/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
+++ b/Help/prop_sf/VS_DEPLOYMENT_CONTENT.rst
@@ -5,7 +5,7 @@
 
 Mark a source file as content for deployment with a Windows Phone or
 Windows Store application when built with a
-:manual:`Visual Studio generators <cmake-generators(7)>`.
+:ref:`Visual Studio Generators`.
 The value must evaluate to either ``1`` or ``0`` and may use
 :manual:`generator expressions <cmake-generator-expressions(7)>`
 to make the choice based on the build configuration.
diff --git a/Help/prop_sf/VS_SETTINGS.rst b/Help/prop_sf/VS_SETTINGS.rst
index 871e36e..da85f12 100644
--- a/Help/prop_sf/VS_SETTINGS.rst
+++ b/Help/prop_sf/VS_SETTINGS.rst
@@ -3,15 +3,11 @@
 
 .. versionadded:: 3.18
 
-Set any item metadata on a file.
+Add arbitrary MSBuild item metadata to a file.
 
-.. versionadded:: 3.22
-
-  This property is honored for all source file types.
-  Previously it worked only for non-built files.
-
-Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator to set
-``Key`` to ``Value`` as item metadata on the file.
+This property accepts a list of ``Key=Value`` pairs. The Visual Studio
+generator will add these key-value pairs as item metadata to the file.
+:manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
 
 For example:
 
@@ -19,7 +15,21 @@
 
   set_property(SOURCE file.hlsl PROPERTY VS_SETTINGS "Key=Value" "Key2=Value2")
 
-will set ``Key`` to ``Value`` and ``Key2`` to ``Value2`` on the
-``file.hlsl`` item as metadata.
+will set the ``file.hlsl`` item metadata as follows:
 
-:manual:`Generator expressions <cmake-generator-expressions(7)>` are supported.
+.. code-block:: xml
+
+  <FXCompile Include="source_path\file.hlsl">
+    <Key>Value</Key>
+    <Key2>Value2</Key2>
+  </FXCompile>
+
+Together with :prop_sf:`VS_TOOL_OVERRIDE`, this property can be used to
+configure items for custom MSBuild tasks.
+
+Adding the metadata ``ExcludedFromBuild=true`` will exclude the file from
+the build.
+
+.. versionchanged:: 3.22
+  This property is honored for all source file types.
+  Previously, it only worked for source types unknown to CMake.
diff --git a/Help/prop_sf/VS_TOOL_OVERRIDE.rst b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
index b2f4112..57172b6 100644
--- a/Help/prop_sf/VS_TOOL_OVERRIDE.rst
+++ b/Help/prop_sf/VS_TOOL_OVERRIDE.rst
@@ -3,5 +3,13 @@
 
 .. versionadded:: 3.7
 
-Override the default Visual Studio tool that will be applied to the source file
-with a new tool not based on the extension of the file.
+Override the MSBuild item type of a source file in a Visual Studio project.
+
+Together with :prop_sf:`VS_SETTINGS`, this property can be used to configure
+items for custom MSBuild tasks.
+
+Setting the item type to ``None`` will exclude the file from the build.
+
+.. versionchanged:: 3.31
+  This property is honored for all source file types.
+  Previously, it only worked for source types unknown to CMake.
diff --git a/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst
index abb627c..c093c15 100644
--- a/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY.rst
@@ -4,9 +4,9 @@
 .. |XXX| replace:: :ref:`ARCHIVE <Archive Output Artifacts>`
 .. |xxx| replace:: archive
 .. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: :variable:`CMAKE_ARCHIVE_OUTPUT_DIRECTORY`
-.. include:: XXX_OUTPUT_DIRECTORY.txt
+.. include:: include/XXX_OUTPUT_DIRECTORY.rst
 
 .. |IDEM| replace:: in the same directory
-.. include:: MACOS_IMPORT_FILES.txt
+.. include:: include/MACOS_IMPORT_FILES.rst
 
 See also the :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>` target property.
diff --git a/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst
index 12f8bb7..d760a56 100644
--- a/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY_CONFIG.rst
@@ -6,8 +6,9 @@
 
 This is a per-configuration version of the
 :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY` target property, but
-multi-configuration generators (VS, Xcode) do NOT append a
-per-configuration subdirectory to the specified directory.  This
+multi-configuration generators (:ref:`Visual Studio <Visual Studio
+Generators>`, :generator:`Xcode`, :generator:`Ninja Multi-Config`) do NOT
+append a per-configuration subdirectory to the specified directory.  This
 property is initialized by the value of the
 :variable:`CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG>` variable if
 it is set when a target is created.
diff --git a/Help/prop_tgt/ARCHIVE_OUTPUT_NAME.rst b/Help/prop_tgt/ARCHIVE_OUTPUT_NAME.rst
index 1f1c467..5b95a28 100644
--- a/Help/prop_tgt/ARCHIVE_OUTPUT_NAME.rst
+++ b/Help/prop_tgt/ARCHIVE_OUTPUT_NAME.rst
@@ -3,9 +3,9 @@
 
 .. |XXX| replace:: :ref:`ARCHIVE <Archive Output Artifacts>`
 .. |xxx| replace:: archive
-.. include:: XXX_OUTPUT_NAME.txt
+.. include:: include/XXX_OUTPUT_NAME.rst
 
 .. |IDEM| replace:: with the same name
-.. include:: MACOS_IMPORT_FILES.txt
+.. include:: include/MACOS_IMPORT_FILES.rst
 
 See also the :prop_tgt:`ARCHIVE_OUTPUT_NAME_<CONFIG>` target property.
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index b376894..0bd4d13 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -5,10 +5,10 @@
 
 ``AUTOMOC`` is a boolean specifying whether CMake will handle the Qt ``moc``
 preprocessor automatically, i.e.  without having to use commands like
-:module:`QT4_WRAP_CPP() <FindQt4>`, `qt5_wrap_cpp()`_, etc.
+:module:`qt4_wrap_cpp() <FindQt4>`, `qt5_wrap_cpp()`_, etc.
 Currently, Qt versions 4 to 6 are supported.
 
-.. _qt5_wrap_cpp(): https://doc.qt.io/qt-5/qtcore-cmake-qt5-wrap-cpp.html
+.. _qt5_wrap_cpp(): https://doc.qt.io/archives/qt-5.15/qtcore-cmake-qt5-wrap-cpp.html
 
 This property is initialized by the value of the :variable:`CMAKE_AUTOMOC`
 variable if it is set when a target is created.
@@ -34,6 +34,11 @@
 
   and adds these to the scan list.
 
+- The :prop_tgt:`AUTOMOC_INCLUDE_DIRECTORIES` target property may be set
+  to explicitly tell ``moc`` what include directories to search.  If not
+  set, the default is to use the include directories from the target and
+  its transitive closure of dependencies.
+
 At build time, CMake scans each unknown or modified header file from the
 list and searches for
 
@@ -222,6 +227,10 @@
 Compiler pre definitions for ``moc`` are written to the ``moc_predefs.h`` file.
 The generation of this file can be enabled or disabled in this target property.
 
+:prop_tgt:`AUTOMOC_INCLUDE_DIRECTORIES`:
+Specifies one or more include directories for ``AUTOMOC`` to pass explicitly to ``moc``
+instead of automatically discovering a target’s include directories.
+
 :prop_sf:`SKIP_AUTOMOC`:
 Sources and headers can be excluded from ``AUTOMOC`` processing by
 setting this source file property.
diff --git a/Help/prop_tgt/AUTOMOC_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/AUTOMOC_INCLUDE_DIRECTORIES.rst
new file mode 100644
index 0000000..a280ce1
--- /dev/null
+++ b/Help/prop_tgt/AUTOMOC_INCLUDE_DIRECTORIES.rst
@@ -0,0 +1,30 @@
+AUTOMOC_INCLUDE_DIRECTORIES
+---------------------------
+
+.. versionadded:: 4.1
+
+Specifies zero or more include directories for AUTOMOC to pass explicitly to
+the Qt Meta‑Object Compiler (``moc``) instead of automatically discovering a
+target's include directories.
+
+When this property is set on a target, only the directories listed here will be
+used by :prop_tgt:`AUTOMOC`, and any other include paths will be ignored.
+
+This property may contain :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+All directory paths in the final evaluated result **must be absolute**. If any
+non-absolute paths are present after generator expression evaluation,
+configuration will fail with an error.
+
+See also the :variable:`CMAKE_AUTOMOC_INCLUDE_DIRECTORIES` variable, which can
+be used to initialize this property on all targets.
+
+Example
+^^^^^^^
+
+.. code-block:: cmake
+
+  add_library(myQtLib ...)
+  set_property(TARGET myQtLib PROPERTY AUTOMOC_INCLUDE_DIRECTORIES
+    "${CMAKE_CURRENT_SOURCE_DIR}/include/myQtLib"
+  )
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index fea906c..7197cff 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -5,10 +5,10 @@
 
 ``AUTORCC`` is a boolean specifying whether CMake will handle
 the Qt ``rcc`` code generator automatically, i.e. without having to use
-commands like :module:`QT4_ADD_RESOURCES() <FindQt4>`, `qt5_add_resources()`_,
+commands like :module:`qt4_add_resources() <FindQt4>`, `qt5_add_resources()`_,
 etc.  Currently, Qt versions 4 to 6 are supported.
 
-.. _`qt5_add_resources()`: https://doc.qt.io/qt-5/qtcore-cmake-qt5-add-resources.html
+.. _`qt5_add_resources()`: https://doc.qt.io/archives/qt-5.15/qtcore-cmake-qt5-add-resources.html
 
 When this property is ``ON``, CMake will handle ``.qrc`` files added
 as target sources at build time and invoke ``rcc`` accordingly.
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 5010220..6f1c85c 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -5,10 +5,10 @@
 
 ``AUTOUIC`` is a boolean specifying whether CMake will handle
 the Qt ``uic`` code generator automatically, i.e. without having to use
-commands like :module:`QT4_WRAP_UI() <FindQt4>`, `qt5_wrap_ui()`_, etc.
+commands like :module:`qt4_wrap_ui() <FindQt4>`, `qt5_wrap_ui()`_, etc.
 Currently, Qt versions 4 to 6 are supported.
 
-.. _`qt5_wrap_ui()`: https://doc.qt.io/qt-5/qtwidgets-cmake-qt5-wrap-ui.html
+.. _`qt5_wrap_ui()`: https://doc.qt.io/archives/qt-5.15/qtwidgets-cmake-qt5-wrap-ui.html
 
 This property is initialized by the value of the :variable:`CMAKE_AUTOUIC`
 variable if it is set when a target is created.
diff --git a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst
index 7ce0023..02aa548 100644
--- a/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst
+++ b/Help/prop_tgt/COMMON_LANGUAGE_RUNTIME.rst
@@ -6,7 +6,7 @@
 By setting this target property, the target is configured to build with
 ``C++/CLI`` support.
 
-The Visual Studio generator defines the ``clr`` parameter depending on
+The :ref:`Visual Studio Generators` define the ``clr`` parameter depending on
 the value of the ``COMMON_LANGUAGE_RUNTIME`` target property:
 
 Not Set (default)
diff --git a/Help/prop_tgt/COMPILE_DEFINITIONS.rst b/Help/prop_tgt/COMPILE_DEFINITIONS.rst
index c128a9b..56bf3b4 100644
--- a/Help/prop_tgt/COMPILE_DEFINITIONS.rst
+++ b/Help/prop_tgt/COMPILE_DEFINITIONS.rst
@@ -16,7 +16,7 @@
 .. versionadded:: 3.26
   Any leading ``-D`` on an item will be removed.
 
-.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.txt
+.. include:: /include/COMPILE_DEFINITIONS_DISCLAIMER.rst
 
 Contents of ``COMPILE_DEFINITIONS`` may use "generator expressions" with the
 syntax ``$<...>``.  See the :manual:`cmake-generator-expressions(7)` manual
diff --git a/Help/prop_tgt/COMPILE_OPTIONS.rst b/Help/prop_tgt/COMPILE_OPTIONS.rst
index 8b032ad..1b8d53f 100644
--- a/Help/prop_tgt/COMPILE_OPTIONS.rst
+++ b/Help/prop_tgt/COMPILE_OPTIONS.rst
@@ -24,4 +24,4 @@
 for available expressions.  See the :manual:`cmake-buildsystem(7)` manual
 for more on defining buildsystem properties.
 
-.. include:: ../command/OPTIONS_SHELL.txt
+.. include:: ../command/include/OPTIONS_SHELL.rst
diff --git a/Help/prop_tgt/COMPILE_PDB_NAME.rst b/Help/prop_tgt/COMPILE_PDB_NAME.rst
index b76afeb..1b4657e 100644
--- a/Help/prop_tgt/COMPILE_PDB_NAME.rst
+++ b/Help/prop_tgt/COMPILE_PDB_NAME.rst
@@ -9,5 +9,10 @@
 This property specifies the base name for the debug symbols file.
 If not set, the default is unspecified.
 
+.. versionadded:: 4.1
+
+  Contents of ``COMPILE_PDB_NAME`` may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
 .. |PDB_XXX| replace:: :prop_tgt:`PDB_NAME`
-.. include:: COMPILE_PDB_NOTE.txt
+.. include:: include/COMPILE_PDB_NOTE.rst
diff --git a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
index 4c9825d..f21bdc9 100644
--- a/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
+++ b/Help/prop_tgt/COMPILE_PDB_NAME_CONFIG.rst
@@ -8,5 +8,10 @@
 
 This is the configuration-specific version of :prop_tgt:`COMPILE_PDB_NAME`.
 
+.. versionadded:: 4.1
+
+  Contents of ``COMPILE_PDB_NAME_<CONFIG>`` may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
 .. |PDB_XXX| replace:: :prop_tgt:`PDB_NAME_<CONFIG>`
-.. include:: COMPILE_PDB_NOTE.txt
+.. include:: include/COMPILE_PDB_NOTE.rst
diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
index 3f3df66..5bfb50b 100644
--- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY.rst
@@ -7,9 +7,19 @@
 generated by the compiler while building source files.
 
 This property specifies the directory into which the MS debug symbols
-will be placed by the compiler.  This property is initialized by the
-value of the :variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY` variable
-if it is set when a target is created.
+will be placed by the compiler.
+
+.. versionadded:: 3.12
+
+  The property value may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+  Multi-configuration generators append a per-configuration
+  subdirectory to the specified directory unless a generator expression
+  is used.
+
+This property is initialized by the value of the
+:variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY` variable if it is
+set when a target is created.
 
 .. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY`
-.. include:: COMPILE_PDB_NOTE.txt
+.. include:: include/COMPILE_PDB_NOTE.rst
diff --git a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
index c25c2fc..c2d4a94 100644
--- a/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/COMPILE_PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -8,11 +8,17 @@
 
 This is a per-configuration version of
 :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY`,
-but multi-configuration generators (Visual Studio, Xcode) do NOT append a
-per-configuration subdirectory to the specified directory.  This
+but multi-configuration generators (:ref:`Visual Studio <Visual Studio
+Generators>`, :generator:`Xcode`, :generator:`Ninja Multi-Config`) do NOT
+append a per-configuration subdirectory to the specified directory.  This
 property is initialized by the value of the
 :variable:`CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable
 if it is set when a target is created.
 
+.. versionadded:: 3.12
+
+  Contents of ``COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
 .. |PDB_XXX| replace:: :prop_tgt:`PDB_OUTPUT_DIRECTORY_<CONFIG>`
-.. include:: COMPILE_PDB_NOTE.txt
+.. include:: include/COMPILE_PDB_NOTE.rst
diff --git a/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst b/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst
index e937fc6..99954e9 100644
--- a/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst
+++ b/Help/prop_tgt/CUDA_RUNTIME_LIBRARY.rst
@@ -7,7 +7,7 @@
 
 The allowed case insensitive values are:
 
-.. include:: CUDA_RUNTIME_LIBRARY-VALUES.txt
+.. include:: include/CUDA_RUNTIME_LIBRARY-VALUES.rst
 
 Contents of ``CUDA_RUNTIME_LIBRARY`` may use
 :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/prop_tgt/DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/DEBUGGER_WORKING_DIRECTORY.rst
index 3653e9e..f8f2f30 100644
--- a/Help/prop_tgt/DEBUGGER_WORKING_DIRECTORY.rst
+++ b/Help/prop_tgt/DEBUGGER_WORKING_DIRECTORY.rst
@@ -12,7 +12,8 @@
 
 If the :prop_tgt:`VS_DEBUGGER_WORKING_DIRECTORY` property is also set, it will
 take precedence over ``DEBUGGER_WORKING_DIRECTORY`` when using one of the
-Visual Studio generators.
+:ref:`Visual Studio Generators`.
 
 Similarly, if :prop_tgt:`XCODE_SCHEME_WORKING_DIRECTORY` is set, it will
-override ``DEBUGGER_WORKING_DIRECTORY`` when using the Xcode generator.
+override ``DEBUGGER_WORKING_DIRECTORY`` when using the :generator:`Xcode`
+generator.
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index f0200f3..240fcd1 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -26,3 +26,12 @@
 Only the "Ninja Multi-Config" generator supports a property value that varies by
 configuration.  For all other generators the value of this property must be the
 same for all configurations.
+
+See Also
+^^^^^^^^
+
+* To exclude targets from the whole directory subtree, see the
+  :prop_dir:`EXCLUDE_FROM_ALL` directory property.
+
+* To exclude targets from the Visual Studio solution build, use
+  :prop_tgt:`EXCLUDE_FROM_DEFAULT_BUILD`.
diff --git a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
index 664704b..8b9d8d9 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_DEFAULT_BUILD.rst
@@ -1,8 +1,18 @@
 EXCLUDE_FROM_DEFAULT_BUILD
 --------------------------
 
-Exclude target from ``Build Solution``.
+Exclude a target from the solution build configuration.
 
-This property is only used by Visual Studio generators.
-When set to ``TRUE``, the target will not be built when you press
-``Build Solution``.
+This property is only used by :ref:`Visual Studio Generators`. When set to
+``TRUE``, the target will be excluded from the build when the "Build Solution"
+command is run.
+
+This property has a per-configuration version:
+:prop_tgt:`EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>`.
+
+.. note::
+  Solution build configurations do not take project dependencies into account.
+  If a target is excluded, it will not be built, even if another target
+  included in the configuration depends on it. This behavior differs from the
+  CMake-generated ``ALL_BUILD`` target and the :prop_tgt:`EXCLUDE_FROM_ALL`
+  property.
diff --git a/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
index 84d0c1e..7b84902 100644
--- a/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
+++ b/Help/prop_tgt/FRAMEWORK_MULTI_CONFIG_POSTFIX_CONFIG.rst
@@ -4,7 +4,8 @@
 .. versionadded:: 3.18
 
 Postfix to append to the framework file name for configuration ``<CONFIG>``,
-when using a multi-config generator (like Xcode and Ninja Multi-Config).
+when using a multi-config generator (like :generator:`Xcode` and
+:generator:`Ninja Multi-Config`).
 
 When building with configuration ``<CONFIG>`` the value of this property
 is appended to the framework file name built on disk.
diff --git a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst
index cf7bc5b..632337a 100644
--- a/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst
+++ b/Help/prop_tgt/IMPORTED_CXX_MODULES_COMPILE_OPTIONS.rst
@@ -6,4 +6,4 @@
 List of options to pass to the compiler for this ``IMPORTED`` target's C++
 modules.
 
-.. include:: ../command/OPTIONS_SHELL.txt
+.. include:: ../command/include/OPTIONS_SHELL.rst
diff --git a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
index 238395a..611c277 100644
--- a/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
+++ b/Help/prop_tgt/IMPORTED_OBJECTS_CONFIG.rst
@@ -12,9 +12,9 @@
 Xcode Generator Considerations
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-Do not use this ``<CONFIG>``-specific property if you need to use Xcode
-variables like ``$(CURRENT_ARCH)`` or ``$(EFFECTIVE_PLATFORM_NAME)`` in
-the value.  The ``<CONFIG>``-specific properties will be ignored in such
-cases because CMake cannot determine whether a file exists at the
-configuration-specific path at configuration time.  For such cases, use
-:prop_tgt:`IMPORTED_OBJECTS` instead.
+Do not use this ``<CONFIG>``-specific property if you need to use
+:generator:`Xcode` variables like ``$(CURRENT_ARCH)`` or
+``$(EFFECTIVE_PLATFORM_NAME)`` in the value.  The ``<CONFIG>``-specific
+properties will be ignored in such cases because CMake cannot determine
+whether a file exists at the configuration-specific path at configuration
+time.  For such cases, use :prop_tgt:`IMPORTED_OBJECTS` instead.
diff --git a/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst b/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst
index 9cc12a1..deda872 100644
--- a/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst
+++ b/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst
@@ -5,4 +5,4 @@
 .. |command_name| replace:: :command:`target_compile_definitions`
 .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_DEFINITIONS``
 .. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_DEFINITIONS`
-.. include:: INTERFACE_BUILD_PROPERTY.txt
+.. include:: include/INTERFACE_BUILD_PROPERTY.rst
diff --git a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst
index 50d6161..2c2a859 100644
--- a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst
+++ b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst
@@ -7,7 +7,7 @@
 .. |command_name| replace:: :command:`target_compile_features`
 .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_FEATURES``
 .. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_FEATURES`
-.. include:: INTERFACE_BUILD_PROPERTY.txt
+.. include:: include/INTERFACE_BUILD_PROPERTY.rst
 
 See the :manual:`cmake-compile-features(7)` manual for information on compile
 features and a list of supported compilers.
diff --git a/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst b/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst
index 2af7a99..3d529d0 100644
--- a/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst
+++ b/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst
@@ -5,4 +5,4 @@
 .. |command_name| replace:: :command:`target_compile_options`
 .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_OPTIONS``
 .. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_OPTIONS`
-.. include:: INTERFACE_BUILD_PROPERTY.txt
+.. include:: include/INTERFACE_BUILD_PROPERTY.rst
diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
index 8795c80..b69fed5 100644
--- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
+++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst
@@ -5,7 +5,7 @@
 .. |command_name| replace:: :command:`target_include_directories`
 .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_INCLUDE_DIRECTORIES``
 .. |PROPERTY_LINK| replace:: :prop_tgt:`INCLUDE_DIRECTORIES`
-.. include:: INTERFACE_BUILD_PROPERTY.txt
+.. include:: include/INTERFACE_BUILD_PROPERTY.rst
 
 Include directories usage requirements commonly differ between the build-tree
 and the install-tree.  The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
@@ -25,4 +25,4 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_INCLUDE_DIRECTORIES``
-.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt
+.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.rst
diff --git a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst
index 45b3225..845e674 100644
--- a/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_DIRECTORIES.rst
@@ -7,4 +7,4 @@
 .. |command_name| replace:: :command:`target_link_directories`
 .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_DIRECTORIES``
 .. |PROPERTY_LINK| replace:: :prop_tgt:`LINK_DIRECTORIES`
-.. include:: INTERFACE_BUILD_PROPERTY.txt
+.. include:: include/INTERFACE_BUILD_PROPERTY.rst
diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst
index 73d273b..a73c22d 100644
--- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst
@@ -24,7 +24,7 @@
 manual for available expressions.  See the :manual:`cmake-buildsystem(7)`
 manual for more on defining buildsystem properties.
 
-.. include:: LINK_LIBRARIES_INDIRECTION.txt
+.. include:: include/LINK_LIBRARIES_INDIRECTION.rst
 
 ``INTERFACE_LINK_LIBRARIES`` adds transitive link dependencies for a
 target's dependents.  In advanced use cases, one may update the
@@ -32,10 +32,10 @@
 :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` and
 :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE` target properties.
 
-.. include:: ../command/LINK_LIBRARIES_LINKER.txt
+.. include:: ../command/include/LINK_LIBRARIES_LINKER.rst
 
 Creating Relocatable Packages
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_LINK_LIBRARIES``
-.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
+.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.rst
diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst
index c87c825..d0a51e5 100644
--- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.rst
@@ -22,7 +22,7 @@
 target property.
 
 .. |INTERFACE_PROPERTY_LINK_DIRECT| replace:: ``INTERFACE_LINK_LIBRARIES_DIRECT``
-.. include:: INTERFACE_LINK_LIBRARIES_DIRECT.txt
+.. include:: include/INTERFACE_LINK_LIBRARIES_DIRECT.rst
 
 Direct Link Dependencies as Usage Requirements
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst
index 2f8f87f..3ed2afb 100644
--- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE.rst
@@ -28,7 +28,7 @@
 :prop_tgt:`INTERFACE_LINK_LIBRARIES` property on other dependencies.
 
 .. |INTERFACE_PROPERTY_LINK_DIRECT| replace:: ``INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE``
-.. include:: INTERFACE_LINK_LIBRARIES_DIRECT.txt
+.. include:: include/INTERFACE_LINK_LIBRARIES_DIRECT.rst
 
 See the :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` target property
 documentation for more details and examples.
diff --git a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst
index 886adf2..1694da7 100644
--- a/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst
+++ b/Help/prop_tgt/INTERFACE_LINK_OPTIONS.rst
@@ -7,10 +7,10 @@
 .. |command_name| replace:: :command:`target_link_options`
 .. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_LINK_OPTIONS``
 .. |PROPERTY_LINK| replace:: :prop_tgt:`LINK_OPTIONS`
-.. include:: INTERFACE_BUILD_PROPERTY.txt
+.. include:: include/INTERFACE_BUILD_PROPERTY.rst
 
-.. include:: ../command/DEVICE_LINK_OPTIONS.txt
+.. include:: ../command/include/DEVICE_LINK_OPTIONS.rst
 
-.. include:: ../command/OPTIONS_SHELL.txt
+.. include:: ../command/include/OPTIONS_SHELL.rst
 
-.. include:: ../command/LINK_OPTIONS_LINKER.txt
+.. include:: ../command/include/LINK_OPTIONS_LINKER.rst
diff --git a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst
index 0a4ac9a..51ad4b9 100644
--- a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst
+++ b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst
@@ -15,3 +15,9 @@
 There is also the per-configuration :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>`
 target property, which overrides :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION`
 if it is set.
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIPOSupported` module to check whether the compiler
+  supports interprocedural optimization before enabling this target property.
diff --git a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
index 79d4604..8778eb1 100644
--- a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
+++ b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
@@ -10,3 +10,9 @@
 This property is initialized by the
 :variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` variable if it is set
 when a target is created.
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIPOSupported` module to check whether the compiler
+  supports interprocedural optimization before enabling this target property.
diff --git a/Help/prop_tgt/LANG_ICSTAT.rst b/Help/prop_tgt/LANG_ICSTAT.rst
new file mode 100644
index 0000000..58979d4
--- /dev/null
+++ b/Help/prop_tgt/LANG_ICSTAT.rst
@@ -0,0 +1,20 @@
+<LANG>_ICSTAT
+-------------
+
+.. versionadded:: 4.1
+
+This property is supported only when ``<LANG>`` is ``C`` or ``CXX``.
+
+Specify a :ref:`semicolon-separated list <CMake Language Lists>`
+containing a command line for the ``icstat`` static analysis tool.
+The :ref:`Makefile Generators` and the :ref:`Ninja Generators` will
+run ``icstat`` along with the compiler and report any problems.
+The build will fail if the ``icstat`` tool returns non-zero.
+
+This property is initialized by the value of the
+:variable:`CMAKE_<LANG>_ICSTAT` variable if it is set when a target is
+created.  It also supports
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+This lint may be suppressed for individual source files by setting
+the :prop_sf:`SKIP_LINTING` source file property.
diff --git a/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst b/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst
index d39ec20..875cf74 100644
--- a/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_LINKER_LAUNCHER.rst
@@ -3,8 +3,27 @@
 
 .. versionadded:: 3.21
 
-This property is implemented only when ``<LANG>`` is ``C``, ``CXX``,
-``OBJC``, or ``OBJCXX``
+This property is implemented only when ``<LANG>`` is one of:
+
+* ``C``
+
+* ``CXX``
+
+* ``CUDA``
+
+  .. versionadded:: 4.1
+
+* ``OBJC``
+
+* ``OBJCXX``
+
+* ``Fortran``
+
+  .. versionadded:: 4.1
+
+* ``HIP``
+
+  .. versionadded:: 4.1
 
 Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a
 command line for a linker launching tool. The :ref:`Makefile Generators` and the
diff --git a/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst
index 9fbe904..b075369 100644
--- a/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/LIBRARY_OUTPUT_DIRECTORY.rst
@@ -4,6 +4,6 @@
 .. |XXX| replace:: :ref:`LIBRARY <Library Output Artifacts>`
 .. |xxx| replace:: library
 .. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: :variable:`CMAKE_LIBRARY_OUTPUT_DIRECTORY`
-.. include:: XXX_OUTPUT_DIRECTORY.txt
+.. include:: include/XXX_OUTPUT_DIRECTORY.rst
 
 See also the :prop_tgt:`LIBRARY_OUTPUT_DIRECTORY_<CONFIG>` target property.
diff --git a/Help/prop_tgt/LIBRARY_OUTPUT_NAME.rst b/Help/prop_tgt/LIBRARY_OUTPUT_NAME.rst
index 6027f7f..a304357 100644
--- a/Help/prop_tgt/LIBRARY_OUTPUT_NAME.rst
+++ b/Help/prop_tgt/LIBRARY_OUTPUT_NAME.rst
@@ -3,6 +3,6 @@
 
 .. |XXX| replace:: :ref:`LIBRARY <Library Output Artifacts>`
 .. |xxx| replace:: library
-.. include:: XXX_OUTPUT_NAME.txt
+.. include:: include/XXX_OUTPUT_NAME.rst
 
 See also the :prop_tgt:`LIBRARY_OUTPUT_NAME_<CONFIG>` target property.
diff --git a/Help/prop_tgt/LINKER_TYPE.rst b/Help/prop_tgt/LINKER_TYPE.rst
index 23e1e4c..ce1eaeb 100644
--- a/Help/prop_tgt/LINKER_TYPE.rst
+++ b/Help/prop_tgt/LINKER_TYPE.rst
@@ -6,7 +6,7 @@
 Specify which linker will be used for the link step. The property value may use
 :manual:`generator expressions <cmake-generator-expressions(7)>`.
 
-.. include:: ../variable/LINKER_PREDEFINED_TYPES.txt
+.. include:: ../variable/include/LINKER_PREDEFINED_TYPES.rst
 
 This property is not supported on :generator:`Green Hills MULTI` generator.
 
diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst
index 2dcf45c..1c255b1 100644
--- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst
+++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst
@@ -28,4 +28,4 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES``
-.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
+.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.rst
diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst
index 22ee5a6..502616b 100644
--- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst
+++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst
@@ -17,4 +17,4 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES_<CONFIG>``
-.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
+.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.rst
diff --git a/Help/prop_tgt/LINK_LIBRARIES.rst b/Help/prop_tgt/LINK_LIBRARIES.rst
index 8814980..e5aa3c6 100644
--- a/Help/prop_tgt/LINK_LIBRARIES.rst
+++ b/Help/prop_tgt/LINK_LIBRARIES.rst
@@ -22,7 +22,7 @@
 See the :manual:`cmake-buildsystem(7)` manual for more on defining
 buildsystem properties.
 
-.. include:: LINK_LIBRARIES_INDIRECTION.txt
+.. include:: include/LINK_LIBRARIES_INDIRECTION.rst
 
 In advanced use cases, the list of direct link dependencies specified
 by this property may be updated by usage requirements from dependencies.
@@ -34,4 +34,4 @@
 for details on how CMake orders direct link dependencies on linker
 command lines.
 
-.. include:: ../command/LINK_LIBRARIES_LINKER.txt
+.. include:: ../command/include/LINK_LIBRARIES_LINKER.rst
diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst
index fcdac59..fd14c96 100644
--- a/Help/prop_tgt/LINK_OPTIONS.rst
+++ b/Help/prop_tgt/LINK_OPTIONS.rst
@@ -29,8 +29,8 @@
 
   This property must be used in preference to :prop_tgt:`LINK_FLAGS` property.
 
-.. include:: ../command/DEVICE_LINK_OPTIONS.txt
+.. include:: ../command/include/DEVICE_LINK_OPTIONS.rst
 
-.. include:: ../command/OPTIONS_SHELL.txt
+.. include:: ../command/include/OPTIONS_SHELL.rst
 
-.. include:: ../command/LINK_OPTIONS_LINKER.txt
+.. include:: ../command/include/LINK_OPTIONS_LINKER.rst
diff --git a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
index 94ee20d..7758b2c 100644
--- a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
+++ b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
@@ -7,7 +7,7 @@
 
 The allowed values are:
 
-.. include:: MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
+.. include:: include/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification.  For example, the code:
diff --git a/Help/prop_tgt/MSVC_RUNTIME_CHECKS.rst b/Help/prop_tgt/MSVC_RUNTIME_CHECKS.rst
index 72639d5..8b647d4 100644
--- a/Help/prop_tgt/MSVC_RUNTIME_CHECKS.rst
+++ b/Help/prop_tgt/MSVC_RUNTIME_CHECKS.rst
@@ -7,7 +7,7 @@
 
 The allowed values are:
 
-.. include:: MSVC_RUNTIME_CHECKS-VALUES.txt
+.. include:: include/MSVC_RUNTIME_CHECKS-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification.  For example, the code:
diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
index 9f13d38..fd92417 100644
--- a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
+++ b/Help/prop_tgt/MSVC_RUNTIME_LIBRARY.rst
@@ -7,7 +7,7 @@
 
 The allowed values are:
 
-.. include:: MSVC_RUNTIME_LIBRARY-VALUES.txt
+.. include:: include/MSVC_RUNTIME_LIBRARY-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification.  For example, the code:
diff --git a/Help/prop_tgt/PDB_NAME.rst b/Help/prop_tgt/PDB_NAME.rst
index 3a65796..6d9dfd4 100644
--- a/Help/prop_tgt/PDB_NAME.rst
+++ b/Help/prop_tgt/PDB_NAME.rst
@@ -8,5 +8,10 @@
 If not set, the :prop_tgt:`OUTPUT_NAME` target property value or
 logical target name is used by default.
 
+.. versionadded:: 4.1
+
+  Contents of ``PDB_NAME`` may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
 .. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_NAME`
-.. include:: PDB_NOTE.txt
+.. include:: include/PDB_NOTE.rst
diff --git a/Help/prop_tgt/PDB_NAME_CONFIG.rst b/Help/prop_tgt/PDB_NAME_CONFIG.rst
index cb3121c..99ebc4c 100644
--- a/Help/prop_tgt/PDB_NAME_CONFIG.rst
+++ b/Help/prop_tgt/PDB_NAME_CONFIG.rst
@@ -6,5 +6,10 @@
 
 This is the configuration-specific version of :prop_tgt:`PDB_NAME`.
 
+.. versionadded:: 4.1
+
+  Contents of ``PDB_NAME_<CONFIG>`` may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
 .. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_NAME_<CONFIG>`
-.. include:: PDB_NOTE.txt
+.. include:: include/PDB_NOTE.rst
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
index 2f667f3..e576fb0 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY.rst
@@ -5,15 +5,19 @@
 generated by the linker for an executable or shared library target.
 
 This property specifies the directory into which the MS debug symbols
-will be placed by the linker. The property value may use
-:manual:`generator expressions <cmake-generator-expressions(7)>`.
-Multi-configuration generators append a per-configuration
-subdirectory to the specified directory unless a generator expression
-is used.
+will be placed by the linker.
+
+.. versionadded:: 3.12
+
+  The property value may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
+  Multi-configuration generators append a per-configuration
+  subdirectory to the specified directory unless a generator expression
+  is used.
 
 This property is initialized by the value of the
 :variable:`CMAKE_PDB_OUTPUT_DIRECTORY` variable if it is
 set when a target is created.
 
 .. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY`
-.. include:: PDB_NOTE.txt
+.. include:: include/PDB_NOTE.rst
diff --git a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
index 6c55083..47a6f95 100644
--- a/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
+++ b/Help/prop_tgt/PDB_OUTPUT_DIRECTORY_CONFIG.rst
@@ -12,8 +12,10 @@
 :variable:`CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG>` variable if it is
 set when a target is created.
 
-Contents of ``PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
-:manual:`generator expressions <cmake-generator-expressions(7)>`.
+.. versionadded:: 3.12
+
+  Contents of ``PDB_OUTPUT_DIRECTORY_<CONFIG>`` may use
+  :manual:`generator expressions <cmake-generator-expressions(7)>`.
 
 .. |COMPILE_PDB_XXX| replace:: :prop_tgt:`COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>`
-.. include:: PDB_NOTE.txt
+.. include:: include/PDB_NOTE.rst
diff --git a/Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst b/Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst
index 3c37546..8f4e238 100644
--- a/Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst
+++ b/Help/prop_tgt/RUNTIME_OUTPUT_DIRECTORY.rst
@@ -4,6 +4,6 @@
 .. |XXX| replace:: :ref:`RUNTIME <Runtime Output Artifacts>`
 .. |xxx| replace:: runtime
 .. |CMAKE_XXX_OUTPUT_DIRECTORY| replace:: :variable:`CMAKE_RUNTIME_OUTPUT_DIRECTORY`
-.. include:: XXX_OUTPUT_DIRECTORY.txt
+.. include:: include/XXX_OUTPUT_DIRECTORY.rst
 
 See also the :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY_<CONFIG>` target property.
diff --git a/Help/prop_tgt/RUNTIME_OUTPUT_NAME.rst b/Help/prop_tgt/RUNTIME_OUTPUT_NAME.rst
index 11729c3..c9caa3d 100644
--- a/Help/prop_tgt/RUNTIME_OUTPUT_NAME.rst
+++ b/Help/prop_tgt/RUNTIME_OUTPUT_NAME.rst
@@ -3,6 +3,6 @@
 
 .. |XXX| replace:: :ref:`RUNTIME <Runtime Output Artifacts>`
 .. |xxx| replace:: runtime
-.. include:: XXX_OUTPUT_NAME.txt
+.. include:: include/XXX_OUTPUT_NAME.rst
 
 See also the :prop_tgt:`RUNTIME_OUTPUT_NAME_<CONFIG>` target property.
diff --git a/Help/prop_tgt/SOVERSION.rst b/Help/prop_tgt/SOVERSION.rst
index 4f8b1b5..9f874ad 100644
--- a/Help/prop_tgt/SOVERSION.rst
+++ b/Help/prop_tgt/SOVERSION.rst
@@ -10,7 +10,7 @@
 specified the missing is assumed to have the same version number.
 ``SOVERSION`` is ignored if :prop_tgt:`NO_SONAME` property is set.
 
-.. include:: VERSION_SOVERSION_EXAMPLE.txt
+.. include:: include/VERSION_SOVERSION_EXAMPLE.rst
 
 Windows Versions
 ^^^^^^^^^^^^^^^^
diff --git a/Help/prop_tgt/SPDX_LICENSE.rst b/Help/prop_tgt/SPDX_LICENSE.rst
new file mode 100644
index 0000000..056c860
--- /dev/null
+++ b/Help/prop_tgt/SPDX_LICENSE.rst
@@ -0,0 +1,14 @@
+SPDX_LICENSE
+------------
+
+.. versionadded:: 4.1
+
+Specify the license of a target using a |SPDX|_ (SPDX) `License Expression`_.
+See the SPDX `License List`_ for a list of commonly used licenses and their
+identifiers.
+
+.. _SPDX: https://spdx.dev/
+.. |SPDX| replace:: System Package Data Exchange
+
+.. _License Expression: https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/
+.. _License List: https://spdx.org/licenses/
diff --git a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
index 370c75c..2a9c4a9 100644
--- a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
+++ b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
@@ -21,6 +21,6 @@
   This property must be used in preference to :prop_tgt:`STATIC_LIBRARY_FLAGS`
   property.
 
-.. include:: ../command/OPTIONS_SHELL.txt
+.. include:: ../command/include/OPTIONS_SHELL.rst
 
-.. include:: ../prop_tgt/STATIC_LIBRARY_OPTIONS_ARCHIVER.txt
+.. include:: ../prop_tgt/include/STATIC_LIBRARY_OPTIONS_ARCHIVER.rst
diff --git a/Help/prop_tgt/Swift_COMPILATION_MODE.rst b/Help/prop_tgt/Swift_COMPILATION_MODE.rst
index e26474a..955dad0 100644
--- a/Help/prop_tgt/Swift_COMPILATION_MODE.rst
+++ b/Help/prop_tgt/Swift_COMPILATION_MODE.rst
@@ -7,7 +7,7 @@
 
 The allowed values are:
 
-.. include:: Swift_COMPILATION_MODE-VALUES.txt
+.. include:: include/Swift_COMPILATION_MODE-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to support
 per-configuration specification. For example, the code:
diff --git a/Help/prop_tgt/VERSION.rst b/Help/prop_tgt/VERSION.rst
index f9cb020..28ddb5d 100644
--- a/Help/prop_tgt/VERSION.rst
+++ b/Help/prop_tgt/VERSION.rst
@@ -12,7 +12,7 @@
 building or installing appropriate symlinks are created if the
 platform supports symlinks.
 
-.. include:: VERSION_SOVERSION_EXAMPLE.txt
+.. include:: include/VERSION_SOVERSION_EXAMPLE.rst
 
 Windows Versions
 ^^^^^^^^^^^^^^^^
diff --git a/Help/prop_tgt/VS_GLOBAL_variable.rst b/Help/prop_tgt/VS_GLOBAL_variable.rst
index 56b8021..3084707 100644
--- a/Help/prop_tgt/VS_GLOBAL_variable.rst
+++ b/Help/prop_tgt/VS_GLOBAL_variable.rst
@@ -3,8 +3,8 @@
 
 Visual Studio project-specific global variable.
 
-Tell the Visual Studio generator to set the global variable
-'<variable>' to a given value in the generated Visual Studio project.
-Ignored on other generators.  Qt integration works better if
-VS_GLOBAL_QtVersion is set to the version FindQt4.cmake found.  For
-example, "4.7.3"
+Tell the :ref:`Visual Studio Generators` to set the global variable
+``<variable>`` to a given value in the generated Visual Studio project.
+Ignored on other generators.  For example, Qt integration works better if
+``VS_GLOBAL_QtVersion`` is set to the version ``FindQt4.cmake`` found.  For
+example, ``4.7.3``
diff --git a/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
index b5a76fc..0c8009d 100644
--- a/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
+++ b/Help/prop_tgt/VS_SOURCE_SETTINGS_tool.rst
@@ -5,7 +5,7 @@
 
 Set any item metadata on all non-built files that use <tool>.
 
-Takes a list of ``Key=Value`` pairs. Tells the Visual Studio generator
+Takes a list of ``Key=Value`` pairs. Tells the :ref:`Visual Studio Generators`
 to set ``Key`` to ``Value`` as item metadata on all non-built files
 that use ``<tool>``.
 
diff --git a/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst b/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst
index 3d5ada4..f25e2a7 100644
--- a/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst
+++ b/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES.rst
@@ -6,7 +6,7 @@
 .. |VS_USE_DEBUG_LIBRARIES| replace:: ``VS_USE_DEBUG_LIBRARIES``
 .. |MSVC_RUNTIME_LIBRARY| replace:: :prop_tgt:`MSVC_RUNTIME_LIBRARY`
 
-.. include:: VS_USE_DEBUG_LIBRARIES-PURPOSE.txt
+.. include:: include/VS_USE_DEBUG_LIBRARIES-PURPOSE.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>`
 for per-configuration specification.  For example, the code:
diff --git a/Help/prop_tgt/VS_WINRT_COMPONENT.rst b/Help/prop_tgt/VS_WINRT_COMPONENT.rst
index 8b4aaf7..8deea55 100644
--- a/Help/prop_tgt/VS_WINRT_COMPONENT.rst
+++ b/Help/prop_tgt/VS_WINRT_COMPONENT.rst
@@ -3,11 +3,11 @@
 
 .. versionadded:: 3.1
 
-Mark a target as a Windows Runtime component for the Visual Studio generator.
+Mark a target as a Windows Runtime component for the :ref:`Visual Studio Generators`.
 Compile the target with ``C++/CX`` language extensions for Windows Runtime.
 For ``SHARED`` and ``MODULE`` libraries, this also defines the
 ``_WINRT_DLL`` preprocessor macro.
 
 .. note::
-  Currently this is implemented only by Visual Studio generators.
+  Currently this is implemented only by :ref:`Visual Studio Generators`.
   Support may be added to other generators in the future.
diff --git a/Help/prop_tgt/WATCOM_RUNTIME_LIBRARY.rst b/Help/prop_tgt/WATCOM_RUNTIME_LIBRARY.rst
index 3752862..4f9b8e9 100644
--- a/Help/prop_tgt/WATCOM_RUNTIME_LIBRARY.rst
+++ b/Help/prop_tgt/WATCOM_RUNTIME_LIBRARY.rst
@@ -7,7 +7,7 @@
 
 The allowed values are:
 
-.. include:: WATCOM_RUNTIME_LIBRARY-VALUES.txt
+.. include:: include/WATCOM_RUNTIME_LIBRARY-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification.
diff --git a/Help/prop_tgt/XCTEST.rst b/Help/prop_tgt/XCTEST.rst
index 67e9a70..54d875a 100644
--- a/Help/prop_tgt/XCTEST.rst
+++ b/Help/prop_tgt/XCTEST.rst
@@ -3,13 +3,14 @@
 
 .. versionadded:: 3.3
 
-This target is a XCTest CFBundle on the Mac.
+Boolean target property that indicates whether a target is an XCTest CFBundle
+(Core Foundation Bundle) on Apple systems.
 
-This property will usually get set via the :command:`xctest_add_bundle`
-macro in :module:`FindXCTest` module.
+This property is usually set automatically by the :command:`xctest_add_bundle`
+command provided by the :module:`FindXCTest` module.
 
-If a module library target has this property set to true it will be
-built as a CFBundle when built on the Mac.  It will have the directory
-structure required for a CFBundle.
+If a module library target has this property set to boolean true, it will be
+built as a CFBundle when built on Apple system, with the required CFBundle
+directory structure.
 
-This property depends on :prop_tgt:`BUNDLE` to be effective.
+This property depends on :prop_tgt:`BUNDLE` target property to be effective.
diff --git a/Help/prop_tgt/COMPILE_PDB_NOTE.txt b/Help/prop_tgt/include/COMPILE_PDB_NOTE.rst
similarity index 100%
rename from Help/prop_tgt/COMPILE_PDB_NOTE.txt
rename to Help/prop_tgt/include/COMPILE_PDB_NOTE.rst
diff --git a/Help/prop_tgt/CUDA_RUNTIME_LIBRARY-VALUES.txt b/Help/prop_tgt/include/CUDA_RUNTIME_LIBRARY-VALUES.rst
similarity index 100%
rename from Help/prop_tgt/CUDA_RUNTIME_LIBRARY-VALUES.txt
rename to Help/prop_tgt/include/CUDA_RUNTIME_LIBRARY-VALUES.rst
diff --git a/Help/prop_tgt/INTERFACE_BUILD_PROPERTY.txt b/Help/prop_tgt/include/INTERFACE_BUILD_PROPERTY.rst
similarity index 100%
rename from Help/prop_tgt/INTERFACE_BUILD_PROPERTY.txt
rename to Help/prop_tgt/include/INTERFACE_BUILD_PROPERTY.rst
diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.txt b/Help/prop_tgt/include/INTERFACE_LINK_LIBRARIES_DIRECT.rst
similarity index 100%
rename from Help/prop_tgt/INTERFACE_LINK_LIBRARIES_DIRECT.txt
rename to Help/prop_tgt/include/INTERFACE_LINK_LIBRARIES_DIRECT.rst
diff --git a/Help/prop_tgt/LINK_LIBRARIES_INDIRECTION.txt b/Help/prop_tgt/include/LINK_LIBRARIES_INDIRECTION.rst
similarity index 100%
rename from Help/prop_tgt/LINK_LIBRARIES_INDIRECTION.txt
rename to Help/prop_tgt/include/LINK_LIBRARIES_INDIRECTION.rst
diff --git a/Help/prop_tgt/MACOS_IMPORT_FILES.txt b/Help/prop_tgt/include/MACOS_IMPORT_FILES.rst
similarity index 100%
rename from Help/prop_tgt/MACOS_IMPORT_FILES.txt
rename to Help/prop_tgt/include/MACOS_IMPORT_FILES.rst
diff --git a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt b/Help/prop_tgt/include/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.rst
similarity index 100%
rename from Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
rename to Help/prop_tgt/include/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.rst
diff --git a/Help/prop_tgt/MSVC_RUNTIME_CHECKS-VALUES.txt b/Help/prop_tgt/include/MSVC_RUNTIME_CHECKS-VALUES.rst
similarity index 100%
rename from Help/prop_tgt/MSVC_RUNTIME_CHECKS-VALUES.txt
rename to Help/prop_tgt/include/MSVC_RUNTIME_CHECKS-VALUES.rst
diff --git a/Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt b/Help/prop_tgt/include/MSVC_RUNTIME_LIBRARY-VALUES.rst
similarity index 100%
rename from Help/prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt
rename to Help/prop_tgt/include/MSVC_RUNTIME_LIBRARY-VALUES.rst
diff --git a/Help/prop_tgt/PDB_NOTE.txt b/Help/prop_tgt/include/PDB_NOTE.rst
similarity index 100%
rename from Help/prop_tgt/PDB_NOTE.txt
rename to Help/prop_tgt/include/PDB_NOTE.rst
diff --git a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS_ARCHIVER.txt b/Help/prop_tgt/include/STATIC_LIBRARY_OPTIONS_ARCHIVER.rst
similarity index 100%
rename from Help/prop_tgt/STATIC_LIBRARY_OPTIONS_ARCHIVER.txt
rename to Help/prop_tgt/include/STATIC_LIBRARY_OPTIONS_ARCHIVER.rst
diff --git a/Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt b/Help/prop_tgt/include/Swift_COMPILATION_MODE-VALUES.rst
similarity index 100%
rename from Help/prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
rename to Help/prop_tgt/include/Swift_COMPILATION_MODE-VALUES.rst
diff --git a/Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt b/Help/prop_tgt/include/VERSION_SOVERSION_EXAMPLE.rst
similarity index 100%
rename from Help/prop_tgt/VERSION_SOVERSION_EXAMPLE.txt
rename to Help/prop_tgt/include/VERSION_SOVERSION_EXAMPLE.rst
diff --git a/Help/prop_tgt/VS_USE_DEBUG_LIBRARIES-PURPOSE.txt b/Help/prop_tgt/include/VS_USE_DEBUG_LIBRARIES-PURPOSE.rst
similarity index 100%
rename from Help/prop_tgt/VS_USE_DEBUG_LIBRARIES-PURPOSE.txt
rename to Help/prop_tgt/include/VS_USE_DEBUG_LIBRARIES-PURPOSE.rst
diff --git a/Help/prop_tgt/WATCOM_RUNTIME_LIBRARY-VALUES.txt b/Help/prop_tgt/include/WATCOM_RUNTIME_LIBRARY-VALUES.rst
similarity index 100%
rename from Help/prop_tgt/WATCOM_RUNTIME_LIBRARY-VALUES.txt
rename to Help/prop_tgt/include/WATCOM_RUNTIME_LIBRARY-VALUES.rst
diff --git a/Help/prop_tgt/XXX_OUTPUT_DIRECTORY.txt b/Help/prop_tgt/include/XXX_OUTPUT_DIRECTORY.rst
similarity index 100%
rename from Help/prop_tgt/XXX_OUTPUT_DIRECTORY.txt
rename to Help/prop_tgt/include/XXX_OUTPUT_DIRECTORY.rst
diff --git a/Help/prop_tgt/XXX_OUTPUT_NAME.txt b/Help/prop_tgt/include/XXX_OUTPUT_NAME.rst
similarity index 100%
rename from Help/prop_tgt/XXX_OUTPUT_NAME.txt
rename to Help/prop_tgt/include/XXX_OUTPUT_NAME.rst
diff --git a/Help/release/3.0.rst b/Help/release/3.0.rst
index 006ba0c..fe9fe1b 100644
--- a/Help/release/3.0.rst
+++ b/Help/release/3.0.rst
@@ -205,9 +205,9 @@
 Modules
 -------
 
-* The :module:`CheckTypeSize` module ``check_type_size`` macro and
-  the :module:`CheckStructHasMember` module ``check_struct_has_member``
-  macro learned a new ``LANGUAGE`` option to optionally check C++ types.
+* The :module:`CheckTypeSize` module ``check_type_size()`` command and
+  the :module:`CheckStructHasMember` module ``check_struct_has_member()``
+  command learned a new ``LANGUAGE`` option to optionally check C++ types.
 
 * The :module:`ExternalData` module learned to work with no
   URL templates if a local store is available.
@@ -391,7 +391,7 @@
   :command:`target_compile_options` command instead.
 
 * The :module:`GenerateExportHeader` module ``add_compiler_export_flags``
-  function is now deprecated.  It has been superseded by the
+  command is now deprecated.  It has been superseded by the
   :prop_tgt:`<LANG>_VISIBILITY_PRESET` and
   :prop_tgt:`VISIBILITY_INLINES_HIDDEN` target properties.
 
diff --git a/Help/release/3.1.rst b/Help/release/3.1.rst
index 0ae9233..9d7cddf 100644
--- a/Help/release/3.1.rst
+++ b/Help/release/3.1.rst
@@ -191,7 +191,7 @@
   meant for a prefix other than :variable:`CMAKE_INSTALL_PREFIX`.
 
 * The :module:`CheckFortranSourceCompiles` module was added to
-  provide a ``CHECK_Fortran_SOURCE_COMPILES`` macro.
+  provide a ``check_fortran_source_compiles()`` command.
 
 * The :module:`ExternalData` module learned to tolerate a ``DATA{}``
   reference to a missing source file with a warning instead of
@@ -235,7 +235,7 @@
 
 * The :module:`FindGLUT` module now provides imported targets.
 
-* The :module:`FindHg` module gained a new ``Hg_WC_INFO`` macro to
+* The :module:`FindHg` module gained a new ``Hg_WC_INFO`` command to
   help run ``hg`` to extract information about a Mercurial work copy.
 
 * The :module:`FindOpenCL` module was introduced.
@@ -250,7 +250,7 @@
 * The :module:`FindZLIB` module now provides imported targets.
 
 * The :module:`GenerateExportHeader` module ``generate_export_header``
-  function learned to allow use with :ref:`Object Libraries`.
+  command learned to allow use with :ref:`Object Libraries`.
 
 * The :module:`InstallRequiredSystemLibraries` module gained a new
   ``CMAKE_INSTALL_OPENMP_LIBRARIES`` option to install MSVC OpenMP
diff --git a/Help/release/3.11.rst b/Help/release/3.11.rst
index c2c15eb..d618ff0 100644
--- a/Help/release/3.11.rst
+++ b/Help/release/3.11.rst
@@ -153,7 +153,7 @@
 * The :module:`FindBLAS` and :module:`FindLAPACK` modules learned to support
   `FLAME`_ ``blis`` and ``libflame``.
 
-* The :module:`FindDoxygen` module :command:`doxygen_add_docs` function
+* The :module:`FindDoxygen` module :command:`doxygen_add_docs` command
   now supports a new ``DOXYGEN_VERBATIM_VARS`` list variable.  Any
   ``DOXYGEN_...`` variable contained in that list will bypass the automatic
   quoting logic, leaving its contents untouched when transferring them to the
@@ -276,9 +276,9 @@
 3.11.1
 ------
 
-* The :module:`CheckIncludeFile` module ``check_include_file`` macro,
-  :module:`CheckIncludeFileCXX` module ``check_include_file_cxx`` macro,
-  and :module:`CheckIncludeFiles` module ``check_include_files`` macro
+* The :module:`CheckIncludeFile` module ``check_include_file()`` command,
+  :module:`CheckIncludeFileCXX` module ``check_include_file_cxx()`` command,
+  and :module:`CheckIncludeFiles` module ``check_include_files()`` command
   were taught to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable in
   CMake 3.11.0.  This has been reverted due to changing behavior of
   checks for existing projects.  It may be restored in the future
diff --git a/Help/release/3.12.rst b/Help/release/3.12.rst
index dcdae1d..0a8f6d5 100644
--- a/Help/release/3.12.rst
+++ b/Help/release/3.12.rst
@@ -282,15 +282,15 @@
   :command:`install` documentation so that external packaging software can take
   advantage of CPack-style component installs.
 
-* The :module:`CheckIncludeFile` module ``check_include_file`` macro
+* The :module:`CheckIncludeFile` module ``check_include_file()`` command
   learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
   See policy :policy:`CMP0075`.
 
-* The :module:`CheckIncludeFileCXX` module ``check_include_file_cxx`` macro
+* The :module:`CheckIncludeFileCXX` module ``check_include_file_cxx()`` command
   learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
   See policy :policy:`CMP0075`.
 
-* The :module:`CheckIncludeFiles` module ``check_include_files`` macro
+* The :module:`CheckIncludeFiles` module ``check_include_files()`` command
   learned to honor the ``CMAKE_REQUIRED_LIBRARIES`` variable.
   See policy :policy:`CMP0075`.
 
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
index f46a417..6b3a187 100644
--- a/Help/release/3.14.rst
+++ b/Help/release/3.14.rst
@@ -193,7 +193,7 @@
   each one to the main build using the canonical pattern.  This
   significantly reduces the amount of boilerplate needed in a project.
 
-* The :module:`FindBISON` module's ``BISON_TARGET`` command now runs ``bison``
+* The :module:`FindBISON` module's ``bison_target()`` command now runs ``bison``
   with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
   See policy :policy:`CMP0088`.
 
diff --git a/Help/release/3.17.rst b/Help/release/3.17.rst
index 63ec423..3808e0b 100644
--- a/Help/release/3.17.rst
+++ b/Help/release/3.17.rst
@@ -170,7 +170,7 @@
   CURL's cmake buildsystem.  It also gained a new ``CURL_NO_CURL_CMAKE``
   option to disable this behavior.
 
-* The :module:`FindFLEX` module's ``FLEX_TARGET`` command now runs ``flex``
+* The :module:`FindFLEX` module's ``flex_target()`` command now runs ``flex``
   with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
   See policy :policy:`CMP0098`.
 
diff --git a/Help/release/3.22.rst b/Help/release/3.22.rst
index 2d060ac..efc8115 100644
--- a/Help/release/3.22.rst
+++ b/Help/release/3.22.rst
@@ -58,7 +58,7 @@
 -------
 
 * The :module:`CMakeDependentOption` module :command:`cmake_dependent_option`
-  macro now supports full :ref:`Condition Syntax`.
+  command now supports full :ref:`Condition Syntax`.
   See policy :policy:`CMP0127`.
 
 * The :module:`FetchContent` module now passes through the
diff --git a/Help/release/3.23.rst b/Help/release/3.23.rst
index 5d85777..20e43c5 100644
--- a/Help/release/3.23.rst
+++ b/Help/release/3.23.rst
@@ -78,7 +78,9 @@
   has been updated to ``2.4``.
 
 * The :manual:`cmake-file-api(7)` "codemodel" version 2 ``directory``
-  object ``installers`` field gained a new ``fileSet`` installer type.
+  object ``installers`` field gained a new ``fileSet`` installer type
+  and associated ``fileSetName``, ``fileSetType``, ``fileSetDirectories``,
+  and ``fileSetTarget`` fields.
 
 Commands
 --------
diff --git a/Help/release/3.25.rst b/Help/release/3.25.rst
index 646c5ba..62078a7 100644
--- a/Help/release/3.25.rst
+++ b/Help/release/3.25.rst
@@ -163,8 +163,8 @@
   :command:`FetchContent_MakeAvailable`.
 
 * The :module:`FindCUDAToolkit` module now provides a target for
-  :ref:`nvtx3 <cuda_toolkit_nvtx3>` for CUDA 10.0+, which supersedes
-  :ref:`nvToolsExt <cuda_toolkit_nvToolsExt>`. A deprecation warning
+  :ref:`nvtx3 <FindCUDAToolkit_nvtx3>` for CUDA 10.0+, which supersedes
+  :ref:`nvToolsExt <FindCUDAToolkit_nvToolsExt>`. A deprecation warning
   is emitted when using ``nvToolsExt`` if the project requires CMake
   3.25 and CUDA 10.0+ is used.
 
diff --git a/Help/release/3.26.rst b/Help/release/3.26.rst
index 72ffad8..97cf426 100644
--- a/Help/release/3.26.rst
+++ b/Help/release/3.26.rst
@@ -42,6 +42,10 @@
   gained a new ``fileSets`` field and associated ``fileSetIndex``
   field to ``sources`` objects.
 
+* The :manual:`cmake-file-api(7)` "codemodel" version 2 "directory"
+  object ``installers`` field gained a new ``cxxModuleBmi`` installer type
+  and an associated ``cxxModuleBmiTarget`` field.
+
 * The :manual:`cmake-file-api(7)` gained a new "configureLog" object kind
   that enables stable access to the :manual:`cmake-configure-log(7)`.
 
diff --git a/Help/release/3.4.rst b/Help/release/3.4.rst
index abfede6..ee7bf27 100644
--- a/Help/release/3.4.rst
+++ b/Help/release/3.4.rst
@@ -117,7 +117,7 @@
   useful with the :generator:`Ninja` generator to monitor CMake
   superbuild progress and prevent CPU oversubscription.
 
-* The :module:`FindBISON` module ``BISON_TARGET`` macro learned a
+* The :module:`FindBISON` module ``bison_target()`` command learned a
   new ``DEFINES_FILE`` option to specify a custom output header
   to be generated.
 
@@ -140,7 +140,7 @@
   (such as for related tools or data and plugin install paths).
 
 * The :module:`FindProtobuf` module gained a new
-  :command:`protobuf_generate_python` function to generate python
+  :command:`protobuf_generate_python` command to generate Python
   sources from ``.proto`` files.
 
 * The :module:`FindTIFF` module learned to search separately for
diff --git a/Help/release/3.5.rst b/Help/release/3.5.rst
index e877164..31a4b53 100644
--- a/Help/release/3.5.rst
+++ b/Help/release/3.5.rst
@@ -73,7 +73,7 @@
 * The :module:`FindBoost` module now provides imported targets
   such as ``Boost::boost`` and ``Boost::filesystem``.
 
-* The :module:`FindFLEX` module ``FLEX_TARGET`` macro learned a
+* The :module:`FindFLEX` module ``flex_target()`` command learned a
   new ``DEFINES_FILE`` option to specify a custom output header
   to be generated.
 
diff --git a/Help/release/3.6.rst b/Help/release/3.6.rst
index 92b1012..982fe9c 100644
--- a/Help/release/3.6.rst
+++ b/Help/release/3.6.rst
@@ -283,12 +283,12 @@
   files in different directories use ``#include <moc_foo.cpp>`` with the
   same name (because the generated ``moc_foo.cpp`` files would collide).
 
-* The :module:`FindBISON` module ``BISON_TARGET`` macro now supports
+* The :module:`FindBISON` module ``bison_target()`` command now supports
   special characters by passing the ``VERBATIM`` option to internal
   :command:`add_custom_command` calls.  This may break clients that
   added escaping manually to work around the bug.
 
-* The :module:`FindFLEX` module ``FLEX_TARGET`` macro now supports
+* The :module:`FindFLEX` module ``flex_target()`` command now supports
   special characters by passing the ``VERBATIM`` option to internal
   :command:`add_custom_command` calls.  This may break clients that
   added escaping manually to work around the bug.
diff --git a/Help/release/3.7.rst b/Help/release/3.7.rst
index 9656a54..e52f361 100644
--- a/Help/release/3.7.rst
+++ b/Help/release/3.7.rst
@@ -158,8 +158,8 @@
 * An :module:`AndroidTestUtilities` module was added to manage transfer
   of test data to an Android device.
 
-* The :module:`CheckFortranSourceCompiles` module macro
-  ``CHECK_Fortran_SOURCE_COMPILES`` gained a ``SRC_EXT`` option
+* The :module:`CheckFortranSourceCompiles` module command
+  ``check_fortran_source_compiles()`` gained a ``SRC_EXT`` option
   to specify a custom test Fortran source file extension.
 
 * The :module:`ExternalProject` module gained ``HTTP_USERNAME`` and
@@ -168,7 +168,7 @@
 * The :module:`ExternalProject` module gained a ``HTTP_HEADER``
   option to add http download headers.
 
-* The :module:`FindBISON` module ``BISON_TARGET`` macro learned a new
+* The :module:`FindBISON` module ``bison_target()`` command learned a new
   ``REPORT_FILE`` option to specify the bison ``--report-file=`` option.
 
 * The :module:`FindBZip2` module now provides imported targets.
diff --git a/Help/release/3.9.rst b/Help/release/3.9.rst
index 09e4ea6..4cc7c98 100644
--- a/Help/release/3.9.rst
+++ b/Help/release/3.9.rst
@@ -163,7 +163,7 @@
 
 * The :module:`FindDoxygen` module learned to control Doxygen behavior using
   CMake variables and generate documentation via the newly added
-  :command:`doxygen_add_docs` function. The Doxygen input file (``Doxyfile``)
+  :command:`doxygen_add_docs` command. The Doxygen input file (``Doxyfile``)
   is automatically generated and doxygen is run as part of a custom target.
   Additional components can be specified to find optional tools: ``dot``,
   ``mscgen`` and ``dia``.
diff --git a/Help/release/4.1.rst b/Help/release/4.1.rst
new file mode 100644
index 0000000..4b0de5c
--- /dev/null
+++ b/Help/release/4.1.rst
@@ -0,0 +1,271 @@
+CMake 4.1 Release Notes
+***********************
+
+.. only:: html
+
+  .. contents::
+
+Changes made since CMake 4.0 include the following.
+
+New Features
+============
+
+File-Based API
+--------------
+
+* The :manual:`cmake-file-api(7)` :ref:`v1 <file-api v1>` now writes
+  partial replies when buildsystem generation fails with an error.
+  See the :ref:`v1 Reply Error Index <file-api reply error index>`.
+
+Generators
+----------
+
+* :ref:`Makefile Generators` and :ref:`Ninja Generators` gained support
+  for adding a linker launcher with ``Fortran``, ``CUDA``, and ``HIP``.
+  See the :variable:`CMAKE_<LANG>_LINKER_LAUNCHER` variable
+  and :prop_tgt:`<LANG>_LINKER_LAUNCHER` target property for details.
+
+Command-Line
+------------
+
+* The :ref:`cmake --build <Build Tool Mode>` command-line tool, when used
+  with the :generator:`Xcode` generator, now detects when a third-party
+  tool has wrapped the generated ``.xcodeproj`` in a ``.xcworkspace``,
+  and drives the build through the workspace instead.
+
+Configure Log
+-------------
+
+* The :manual:`cmake-configure-log(7)` now reports events from
+  :command:`find_package` (in ``CONFIG`` mode), :command:`find_path`,
+  :command:`find_file`, :command:`find_library`, and :command:`find_program`
+  commands when first invoked, when their results transition between
+  "not found" and "found", or when enabled explicitly by the
+  :option:`--debug-find <cmake --debug-find>` command-line option.
+  See :ref:`find configure-log event` and
+  :ref:`find_package configure-log event`.  Logging may also be controlled
+  by the :variable:`CMAKE_FIND_DEBUG_MODE` and
+  :variable:`CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG` variables.
+
+Compilers
+---------
+
+* `Diab compilers from Wind River Systems`_, versions 5.9.x+, are now
+  supported with :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``Diab``
+  for languages ``ASM``, ``C``, and ``CXX``.
+
+.. _`Diab compilers from Wind River Systems`: https://www.windriver.com/resource/wind-river-diab-compiler-product-overview
+
+* `Renesas Compilers`_ are now supported with
+  :variable:`compiler id <CMAKE_<LANG>_COMPILER_ID>` ``Renesas`` for
+  languages ``ASM`` and ``C``.
+
+.. _Renesas Compilers: https://www.renesas.com
+
+Commands
+--------
+
+* The :command:`add_dependencies` command may be called with no dependencies.
+
+* The :command:`cmake_pkg_config` command now supports the ``IMPORT`` and
+  ``POPULATE`` subcommands for interfacing CMake targets with pkg-config based
+  dependencies.
+
+* The :command:`project` command now has experimental support for the
+  ``COMPAT_VERSION`` keyword, gated by
+  ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
+
+Variables
+---------
+
+* The :variable:`CMAKE_FIND_REQUIRED` variable was added to tell
+  :command:`find_package`, :command:`find_path`, :command:`find_file`,
+  :command:`find_library`, and :command:`find_program` to be ``REQUIRED``
+  by default.  The commands also gained an ``OPTIONAL`` keyword to ignore
+  the variable for a specific call.
+
+* The :variable:`CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID` variable is now
+  populated for most compilers, and documented for public use.
+
+* The :variable:`CMAKE_<LANG>_ICSTAT` variable and corresponding
+  :prop_tgt:`<LANG>_ICSTAT` target property were added to tell
+  the :ref:`Makefile Generators` and the :ref:`Ninja Generators`
+  to run the IAR ``icstat`` tool along with the compiler for
+  ``C`` and ``CXX`` languages.
+
+Environment Variables
+---------------------
+
+* The :envvar:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES_EXCLUDE` environment
+  variable was added to optionally exclude specific libraries from the
+  detected set of :variable:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES`.
+
+Properties
+----------
+
+* The :prop_tgt:`AUTOMOC_INCLUDE_DIRECTORIES` target property and associated
+  :variable:`CMAKE_AUTOMOC_INCLUDE_DIRECTORIES` variable were added to
+  override the automatic discovery of moc includes from a target's transitive
+  include directories.
+
+* The :prop_sf:`MACOSX_PACKAGE_LOCATION` source file property now
+  works when set on a source directory, and copies its entire tree
+  into the bundle.
+
+* The :prop_tgt:`PDB_NAME` and :prop_tgt:`COMPILE_PDB_NAME` target properties
+  now support :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Modules
+-------
+
+* The :module:`FindASPELL` module now provides a version variable, imported
+  targets, and components to optionally select the Aspell library and
+  executable separately.
+
+* The :module:`FindBLAS` and :module:`FindLAPACK` modules now support the
+  NVIDIA Performance Libraries (NVPL).
+
+* The :module:`FindProtobuf` module's :command:`protobuf_generate(DEPENDENCIES)`
+  command argument now accepts multiple values.
+
+* The :module:`FindProtobuf` module's :command:`protobuf_generate_cpp` and
+  :command:`protobuf_generate_python` commands, together with their
+  ``Protobuf_IMPORT_DIRS`` and ``PROTOBUF_GENERATE_CPP_APPEND_PATH`` hint
+  variables, are now deprecated in favor of the :command:`protobuf_generate`
+  command.
+
+Regular Expressions
+-------------------
+
+* The :command:`string(REGEX MATCHALL)`, :command:`string(REGEX REPLACE)`, and
+  :command:`list(TRANSFORM REPLACE)` commands now match the regular expression
+  ``^`` anchor at most once in repeated searches, at the start of the input.
+  See policy :policy:`CMP0186`.
+
+* The :command:`string(REGEX REPLACE)` command now allows references to
+  unmatched groups.  They are replaced with empty strings.
+
+* The :command:`string(REGEX MATCH)`, :command:`string(REGEX MATCHALL)`, and
+  :command:`string(REGEX REPLACE)` commands now allow zero-length matches.
+
+CTest
+-----
+
+* :manual:`ctest(1)` gained a
+  :option:`--schedule-random-seed <ctest --schedule-random-seed>`
+  option to specify a numeric random seed to make
+  :option:`ctest --schedule-random` deterministic for reproduction.
+
+CPack
+-----
+
+* The :cpack_gen:`CPack NuGet Generator` gained option
+  :variable:`CPACK_NUGET_SYMBOL_PACKAGE` to generate NuGet
+  symbol packages containing PDB files.
+
+* The :cpack_gen:`CPack RPM Generator` gained
+  :variable:`CPACK_RPM_PACKAGE_ENHANCES`,
+  :variable:`CPACK_RPM_PACKAGE_RECOMMENDS`, and
+  :variable:`CPACK_RPM_PACKAGE_SUPPLEMENTS`
+  variables to specify the corresponding RPM spec fields.
+
+Deprecated and Removed Features
+===============================
+
+* The :module:`FindGTest` module's result variables ``GTEST_INCLUDE_DIRS``,
+  ``GTEST_LIBRARIES``, ``GTEST_MAIN_LIBRARIES``, and ``GTEST_BOTH_LIBRARIES``
+  are now deprecated in favor of using ``GTest::gtest`` and
+  ``GTest::gtest_main`` imported targets.
+
+* The :module:`FindGCCXML` module has been deprecated via policy
+  :policy:`CMP0188`.  Port projects to CastXML instead.
+
+* The :module:`FindCABLE` module has been deprecated via policy
+  :policy:`CMP0191`.
+
+* The :module:`CMakeDetermineVSServicePack` module has been deprecated
+  via policy :policy:`CMP0196`.  Port projects to the
+  :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable instead.
+
+Other Changes
+=============
+
+* The :module:`ExternalProject` module no longer checks the ``URL`` archive
+  file extension.  Any archive type that :option:`cmake -E tar <cmake-E tar>`
+  can extract is now allowed.
+
+* Modules :module:`FindPython3`, :module:`FindPython2` and
+  :module:`FindPython` now enforce consistency of artifacts in
+  cross-compiling mode.  This prevents mixing host and target artifacts.
+  See policy :policy:`CMP0190`.
+
+* The :module:`GNUInstallDirs` module now prefers to default
+  ``SYSCONFDIR``, ``LOCALSTATEDIR``, and ``RUNSTATEDIR`` to
+  absolute paths when installing to special prefixes.
+  See policy :policy:`CMP0192`.
+
+* The :module:`GNUInstallDirs` module now caches ``CMAKE_INSTALL_*``
+  variables with their leading ``usr/`` for install prefix ``/``.
+  See policy :policy:`CMP0193`.
+
+* The :command:`install(TARGETS)` command no longer ignores file sets which
+  haven't been defined at the point it is called. The ordering of
+  :command:`target_sources(FILE_SET)` and ``install(TARGETS)`` is no longer
+  semantically relevant.
+
+* Enabling ``ASM`` no longer accidentally succeeds using ``MSVC``'s ``cl``
+  C compiler as an assembler.  See policy :policy:`CMP0194`.
+
+* The MSVC link ``-machine:`` flag is no longer added to the
+  ``CMAKE_*_LINKER_FLAGS`` variables.  See policy :policy:`CMP0197`.
+
+* The :ref:`Visual Studio Generators` now suppress Visual Studio's default
+  ``-Zc:forScope``, ``-Zc:inline``, and ``-Zc:wchar_t`` compiler flags,
+  and ``-dynamicbase``, ``-errorreport``, ``-nxcompat``, and ``-safeseh``
+  link flags, if they are not specified by the project or user.  This makes
+  builds more consistent with other generators, and with what projects and
+  users actually specify.
+
+* The :genex:`TARGET_PROPERTY` generator expression now evaluates the
+  :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
+  target properties transitively.  See policy :policy:`CMP0189`.
+
+Updates
+=======
+
+Changes made since CMake 4.1.0 include the following.
+
+4.1.1
+-----
+
+* This version made no changes to documented features or interfaces.
+  Some implementation updates were made to support ecosystem changes
+  and/or fix regressions.
+
+4.1.2
+-----
+
+* The :command:`file(GENERATE)` command, when evaluating generator
+  expressions, now uses the value of policy :policy:`CMP0189` as of
+  each call site.  Previously, it used the value as of the end of the
+  directory's ``CMakeLists.txt``, as all other generator expression
+  evaluations do.
+
+4.1.3
+-----
+
+* When building for macOS with the :generator:`Xcode` generator,
+  :variable:`CMAKE_OSX_DEPLOYMENT_TARGET` once again defaults to the
+  host's macOS version if it is older than the macOS SDK version,
+  as it did in CMake versions prior to 4.0.
+
+* The :command:`execute_process` command once again terminates child
+  processes when its ``TIMEOUT`` is reached.  This was accidentally
+  regressed by CMake 3.29.
+
+4.1.4
+-----
+
+* This version made no changes to documented features or interfaces.
+  Some implementation updates were made to support ecosystem changes
+  and/or fix regressions.
diff --git a/Help/release/index.rst b/Help/release/index.rst
index b083cf5..400e1f2 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -13,6 +13,7 @@
 .. toctree::
    :maxdepth: 1
 
+   4.1 <4.1>
    4.0 <4.0>
    3.31 <3.31>
    3.30 <3.30>
diff --git a/Help/variable/CMAKE_AUTOMOC_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_AUTOMOC_INCLUDE_DIRECTORIES.rst
new file mode 100644
index 0000000..2146f00
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOMOC_INCLUDE_DIRECTORIES.rst
@@ -0,0 +1,15 @@
+CMAKE_AUTOMOC_INCLUDE_DIRECTORIES
+---------------------------------
+
+.. versionadded:: 4.1
+
+Specifies zero or more include directories for AUTOMOC to pass explicitly to
+the Qt Meta‑Object Compiler (``moc``) instead of automatically discovering
+each target's include directories.
+
+The directories listed here will replace any include paths discovered from
+target properties such as :prop_tgt:`INCLUDE_DIRECTORIES`.
+
+This variable is used to initialize the :prop_tgt:`AUTOMOC_INCLUDE_DIRECTORIES`
+property on all the targets.  See that target property for additional
+information.
diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst b/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst
index 4b799c0..a046ffa 100644
--- a/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst
+++ b/Help/variable/CMAKE_COMPILER_IS_GNUCC.rst
@@ -1,7 +1,47 @@
 CMAKE_COMPILER_IS_GNUCC
 -----------------------
 
-True if the ``C`` compiler is GNU.
+.. deprecated:: 3.24
 
-This variable is deprecated.  Use
-:variable:`CMAKE_C_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead.
+  Use the :variable:`CMAKE_C_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` variable
+  instead.
+
+  The ``CMAKE_COMPILER_IS_*`` variables were used in early CMake versions before
+  the introduction of :variable:`CMAKE_<LANG>_COMPILER_ID` variables in CMake
+  2.6.
+
+The ``CMAKE_COMPILER_IS_GNUCC`` variable is set to boolean true if the ``C``
+compiler is GNU.
+
+Examples
+^^^^^^^^
+
+In earlier versions of CMake, the ``CMAKE_COMPILER_IS_GNUCC`` variable was used
+to check if the ``C`` compiler was GNU:
+
+.. code-block:: cmake
+
+  if(CMAKE_COMPILER_IS_GNUCC)
+    # GNU C compiler-specific logic.
+  endif()
+
+Starting with CMake 2.6, the ``CMAKE_C_COMPILER_ID`` variable should be used
+instead:
+
+.. code-block:: cmake
+
+  if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    # GNU C compiler-specific logic.
+  endif()
+
+When upgrading code, consider whether additional ``C`` compilers should be
+targeted beyond just ``GNU``.  In the past, the ``LCC`` and ``QCC`` compilers
+also had this variable set (see :policy:`CMP0047` and :policy:`CMP0129` policies
+for details). To account for this, the following approach can be used:
+
+.. code-block:: cmake
+
+  # Targeting GNU, LCC, and QCC compilers for C:
+  if(CMAKE_C_COMPILER_ID MATCHES "^(GNU|LCC|QCC)$")
+    # ...
+  endif()
diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst b/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst
index 29069d2..59eb5b8 100644
--- a/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst
+++ b/Help/variable/CMAKE_COMPILER_IS_GNUCXX.rst
@@ -1,7 +1,47 @@
 CMAKE_COMPILER_IS_GNUCXX
 ------------------------
 
-True if the C++ (``CXX``) compiler is GNU.
+.. deprecated:: 3.24
 
-This variable is deprecated.  Use
-:variable:`CMAKE_CXX_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead.
+  Use the :variable:`CMAKE_CXX_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` variable
+  instead.
+
+  The ``CMAKE_COMPILER_IS_*`` variables were used in early CMake versions before
+  the introduction of :variable:`CMAKE_<LANG>_COMPILER_ID` variables in CMake
+  2.6.
+
+The ``CMAKE_COMPILER_IS_GNUCXX`` variable is set to boolean true if the C++
+(``CXX``) compiler is GNU.
+
+Examples
+^^^^^^^^
+
+In earlier versions of CMake, the ``CMAKE_COMPILER_IS_GNUCXX`` variable was used
+to check if the ``CXX`` compiler was GNU:
+
+.. code-block:: cmake
+
+  if(CMAKE_COMPILER_IS_GNUCXX)
+    # GNU C++ compiler-specific logic.
+  endif()
+
+Starting with CMake 2.6, the ``CMAKE_CXX_COMPILER_ID`` variable should be used
+instead:
+
+.. code-block:: cmake
+
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+    # GNU C++ compiler-specific logic.
+  endif()
+
+When upgrading code, consider whether additional ``CXX`` compilers should be
+targeted beyond just ``GNU``.  In the past, the ``LCC`` and ``QCC`` compilers
+also had this variable set (see :policy:`CMP0047` and :policy:`CMP0129` policies
+for details). To account for this, the following approach can be used:
+
+.. code-block:: cmake
+
+  # Targeting GNU, LCC, and QCC compilers for CXX:
+  if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|LCC|QCC)$")
+    # ...
+  endif()
diff --git a/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst b/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst
index 05303dc..d21151c 100644
--- a/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst
+++ b/Help/variable/CMAKE_COMPILER_IS_GNUG77.rst
@@ -1,7 +1,35 @@
 CMAKE_COMPILER_IS_GNUG77
 ------------------------
 
-True if the ``Fortran`` compiler is GNU.
+.. deprecated:: 3.24
 
-This variable is deprecated.  Use
-:variable:`CMAKE_Fortran_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>` instead.
+  Use the :variable:`CMAKE_Fortran_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`
+  variable instead.
+
+  The ``CMAKE_COMPILER_IS_*`` variables were used in early CMake versions before
+  the introduction of :variable:`CMAKE_<LANG>_COMPILER_ID` variables in CMake
+  2.6.
+
+The ``CMAKE_COMPILER_IS_GNUG77`` variable is set to boolean true if the
+``Fortran`` compiler is GNU.
+
+Examples
+^^^^^^^^
+
+In earlier versions of CMake, the ``CMAKE_COMPILER_IS_GNUG77`` variable was used
+to check if the ``Fortran`` compiler was GNU:
+
+.. code-block:: cmake
+
+  if(CMAKE_COMPILER_IS_GNUG77)
+    # GNU Fortran compiler-specific logic.
+  endif()
+
+Starting with CMake 2.6, the ``CMAKE_Fortran_COMPILER_ID`` variable should be
+used instead:
+
+.. code-block:: cmake
+
+  if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+    # GNU Fortran compiler-specific logic.
+  endif()
diff --git a/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst
index 69b9d93..e2336ed 100644
--- a/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst
+++ b/Help/variable/CMAKE_CUDA_RUNTIME_LIBRARY.rst
@@ -9,7 +9,7 @@
 
 The allowed case insensitive values are:
 
-.. include:: ../prop_tgt/CUDA_RUNTIME_LIBRARY-VALUES.txt
+.. include:: ../prop_tgt/include/CUDA_RUNTIME_LIBRARY-VALUES.rst
 
 Contents of ``CMAKE_CUDA_RUNTIME_LIBRARY`` may use
 :manual:`generator expressions <cmake-generator-expressions(7)>`.
diff --git a/Help/variable/CMAKE_EXE_LINKER_FLAGS.rst b/Help/variable/CMAKE_EXE_LINKER_FLAGS.rst
index a978d11..0bb08ce 100644
--- a/Help/variable/CMAKE_EXE_LINKER_FLAGS.rst
+++ b/Help/variable/CMAKE_EXE_LINKER_FLAGS.rst
@@ -5,4 +5,4 @@
 
 These flags will be used by the linker when creating an executable.
 
-.. include:: ../variable/LINKER_FLAGS.txt
+.. include:: ../variable/include/LINKER_FLAGS.rst
diff --git a/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG.rst b/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG.rst
index 1d74077..30aad20 100644
--- a/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG.rst
+++ b/Help/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG.rst
@@ -6,4 +6,4 @@
 Same as ``CMAKE_C_FLAGS_*`` but used by the linker when creating
 executables.
 
-.. include:: ../variable/LINKER_FLAGS.txt
+.. include:: ../variable/include/LINKER_FLAGS.rst
diff --git a/Help/variable/CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG.rst b/Help/variable/CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG.rst
new file mode 100644
index 0000000..3e4b6bd
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG.rst
@@ -0,0 +1,26 @@
+CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG
+-----------------------------------------------
+
+.. versionadded:: 4.1
+
+The following commands will report configure log events when they experience a
+transition between found and not-found states or when the result is first
+defined:
+
+* :command:`find_program`
+* :command:`find_library`
+* :command:`find_file`
+* :command:`find_path`
+* :command:`find_package`
+
+The ``CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG`` boolean variable
+suppresses these implicit events from the configure log when set to a true
+value.
+
+.. code-block:: cmake
+
+  set(CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG TRUE)
+  find_program(...)
+  set(CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG FALSE)
+
+Default is unset.
diff --git a/Help/variable/CMAKE_FIND_LIBRARY_PREFIXES.rst b/Help/variable/CMAKE_FIND_LIBRARY_PREFIXES.rst
index 58354b2..3a9b089 100644
--- a/Help/variable/CMAKE_FIND_LIBRARY_PREFIXES.rst
+++ b/Help/variable/CMAKE_FIND_LIBRARY_PREFIXES.rst
@@ -7,3 +7,5 @@
 :command:`find_library` command looks for libraries.  On UNIX systems this is
 typically ``lib``, meaning that when trying to find the ``foo`` library it
 will look for ``libfoo``.
+
+.. include:: include/CMAKE_FIND_LIBRARY_VAR.rst
diff --git a/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst b/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst
index d78dd15..73a04fa 100644
--- a/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst
+++ b/Help/variable/CMAKE_FIND_LIBRARY_SUFFIXES.rst
@@ -10,3 +10,5 @@
 library, it will look for ``[<prefix>]foo[.dll].lib`` and/or
 ``[<prefix>]foo[.dll].a``, depending on the compiler used and the ``<prefix>``
 specified in the :variable:`CMAKE_FIND_LIBRARY_PREFIXES`.
+
+.. include:: include/CMAKE_FIND_LIBRARY_VAR.rst
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
index 98c2a8f..92758fd 100644
--- a/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
+++ b/Help/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION.rst
@@ -6,13 +6,13 @@
 The sorting direction used by :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER`.
 It can assume one of the following values:
 
-``DEC``
-  Default.  Ordering is done in descending mode.
-  The highest folder found will be tested first.
-
 ``ASC``
-  Ordering is done in ascending mode.
+  Default.  Ordering is done in ascending mode.
   The lowest folder found will be tested first.
 
+``DEC``
+  Ordering is done in descending mode.
+  The highest folder found will be tested first.
+
 If :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER` is not set or is set to ``NONE``
 this variable has no effect.
diff --git a/Help/variable/CMAKE_FIND_REQUIRED.rst b/Help/variable/CMAKE_FIND_REQUIRED.rst
new file mode 100644
index 0000000..0518edb
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_REQUIRED.rst
@@ -0,0 +1,27 @@
+CMAKE_FIND_REQUIRED
+-------------------
+
+.. versionadded:: 4.1
+
+If enabled, the following commands are treated as having the ``REQUIRED``
+keyword unless provided with the ``OPTIONAL`` keyword:
+
+* :command:`find_package`
+* :command:`find_program`
+* :command:`find_library`
+* :command:`find_path`
+* :command:`find_file`
+
+When :command:`find_package` loads a ``Find<PackageName>.cmake``
+or ``<PackageName>Config.cmake`` module, the ``CMAKE_FIND_REQUIRED``
+variable is automatically unset within it to restore the default
+behavior for nested find operations.  The module is free to set the
+``CMAKE_FIND_REQUIRED`` variable itself to opt-in to the behavior.
+
+Note that enabling this variable breaks some commonly used patterns.
+Multiple calls to :command:`find_package` are sometimes used to obtain a
+different search order to the default.
+
+See also the :variable:`CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>` for making
+a :command:`find_package` call ``REQUIRED``, and for additional information on
+how enabling these variables can break commonly used patterns.
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst
index df1af5a..2c42ac6 100644
--- a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE.rst
@@ -3,4 +3,4 @@
 
 .. |FIND_XXX| replace:: :command:`find_file` and :command:`find_path`
 
-.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
+.. include:: include/CMAKE_FIND_ROOT_PATH_MODE_XXX.rst
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst
index 52ab89d..a2b64ee 100644
--- a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_LIBRARY.rst
@@ -3,4 +3,4 @@
 
 .. |FIND_XXX| replace:: :command:`find_library`
 
-.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
+.. include:: include/CMAKE_FIND_ROOT_PATH_MODE_XXX.rst
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst
index 3872947..13dc457 100644
--- a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PACKAGE.rst
@@ -3,4 +3,4 @@
 
 .. |FIND_XXX| replace:: :command:`find_package`
 
-.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
+.. include:: include/CMAKE_FIND_ROOT_PATH_MODE_XXX.rst
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst
index d24a78a..4f4e12d 100644
--- a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.rst
@@ -3,4 +3,4 @@
 
 .. |FIND_XXX| replace:: :command:`find_program`
 
-.. include:: CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
+.. include:: include/CMAKE_FIND_ROOT_PATH_MODE_XXX.rst
diff --git a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst
index 4317622..885fad6 100644
--- a/Help/variable/CMAKE_GENERATOR_INSTANCE.rst
+++ b/Help/variable/CMAKE_GENERATOR_INSTANCE.rst
@@ -44,7 +44,7 @@
 
   Specify the 4-component VS Build Version, a.k.a. Build Number.
 
-  .. include:: CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.txt
+  .. include:: include/CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.rst
 
 .. versionadded:: 3.23
 
diff --git a/Help/variable/CMAKE_IGNORE_PATH.rst b/Help/variable/CMAKE_IGNORE_PATH.rst
index 4b2bd8a..1d041e1 100644
--- a/Help/variable/CMAKE_IGNORE_PATH.rst
+++ b/Help/variable/CMAKE_IGNORE_PATH.rst
@@ -4,9 +4,9 @@
 .. |CMAKE_IGNORE_VAR| replace:: ``CMAKE_IGNORE_PATH``
 .. |CMAKE_IGNORE_PREFIX_VAR| replace:: :variable:`CMAKE_IGNORE_PREFIX_PATH`
 
-.. include:: IGNORE_SEARCH_PATH.txt
-.. include:: IGNORE_SEARCH_LOCATIONS.txt
-.. include:: IGNORE_SEARCH_NONSYSTEM.txt
+.. include:: include/IGNORE_SEARCH_PATH.rst
+.. include:: include/IGNORE_SEARCH_LOCATIONS.rst
+.. include:: include/IGNORE_SEARCH_NONSYSTEM.rst
 
 See also the following variables:
 
diff --git a/Help/variable/CMAKE_IGNORE_PREFIX_PATH.rst b/Help/variable/CMAKE_IGNORE_PREFIX_PATH.rst
index b81cc57..c55e9c6 100644
--- a/Help/variable/CMAKE_IGNORE_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_IGNORE_PREFIX_PATH.rst
@@ -6,9 +6,9 @@
 .. |CMAKE_IGNORE_VAR| replace:: ``CMAKE_IGNORE_PREFIX_PATH``
 .. |CMAKE_IGNORE_NONPREFIX_VAR| replace:: :variable:`CMAKE_IGNORE_PATH`
 
-.. include:: IGNORE_SEARCH_PREFIX.txt
-.. include:: IGNORE_SEARCH_LOCATIONS.txt
-.. include:: IGNORE_SEARCH_NONSYSTEM.txt
+.. include:: include/IGNORE_SEARCH_PREFIX.rst
+.. include:: include/IGNORE_SEARCH_LOCATIONS.rst
+.. include:: include/IGNORE_SEARCH_NONSYSTEM.rst
 
 See also the following variables:
 
diff --git a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst
index cf7da76..a4b83e3 100644
--- a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst
+++ b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION.rst
@@ -8,3 +8,8 @@
 This variable is used to initialize the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION`
 property on all the targets.  See that target property for additional
 information.
+
+See Also
+^^^^^^^^
+
+* The :variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
index 5b3ee77..257c48d 100644
--- a/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
+++ b/Help/variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG.rst
@@ -8,3 +8,8 @@
 This variable is used to initialize the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION_<CONFIG>`
 property on all the targets.  See that target property for additional
 information.
+
+See Also
+^^^^^^^^
+
+* The :variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION` variable.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
index 8057566..1efbf1c 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
@@ -3,8 +3,321 @@
 
 .. versionadded:: 3.10
 
-An internal variable subject to change.
+:ref:`List <CMake Language Lists>` of identifiers indicating the
+target architecture(s) of the compiler for language ``<LANG>``.
 
-This is used to identify the variant of a compiler based on its target
-architecture.  For some compilers this is needed to determine the correct
-usage.
+Typically the list has one entry unless :variable:`CMAKE_OSX_ARCHITECTURES`
+lists multiple architectures.
+
+Possible values for each platform are documented in the following sections.
+
+.. Sync with:
+     Modules/CMakeCompilerABI.h
+     Modules/CMakeFortranCompilerABI.F
+     Modules/CMakeFortranCompilerABI.F90
+     Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+
+Apple Platforms
+^^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets an Apple platform (``__APPLE__`` is defined).
+
+``arm64``
+  ARM 64-bit
+
+``arm64e``
+  ARM 64-bit with Pointer Authentication (PACs)
+
+``arm64_32``
+  ARM 64-bit with 32-bit pointers (watchOS)
+
+``armv5``, ``armv6``, ``armv7``, ``armv7k``, ``armv7s``
+  ARM 32-bit
+
+``i386``, ``i486``, ``i586``, ``i686``
+  Intel 32-bit
+
+``ppc``
+  PowerPC 32-bit
+
+``x86_64``
+  Intel 64-bit
+
+UNIX Platforms
+^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets a UNIX platform.
+
+``aarch64``
+  ARM 64-bit
+
+``alpha``
+  DEC Alpha
+
+``armv5``, ``armv6``, ``armv7``
+  ARM 32-bit
+
+``i386``, ``i486``, ``i586``, ``i686``
+  Intel 32-bit
+
+``ia64``
+  Itanium 64-bit
+
+``loongarch32``
+  LoongArch 32-bit
+
+``loongarch64``
+  LoongArch 64-bit
+
+``m68k``
+  Motorola 68000
+
+``mips``
+  MIPS 32-bit big-endian
+
+``mipsel``
+  MIPS 32-bit little-endian
+
+``mips64``
+  MIPS 64-bit big-endian
+
+``mips64el``
+  MIPS 64-bit little-endian
+
+``parisc``
+  PA-RISC 32-bit
+
+``parisc64``
+  PA-RISC 64-bit
+
+``ppc``
+  PowerPC 32-bit big-endian
+
+``ppcle``
+  PowerPC 32-bit little-endian
+
+``ppc64``
+  PowerPC 64-bit big-endian
+
+``ppc64le``
+  PowerPC 64-bit little-endian
+
+``riscv32``
+  RISC-V 32-bit
+
+``riscv64``
+  RISC-V 64-bit
+
+``s390``, ``s390x``
+  IBM Z
+
+``sparc``
+  SPARC 32-bit
+
+``sparcv9``
+  SPARC 64-bit
+
+``x86_64``
+  Intel 64-bit
+
+Windows Platforms with GNU ABI (MinGW)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets Windows with a GNU ABI (``_WIN32`` and ``__MINGW32__`` are defined).
+
+``aarch64``
+  ARM 64-bit
+
+``armv7``
+  ARM 32-bit
+
+``i386``, ``i486``, ``i586``, ``i686``
+  Intel 32-bit
+
+``x86_64``
+  Intel 64-bit
+
+Windows Platforms with MSVC ABI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.10
+
+These identifiers are used when the :variable:`CMAKE_<LANG>_COMPILER`
+targets Windows with a MSVC ABI (``_WIN32`` and ``_MSC_VER`` are defined).
+
+``ARM64``
+  ARM 64-bit
+
+``ARM64EC``
+  ARM 64-bit Emulation-Compatible
+
+``ARMV4I``, ``ARMV5I``, ``ARMV7``
+  ARM 32-bit
+
+``IA64``
+  Itanium 64-bit
+
+``MIPS``
+  MIPS
+
+``SHx``, ``SH3``, ``SH3DSP``, ``SH4``, ``SH5``
+  SuperH
+
+``x64``
+  Intel 64-bit
+
+``X86``
+  Intel 32-bit
+
+Windows Platforms with Watcom ABI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.10
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``OpenWatcom`` or ``Watcom``.
+
+``I86``
+  Intel 16-bit
+
+``X86``
+  Intel 32-bit
+
+Green Hills MULTI Platforms
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.14
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``GHS``.
+
+``ARM``
+  ARM 32-bit
+
+``PPC``
+  PowerPC 32-bit
+
+``PPC64``
+  PowerPC 64-bit
+
+``x64``
+  Intel 64-bit
+
+``X86``
+  Intel 32-bit
+
+IAR Platforms
+^^^^^^^^^^^^^
+
+.. versionadded:: 3.10
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``IAR``.
+
+``8051``
+  Intel 8051-compatible 8-bit
+
+``ARM``
+  ARM 32-/64-bit
+
+``AVR``
+  Microchip AVR 8-bit
+
+``MSP430``
+  Texas Instruments MSP430 16-bit
+
+``RH850``
+  Renesas Electronics RH850 32-bit
+
+``RISCV``
+  RISC-V 32-/64-bit
+
+``RL78``
+  Renesas Electronics RL78 16-bit
+
+``RX``
+  Renesas Electronics RX 32-bit
+
+``STM8``
+  STMicroelectronics STM8 8-bit
+
+``V850``
+  Renesas Electronics V850 32-bit
+
+Renesas Compiler Platforms
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 4.1
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``Renesas``.
+
+``RH850``
+  Renesas Electronics RH850
+
+``RL78``
+  Renesas Electronics RL78
+
+``RX``
+  Renesas Electronics RX
+
+TASKING Platforms
+^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.25
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``Tasking``.
+
+``8051``
+  ..
+
+``ARC``
+  ..
+
+``ARM``
+  ..
+
+``MCS``
+  ..
+
+``PCP``
+  ..
+
+``TriCore``
+  ..
+
+Texas Instruments Platforms
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.19
+
+These identifiers are used when :variable:`CMAKE_<LANG>_COMPILER_ID` is
+``TI``.
+
+``ARM``
+  ..
+
+``Blackfin``
+  ..
+
+``MSP430``
+  ..
+
+``SHARC``
+  ..
+
+``TMS320C28x``
+  ..
+
+``TMS320C6x``
+  ..
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index a4f899e..365e1d0 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -19,6 +19,7 @@
 ``Clang``                       `LLVM Clang`_
 ``Cray``                        Cray Compiler
 ``CrayClang``                   Cray Clang-based Compiler
+``Diab``                        `Wind River Systems Diab Compiler`_
 ``Embarcadero``, ``Borland``    `Embarcadero`_
 ``Flang``                       `Classic Flang Fortran Compiler`_
 ``LLVMFlang``                   `LLVM Flang Fortran Compiler`_
@@ -40,6 +41,9 @@
 ``OpenWatcom``                  `Open Watcom`_
 ``PGI``                         The Portland Group
 ``PathScale``                   PathScale
+``QCC``                         QNX C/C++ compiler
+``Renesas``                     `Renesas Compiler`_
+``SCO``                         SCO OpenServer/UnixWare C/C++ Compiler
 ``SDCC``                        `Small Device C Compiler`_
 ``SunPro``                      Oracle Developer Studio
 ``Tasking``                     `Tasking Compiler Toolsets`_
@@ -67,7 +71,9 @@
 .. _NVIDIA CUDA Compiler: https://developer.nvidia.com/cuda-llvm-compiler
 .. _Open Watcom: https://open-watcom.github.io
 .. _OrangeC Compiler: https://github.com/LADSoft/OrangeC
+.. _Renesas Compiler: https://www.renesas.com
 .. _Small Device C Compiler: https://sdcc.sourceforge.net
 .. _Tiny C Compiler: https://bellard.org/tcc
 .. _Tasking Compiler Toolsets: https://www.tasking.com
 .. _Texas Instruments Clang-based Compilers: https://www.ti.com/tool/download/ARM-CGT-CLANG
+.. _Wind River Systems Diab Compiler: https://www.windriver.com/resource/wind-river-diab-compiler-product-overview
diff --git a/Help/variable/CMAKE_LANG_ICSTAT.rst b/Help/variable/CMAKE_LANG_ICSTAT.rst
new file mode 100644
index 0000000..9ceda47
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_ICSTAT.rst
@@ -0,0 +1,8 @@
+CMAKE_<LANG>_ICSTAT
+-------------------
+
+.. versionadded:: 4.1
+
+Default value for :prop_tgt:`<LANG>_ICSTAT` target property. This variable
+is used to initialize the property on each target as it is created.  This
+is done only when ``<LANG>`` is ``C`` or ``CXX``.
diff --git a/Help/variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES.rst b/Help/variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES.rst
index 0c25489..a03aa41 100644
--- a/Help/variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES.rst
+++ b/Help/variable/CMAKE_LANG_IMPLICIT_LINK_LIBRARIES.rst
@@ -5,10 +5,14 @@
 
 Compilers typically pass language runtime library names and other
 flags when they invoke a linker.  These flags are implicit link
-options for the compiler's language.  For each language enabled
-by the :command:`project` or :command:`enable_language` command,
-CMake automatically detects these libraries and flags and reports
-the results in this variable.
+options for the compiler's language.
+
+For each language enabled by the :command:`project` or
+:command:`enable_language` command, CMake automatically detects these
+libraries and flags and reports the results in this variable.
+The :envvar:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES_EXCLUDE` environment
+variable may be set to exclude specific libraries from the automatically
+detected results.
 
 When linking to a static library, CMake adds the implicit link libraries and
 flags from this variable for each language used in the static library (except
diff --git a/Help/variable/CMAKE_LANG_LINKER_LAUNCHER.rst b/Help/variable/CMAKE_LANG_LINKER_LAUNCHER.rst
index b76b939..d51951a 100644
--- a/Help/variable/CMAKE_LANG_LINKER_LAUNCHER.rst
+++ b/Help/variable/CMAKE_LANG_LINKER_LAUNCHER.rst
@@ -5,7 +5,27 @@
 
 Default value for :prop_tgt:`<LANG>_LINKER_LAUNCHER` target property. This
 variable is used to initialize the property on each target as it is created.
-This is done only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC``, or ``OBJCXX``.
+This is done only when ``<LANG>`` is one of:
+
+* ``C``
+
+* ``CXX``
+
+* ``CUDA``
+
+  .. versionadded:: 4.1
+
+* ``OBJC``
+
+* ``OBJCXX``
+
+* ``Fortran``
+
+  .. versionadded:: 4.1
+
+* ``HIP``
+
+  .. versionadded:: 4.1
 
 This variable is initialized to the :envvar:`CMAKE_<LANG>_LINKER_LAUNCHER`
 environment variable if it is set.
diff --git a/Help/variable/CMAKE_LANG_LINK_DEF_FILE_FLAG.rst b/Help/variable/CMAKE_LANG_LINK_DEF_FILE_FLAG.rst
new file mode 100644
index 0000000..96feb79
--- /dev/null
+++ b/Help/variable/CMAKE_LANG_LINK_DEF_FILE_FLAG.rst
@@ -0,0 +1,14 @@
+CMAKE_<LANG>_LINK_DEF_FILE_FLAG
+-------------------------------
+
+.. versionadded:: 4.1
+
+Linker flag to be used to specify a ``.def`` file for dll creation
+with the toolchain for language ``<LANG>``.
+
+CMake sets this variable automatically during toolchain inspection by
+calls to the :command:`project` or :command:`enable_language` commands.
+
+If the :variable:`!CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable
+is defined, it takes precedence over the language-agnostic
+:variable:`CMAKE_LINK_DEF_FILE_FLAG` variable.
diff --git a/Help/variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE.rst b/Help/variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE.rst
index 7c929d0..9ddf6ea 100644
--- a/Help/variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE.rst
+++ b/Help/variable/CMAKE_LANG_LINK_GROUP_USING_FEATURE.rst
@@ -13,4 +13,4 @@
 The :variable:`CMAKE_LINK_GROUP_USING_<FEATURE>` variable should be defined
 instead for features that are independent of the link language.
 
-.. include:: CMAKE_LINK_GROUP_USING_FEATURE.txt
+.. include:: include/CMAKE_LINK_GROUP_USING_FEATURE.rst
diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE.rst
index 39fcff8..505f740 100644
--- a/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE.rst
+++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE.rst
@@ -13,4 +13,4 @@
 The :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` variable should be defined
 instead for features that are independent of the link language.
 
-.. include:: CMAKE_LINK_LIBRARY_USING_FEATURE.txt
+.. include:: include/CMAKE_LINK_LIBRARY_USING_FEATURE.rst
diff --git a/Help/variable/CMAKE_LINKER_TYPE.rst b/Help/variable/CMAKE_LINKER_TYPE.rst
index e2989ec..2697acd 100644
--- a/Help/variable/CMAKE_LINKER_TYPE.rst
+++ b/Help/variable/CMAKE_LINKER_TYPE.rst
@@ -11,4 +11,4 @@
 link step.  If set, its value is also used by the :command:`try_compile`
 command.
 
-.. include:: LINKER_PREDEFINED_TYPES.txt
+.. include:: include/LINKER_PREDEFINED_TYPES.rst
diff --git a/Help/variable/CMAKE_LINK_DEF_FILE_FLAG.rst b/Help/variable/CMAKE_LINK_DEF_FILE_FLAG.rst
index fa09f9f..d6a1fb7 100644
--- a/Help/variable/CMAKE_LINK_DEF_FILE_FLAG.rst
+++ b/Help/variable/CMAKE_LINK_DEF_FILE_FLAG.rst
@@ -5,3 +5,9 @@
 
 The flag will be used to add a ``.def`` file when creating a dll on
 Windows; this is only defined on Windows.
+
+CMake sets this variable automatically during toolchain inspection by
+calls to the :command:`project` or :command:`enable_language` commands.
+
+If the per-language :variable:`CMAKE_<LANG>_LINK_DEF_FILE_FLAG` variable
+is defined, it takes precedence over :variable:`!CMAKE_LINK_DEF_FILE_FLAG`.
diff --git a/Help/variable/CMAKE_LINK_GROUP_USING_FEATURE.rst b/Help/variable/CMAKE_LINK_GROUP_USING_FEATURE.rst
index 90b7f8b..5cbe5ec 100644
--- a/Help/variable/CMAKE_LINK_GROUP_USING_FEATURE.rst
+++ b/Help/variable/CMAKE_LINK_GROUP_USING_FEATURE.rst
@@ -19,4 +19,4 @@
 The :variable:`CMAKE_<LANG>_LINK_GROUP_USING_<FEATURE>` variable should be
 defined instead for features that are dependent on the link language.
 
-.. include:: CMAKE_LINK_GROUP_USING_FEATURE.txt
+.. include:: include/CMAKE_LINK_GROUP_USING_FEATURE.rst
diff --git a/Help/variable/CMAKE_LINK_GROUP_USING_FEATURE.txt b/Help/variable/CMAKE_LINK_GROUP_USING_FEATURE.txt
deleted file mode 100644
index 23ea157..0000000
--- a/Help/variable/CMAKE_LINK_GROUP_USING_FEATURE.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-Feature names are case-sensitive and may only contain letters, numbers
-and underscores.  Feature names defined in all uppercase are reserved for
-CMake's own built-in features (see `Predefined Features`_ further below).
-
-
-Feature Definitions
-^^^^^^^^^^^^^^^^^^^
-
-A group feature definition is a list that contains exactly two elements:
-
-::
-
-  <PREFIX> <SUFFIX>
-
-On the linker command line, ``<PREFIX>`` will precede the list of libraries
-in the group and ``<SUFFIX>`` will follow after.
-
-For the elements of this variable, the ``LINKER:`` prefix can be used.
-
-.. include:: ../command/LINK_OPTIONS_LINKER.txt
-  :start-line: 3
-
-Examples
-^^^^^^^^
-
-Solving cross-references between two static libraries
-"""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-A project may define two or more static libraries which have circular
-dependencies between them.  In order for the linker to resolve all symbols
-at link time, it may need to search repeatedly among the libraries until no
-new undefined references are created.  Different linkers use different syntax
-for achieving this.  The following example shows how this may be implemented
-for some linkers.  Note that this is for illustration purposes only.
-Projects should use the built-in ``RESCAN`` group feature instead
-(see `Predefined Features`_), which provides a more complete and more robust
-implementation of this functionality.
-
-.. code-block:: cmake
-
-  set(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED TRUE)
-  if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
-    set(CMAKE_C_LINK_GROUP_USING_cross_refs
-      "LINKER:--start-group"
-      "LINKER:--end-group"
-    )
-  elseif(CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
-    set(CMAKE_C_LINK_GROUP_USING_cross_refs
-      "LINKER:-z,rescan-start"
-      "LINKER:-z,rescan-end"
-    )
-  else()
-    # feature not yet supported for the other environments
-    set(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED FALSE)
-  endif()
-
-  add_library(lib1 STATIC ...)
-  add_library(lib2 SHARED ...)
-
-  if(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED)
-    target_link_libraries(lib2 PRIVATE "$<LINK_GROUP:cross_refs,lib1,external>")
-  else()
-    target_link_libraries(lib2 PRIVATE lib1 external)
-  endif()
-
-CMake will generate the following linker command line fragments when linking
-``lib2``:
-
-* ``GNU``: ``-Wl,--start-group /path/to/lib1.a -lexternal -Wl,--end-group``
-* ``SunPro``: ``-Wl,-z,rescan-start /path/to/lib1.a -lexternal -Wl,-z,rescan-end``
-
-
-Predefined Features
-^^^^^^^^^^^^^^^^^^^
-
-The following built-in group features are pre-defined by CMake:
-
-.. include:: LINK_GROUP_PREDEFINED_FEATURES.txt
diff --git a/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.rst b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.rst
index c652733..30877c2 100644
--- a/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.rst
+++ b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.rst
@@ -16,4 +16,4 @@
   cannot be true for the link language used by the target for which the
   :genex:`LINK_LIBRARY` generator expression is evaluated.
 
-.. include:: CMAKE_LINK_LIBRARY_USING_FEATURE.txt
+.. include:: include/CMAKE_LINK_LIBRARY_USING_FEATURE.rst
diff --git a/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.txt b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.txt
deleted file mode 100644
index f5c19e0..0000000
--- a/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.txt
+++ /dev/null
@@ -1,153 +0,0 @@
-Feature names are case-sensitive and may only contain letters, numbers
-and underscores.  Feature names defined in all uppercase are reserved for
-CMake's own built-in features (see `Predefined Features`_ further below).
-
-Some aspects of feature behavior can be defined by the
-:variable:`CMAKE_<LANG>_LINK_LIBRARY_<FEATURE>_ATTRIBUTES` and
-:variable:`CMAKE_LINK_LIBRARY_<FEATURE>_ATTRIBUTES` variables.
-
-Feature Definitions
-^^^^^^^^^^^^^^^^^^^
-
-A library feature definition is a list that contains one or three elements:
-
-::
-
-  [<PREFIX>] <LIBRARY_EXPRESSION> [<SUFFIX>]
-
-When ``<PREFIX>`` and ``<SUFFIX>`` are specified, they precede and follow
-respectively the whole list of libraries specified in the
-:genex:`LINK_LIBRARY` expression, not each library item individually.
-There is no guarantee that the list of specified libraries will be kept
-grouped together though, so the ``<PREFIX>`` and ``<SUFFIX>`` may appear
-more than once if the library list is reorganized by CMake to satisfy other
-constraints.  This means constructs like ``--start-group`` and ``--end-group``,
-as supported by the GNU ``ld`` linker, cannot be used in this way.  The
-:genex:`LINK_GROUP` generator expression should be used instead for such
-constructs.
-
-``<LIBRARY_EXPRESSION>`` is used to specify the pattern for constructing the
-corresponding fragment on the linker command line for each library.
-The following placeholders can be used in the expression:
-
-* ``<LIBRARY>`` is expanded to the full path to the library for CMake targets,
-  or to a platform-specific value based on the item otherwise (the same as
-  ``<LINK_ITEM>`` on Windows, or the library base name for other platforms).
-* ``<LINK_ITEM>`` is expanded to how the library would normally be linked on
-  the linker command line.
-* ``<LIB_ITEM>`` is expanded to the full path to the library for CMake targets,
-  or the item itself exactly as specified in the ``<LIBRARY_EXPRESSION>``
-  otherwise.
-
-In addition to the above, it is possible to have one pattern for paths
-(CMake targets and external libraries specified with file paths) and another
-for other items specified by name only.  The ``PATH{}`` and ``NAME{}`` wrappers
-can be used to provide the expansion for those two cases, respectively.
-When wrappers are used, both must be present.  For example:
-
-.. code-block:: cmake
-
-  set(CMAKE_LINK_LIBRARY_USING_weak_library
-      "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}"
-  )
-
-For all three elements of this variable (``<PREFIX>``, ``<LIBRARY_EXPRESSION>``,
-and ``<SUFFIX>``), the ``LINKER:`` prefix can be used.
-
-.. include:: ../command/LINK_OPTIONS_LINKER.txt
-  :start-line: 3
-
-Examples
-^^^^^^^^
-
-Loading a whole static library
-""""""""""""""""""""""""""""""
-
-A common need is to prevent the linker from discarding any symbols from a
-static library.  Different linkers use different syntax for achieving this.
-The following example shows how this may be implemented for some linkers.
-Note that this is for illustration purposes only.  Projects should use the
-built-in ``WHOLE_ARCHIVE`` feature instead (see `Predefined Features`_), which
-provides a more complete and more robust implementation of this functionality.
-
-.. code-block:: cmake
-
-  set(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED TRUE)
-  if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
-    set(CMAKE_C_LINK_LIBRARY_USING_load_archive "-force_load <LIB_ITEM>")
-  elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
-    set(CMAKE_C_LINK_LIBRARY_USING_load_archive
-      "LINKER:--push-state,--whole-archive"
-      "<LINK_ITEM>"
-      "LINKER:--pop-state"
-    )
-  elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
-    set(CMAKE_C_LINK_LIBRARY_USING_load_archive "/WHOLEARCHIVE:<LIBRARY>")
-  else()
-    # feature not yet supported for the other environments
-    set(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED FALSE)
-  endif()
-
-  add_library(lib1 STATIC ...)
-  add_library(lib2 SHARED ...)
-
-  if(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED)
-    # The -force_load Apple linker option requires a file name
-    set(external_lib
-      "$<IF:$<LINK_LANG_AND_ID:C,AppleClang>,libexternal.a,external>"
-    )
-    target_link_libraries(lib2 PRIVATE
-      "$<LINK_LIBRARY:load_archive,lib1,${external_lib}>"
-    )
-  else()
-    target_link_libraries(lib2 PRIVATE lib1 external)
-  endif()
-
-CMake will generate the following link expressions:
-
-* ``AppleClang``: ``-force_load /path/to/lib1.a -force_load libexternal.a``
-* ``GNU``: ``-Wl,--push-state,--whole-archive /path/to/lib1.a -lexternal -Wl,--pop-state``
-* ``MSVC``: ``/WHOLEARCHIVE:/path/to/lib1.lib /WHOLEARCHIVE:external.lib``
-
-Linking a library as weak
-"""""""""""""""""""""""""
-
-On macOS, it is possible to link a library in weak mode (the library and all
-references are marked as weak imports).  Different flags must be used for a
-library specified by file path compared to one specified by name.
-This constraint can be solved using ``PATH{}`` and ``NAME{}`` wrappers.
-Again, the following example shows how this may be implemented for some
-linkers, but it is for illustration purposes only.  Projects should use the
-built-in ``WEAK_FRAMEWORK`` or ``WEAK_LIBRARY`` features instead (see
-`Predefined Features`_), which provide more complete and more robust
-implementations of this functionality.
-
-.. code-block:: cmake
-
-  if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
-    set(CMAKE_LINK_LIBRARY_USING_weak_library
-        "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}"
-    )
-    set(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED TRUE)
-  endif()
-
-  add_library(lib SHARED ...)
-  add_executable(main ...)
-  if(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED)
-    target_link_libraries(main PRIVATE "$<LINK_LIBRARY:weak_library,lib,external>")
-  else()
-    target_link_libraries(main PRIVATE lib external)
-  endif()
-
-CMake will generate the following linker command line fragment when linking
-``main`` using the ``AppleClang`` toolchain:
-
-``-weak_library /path/to/lib -Xlinker -weak-lexternal``.
-
-
-Predefined Features
-^^^^^^^^^^^^^^^^^^^
-
-The following built-in library features are pre-defined by CMake:
-
-.. include:: LINK_LIBRARY_PREDEFINED_FEATURES.txt
diff --git a/Help/variable/CMAKE_MFC_FLAG.rst b/Help/variable/CMAKE_MFC_FLAG.rst
index 118e9c6..83cca8d 100644
--- a/Help/variable/CMAKE_MFC_FLAG.rst
+++ b/Help/variable/CMAKE_MFC_FLAG.rst
@@ -8,13 +8,25 @@
 ``2`` for the shared MFC library.  This is used in Visual Studio
 project files.
 
+Contents of ``CMAKE_MFC_FLAG`` may use
+:manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Examples
+^^^^^^^^
+
 Usage example:
 
 .. code-block:: cmake
 
-  add_definitions(-D_AFXDLL)
   set(CMAKE_MFC_FLAG 2)
+
   add_executable(CMakeSetup WIN32 ${SRCS})
 
-Contents of ``CMAKE_MFC_FLAG`` may use
-:manual:`generator expressions <cmake-generator-expressions(7)>`.
+  # Visual Studio generators add this flag automatically based on the
+  # CMAKE_MFC_FLAG value, but generators matching "Make" require it:
+  target_compile_definitions(CMakeSetup PRIVATE _AFXDLL)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindMFC` module to check whether MFC is installed and available.
diff --git a/Help/variable/CMAKE_MODULE_LINKER_FLAGS.rst b/Help/variable/CMAKE_MODULE_LINKER_FLAGS.rst
index eed6b65..e74b6ee 100644
--- a/Help/variable/CMAKE_MODULE_LINKER_FLAGS.rst
+++ b/Help/variable/CMAKE_MODULE_LINKER_FLAGS.rst
@@ -5,4 +5,4 @@
 
 These flags will be used by the linker when creating a module.
 
-.. include:: ../variable/LINKER_FLAGS.txt
+.. include:: ../variable/include/LINKER_FLAGS.rst
diff --git a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG.rst b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG.rst
index fd0769c..693565a 100644
--- a/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG.rst
+++ b/Help/variable/CMAKE_MODULE_LINKER_FLAGS_CONFIG.rst
@@ -5,4 +5,4 @@
 
 Same as ``CMAKE_C_FLAGS_*`` but used by the linker when creating modules.
 
-.. include:: ../variable/LINKER_FLAGS.txt
+.. include:: ../variable/include/LINKER_FLAGS.rst
diff --git a/Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst b/Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst
index 84c2584..a899f63 100644
--- a/Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst
+++ b/Help/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.rst
@@ -11,7 +11,7 @@
 
 The allowed values are:
 
-.. include:: ../prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.txt
+.. include:: ../prop_tgt/include/MSVC_DEBUG_INFORMATION_FORMAT-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification.  For example, the code:
diff --git a/Help/variable/CMAKE_MSVC_RUNTIME_CHECKS.rst b/Help/variable/CMAKE_MSVC_RUNTIME_CHECKS.rst
index 5ba8547..c793674 100644
--- a/Help/variable/CMAKE_MSVC_RUNTIME_CHECKS.rst
+++ b/Help/variable/CMAKE_MSVC_RUNTIME_CHECKS.rst
@@ -11,7 +11,7 @@
 
 The allowed values are:
 
-.. include:: ../prop_tgt/MSVC_RUNTIME_CHECKS-VALUES.txt
+.. include:: ../prop_tgt/include/MSVC_RUNTIME_CHECKS-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification. For example, the code:
diff --git a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
index 14806e6..22c3d45 100644
--- a/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
+++ b/Help/variable/CMAKE_MSVC_RUNTIME_LIBRARY.rst
@@ -10,7 +10,7 @@
 
 The allowed values are:
 
-.. include:: ../prop_tgt/MSVC_RUNTIME_LIBRARY-VALUES.txt
+.. include:: ../prop_tgt/include/MSVC_RUNTIME_LIBRARY-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification.  For example, the code:
diff --git a/Help/variable/CMAKE_OSX_ARCHITECTURES.rst b/Help/variable/CMAKE_OSX_ARCHITECTURES.rst
index fdaca28..f660df9 100644
--- a/Help/variable/CMAKE_OSX_ARCHITECTURES.rst
+++ b/Help/variable/CMAKE_OSX_ARCHITECTURES.rst
@@ -7,4 +7,4 @@
 property on each target as it is created.  See that target property
 for additional information.
 
-.. include:: CMAKE_OSX_VARIABLE.txt
+.. include:: include/CMAKE_OSX_VARIABLE.rst
diff --git a/Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst b/Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst
index ef10c75..2875b1d 100644
--- a/Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst
+++ b/Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst
@@ -36,4 +36,4 @@
   Otherwise, no such flag is added, so the compiler's default deployment
   target is used.
 
-.. include:: CMAKE_OSX_VARIABLE.txt
+.. include:: include/CMAKE_OSX_VARIABLE.rst
diff --git a/Help/variable/CMAKE_OSX_SYSROOT.rst b/Help/variable/CMAKE_OSX_SYSROOT.rst
index 4be343a..8525435 100644
--- a/Help/variable/CMAKE_OSX_SYSROOT.rst
+++ b/Help/variable/CMAKE_OSX_SYSROOT.rst
@@ -28,4 +28,4 @@
   if :variable:`CMAKE_OSX_SYSROOT` is empty, CMake will automatically pass
   ``-isysroot`` with the macOS SDK printed by ``xcrun --show-sdk-path``.
 
-.. include:: CMAKE_OSX_VARIABLE.txt
+.. include:: include/CMAKE_OSX_VARIABLE.rst
diff --git a/Help/variable/CMAKE_PARENT_LIST_FILE.rst b/Help/variable/CMAKE_PARENT_LIST_FILE.rst
index cfd8608..7e71efa 100644
--- a/Help/variable/CMAKE_PARENT_LIST_FILE.rst
+++ b/Help/variable/CMAKE_PARENT_LIST_FILE.rst
@@ -5,5 +5,11 @@
 
 While processing a CMake file loaded by :command:`include` or
 :command:`find_package` this variable contains the full path to the file
-including it.  The top of the include stack is always the ``CMakeLists.txt``
-for the current directory.  See also :variable:`CMAKE_CURRENT_LIST_FILE`.
+including it.
+
+While processing a ``CMakeLists.txt`` file, even in subdirectories,
+this variable has the same value as :variable:`CMAKE_CURRENT_LIST_FILE`.
+While processing a :option:`cmake -P` script, this variable is not defined
+in the outermost script.
+
+See also :variable:`CMAKE_CURRENT_LIST_FILE`.
diff --git a/Help/variable/CMAKE_PROJECT_COMPAT_VERSION.rst b/Help/variable/CMAKE_PROJECT_COMPAT_VERSION.rst
new file mode 100644
index 0000000..e32d381
--- /dev/null
+++ b/Help/variable/CMAKE_PROJECT_COMPAT_VERSION.rst
@@ -0,0 +1,41 @@
+CMAKE_PROJECT_COMPAT_VERSION
+----------------------------
+
+.. versionadded:: 4.1
+
+.. note::
+
+  Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
+
+The compatibility version of the top level project.
+
+This variable holds the compatibility version of the project as specified in the
+top level CMakeLists.txt file by a :command:`project` command.  In the event
+that the top level CMakeLists.txt contains multiple :command:`project` calls,
+the most recently called one from that top level CMakeLists.txt will determine
+the value that ``CMAKE_PROJECT_COMPAT_VERSION`` contains.  For example, consider
+the following top level CMakeLists.txt:
+
+.. code-block:: cmake
+
+  cmake_minimum_required(VERSION 4.1)
+  project(First VERSION 9.0 COMPAT_VERSION 1.2.3)
+  project(Second VERSION 9.0 COMPAT_VERSION 3.4.5)
+  add_subdirectory(sub)
+  project(Third VERSION 9.0 COMPAT_VERSION 6.7.8)
+
+And ``sub/CMakeLists.txt`` with the following contents:
+
+.. code-block:: cmake
+
+  project(SubProj VERSION 2.0 COMPAT_VERSION 1.0)
+  message("CMAKE_PROJECT_COMPAT_VERSION = ${CMAKE_PROJECT_COMPAT_VERSION}")
+
+The most recently seen :command:`project` command from the top level
+CMakeLists.txt would be ``project(Second ...)``, so this will print::
+
+  CMAKE_PROJECT_COMPAT_VERSION = 3.4.5
+
+To obtain the version from the most recent call to :command:`project` in
+the current directory scope or above, see the :variable:`PROJECT_COMPAT_VERSION`
+variable.
diff --git a/Help/variable/CMAKE_SHARED_LINKER_FLAGS.rst b/Help/variable/CMAKE_SHARED_LINKER_FLAGS.rst
index 45748ff..93c84ee 100644
--- a/Help/variable/CMAKE_SHARED_LINKER_FLAGS.rst
+++ b/Help/variable/CMAKE_SHARED_LINKER_FLAGS.rst
@@ -5,4 +5,4 @@
 
 These flags will be used by the linker when creating a shared library.
 
-.. include:: ../variable/LINKER_FLAGS.txt
+.. include:: ../variable/include/LINKER_FLAGS.rst
diff --git a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG.rst b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG.rst
index b968820..d0eb4fd 100644
--- a/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG.rst
+++ b/Help/variable/CMAKE_SHARED_LINKER_FLAGS_CONFIG.rst
@@ -6,4 +6,4 @@
 Same as ``CMAKE_C_FLAGS_*`` but used by the linker when creating shared
 libraries.
 
-.. include:: ../variable/LINKER_FLAGS.txt
+.. include:: ../variable/include/LINKER_FLAGS.rst
diff --git a/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst b/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
index a6d8016..a56b452 100644
--- a/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
@@ -5,9 +5,9 @@
 .. |CMAKE_IGNORE_PREFIX_VAR| replace:: :variable:`CMAKE_SYSTEM_IGNORE_PREFIX_PATH`
 .. |CMAKE_IGNORE_NONSYSTEM_VAR| replace:: :variable:`CMAKE_IGNORE_PATH`
 
-.. include:: IGNORE_SEARCH_PATH.txt
-.. include:: IGNORE_SEARCH_LOCATIONS.txt
-.. include:: IGNORE_SEARCH_SYSTEM.txt
+.. include:: include/IGNORE_SEARCH_PATH.rst
+.. include:: include/IGNORE_SEARCH_LOCATIONS.rst
+.. include:: include/IGNORE_SEARCH_SYSTEM.rst
 
 See also the following variables:
 
diff --git a/Help/variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH.rst
index 48a2994..400b9c5 100644
--- a/Help/variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_IGNORE_PREFIX_PATH.rst
@@ -7,9 +7,9 @@
 .. |CMAKE_IGNORE_NONPREFIX_VAR| replace:: :variable:`CMAKE_SYSTEM_IGNORE_PATH`
 .. |CMAKE_IGNORE_NONSYSTEM_VAR| replace:: :variable:`CMAKE_IGNORE_PREFIX_PATH`
 
-.. include:: IGNORE_SEARCH_PREFIX.txt
-.. include:: IGNORE_SEARCH_LOCATIONS.txt
-.. include:: IGNORE_SEARCH_SYSTEM.txt
+.. include:: include/IGNORE_SEARCH_PREFIX.rst
+.. include:: include/IGNORE_SEARCH_LOCATIONS.rst
+.. include:: include/IGNORE_SEARCH_SYSTEM.rst
 
 See also the following variables:
 
diff --git a/Help/variable/CMAKE_SYSTEM_NAME.rst b/Help/variable/CMAKE_SYSTEM_NAME.rst
index 681ee03..41c1b78 100644
--- a/Help/variable/CMAKE_SYSTEM_NAME.rst
+++ b/Help/variable/CMAKE_SYSTEM_NAME.rst
@@ -61,7 +61,6 @@
 ``Haiku``                 Unix operating system inspired by BeOS
 ``HP-UX``                 Hewlett Packard Unix
 ``iOS``                   Apple mobile phone operating system
-``kFreeBSD``              FreeBSD kernel with a GNU userland
 ``Linux``                 All Linux-based distributions
 ``Midipix``               POSIX-compatible layer for Windows
 ``MirBSD``                MirOS BSD operating system
diff --git a/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst
index 5e55d8c..6e466c1 100644
--- a/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst
+++ b/Help/variable/CMAKE_Swift_COMPILATION_MODE.rst
@@ -8,7 +8,7 @@
 
 The allowed values are:
 
-.. include:: ../prop_tgt/Swift_COMPILATION_MODE-VALUES.txt
+.. include:: ../prop_tgt/include/Swift_COMPILATION_MODE-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to support
 per-configuration specification. For example, the code:
diff --git a/Help/variable/CMAKE_TLS_VERSION.rst b/Help/variable/CMAKE_TLS_VERSION.rst
index ff0918b..be8cca3 100644
--- a/Help/variable/CMAKE_TLS_VERSION.rst
+++ b/Help/variable/CMAKE_TLS_VERSION.rst
@@ -15,7 +15,7 @@
 
 The value may be one of:
 
-.. include:: CMAKE_TLS_VERSION-VALUES.txt
+.. include:: include/CMAKE_TLS_VERSION-VALUES.rst
 
 This variable is also used by the :module:`ExternalProject` and
 :module:`FetchContent` modules for internal calls to
diff --git a/Help/variable/CMAKE_VS_NUGET_PACKAGE_RESTORE.rst b/Help/variable/CMAKE_VS_NUGET_PACKAGE_RESTORE.rst
index 380caa2..7b38e1f 100644
--- a/Help/variable/CMAKE_VS_NUGET_PACKAGE_RESTORE.rst
+++ b/Help/variable/CMAKE_VS_NUGET_PACKAGE_RESTORE.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.23
 
-When using a Visual Studio generator, this cache variable controls
+When using :ref:`Visual Studio Generators`, this cache variable controls
 if msbuild should automatically attempt to restore NuGet packages
 prior to a build. NuGet packages can be defined using the
 :prop_tgt:`VS_PACKAGE_REFERENCES` property on a target. If no
diff --git a/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst
index 2982b39..55133af 100644
--- a/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst
+++ b/Help/variable/CMAKE_VS_NsightTegra_VERSION.rst
@@ -3,7 +3,7 @@
 
 .. versionadded:: 3.1
 
-When using a Visual Studio generator with the
+When using :ref:`Visual Studio Generators` with the
 :variable:`CMAKE_SYSTEM_NAME` variable set to ``Android``,
 this variable contains the version number of the
 installed NVIDIA Nsight Tegra Visual Studio Edition.
diff --git a/Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst b/Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst
index 35d94bc..43befe6 100644
--- a/Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst
+++ b/Help/variable/CMAKE_VS_USE_DEBUG_LIBRARIES.rst
@@ -6,7 +6,7 @@
 .. |VS_USE_DEBUG_LIBRARIES| replace:: ``CMAKE_VS_USE_DEBUG_LIBRARIES``
 .. |MSVC_RUNTIME_LIBRARY| replace:: :variable:`CMAKE_MSVC_RUNTIME_LIBRARY`
 
-.. include:: ../prop_tgt/VS_USE_DEBUG_LIBRARIES-PURPOSE.txt
+.. include:: ../prop_tgt/include/VS_USE_DEBUG_LIBRARIES-PURPOSE.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>`
 for per-configuration specification.  For example, the code:
diff --git a/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst b/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst
index f86ed7c..9850a32 100644
--- a/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst
+++ b/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER.rst
@@ -9,6 +9,6 @@
 variable to the Visual Studio version build number in the format
 ``<major>.<minor>.<date>.<build>``.
 
-.. include:: CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.txt
+.. include:: include/CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.rst
 
 See also the :variable:`CMAKE_GENERATOR_INSTANCE` variable.
diff --git a/Help/variable/CMAKE_WATCOM_RUNTIME_LIBRARY.rst b/Help/variable/CMAKE_WATCOM_RUNTIME_LIBRARY.rst
index feb2a60..8d1f36c 100644
--- a/Help/variable/CMAKE_WATCOM_RUNTIME_LIBRARY.rst
+++ b/Help/variable/CMAKE_WATCOM_RUNTIME_LIBRARY.rst
@@ -10,7 +10,7 @@
 
 The allowed values are:
 
-.. include:: ../prop_tgt/WATCOM_RUNTIME_LIBRARY-VALUES.txt
+.. include:: ../prop_tgt/include/WATCOM_RUNTIME_LIBRARY-VALUES.rst
 
 Use :manual:`generator expressions <cmake-generator-expressions(7)>` to
 support per-configuration specification.
diff --git a/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
index d5893c9..12e6327 100644
--- a/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
+++ b/Help/variable/CTEST_CUSTOM_COVERAGE_EXCLUDE.rst
@@ -4,4 +4,4 @@
 A list of regular expressions which will be used to exclude files by their
 path from coverage output by the :command:`ctest_coverage` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
index b8ea1e9..a1212c6 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_EXCEPTION.rst
@@ -4,4 +4,4 @@
 A list of regular expressions which will be used to exclude when detecting
 error messages in build outputs by the :command:`ctest_build` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
index e8f4ad4..a3a8b6a 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_MATCH.rst
@@ -4,4 +4,4 @@
 A list of regular expressions which will be used to detect error messages in
 build outputs by the :command:`ctest_build` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
index 31c99e7..cb1b9ca 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_POST_CONTEXT.rst
@@ -4,4 +4,4 @@
 The number of lines to include as context which follow an error message by the
 :command:`ctest_build` command. The default is 10.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
index ae03a5c..5790146 100644
--- a/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
+++ b/Help/variable/CTEST_CUSTOM_ERROR_PRE_CONTEXT.rst
@@ -4,4 +4,4 @@
 The number of lines to include as context which precede an error message by
 the :command:`ctest_build` command. The default is 10.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
index 007cfe0..035551c 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE.rst
@@ -9,7 +9,7 @@
 If a test's output contains the literal string "CTEST_FULL_OUTPUT",
 the output will not be truncated and may exceed the maximum size.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
 
 For controlling the output collection of passing tests, see
 :variable:`CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE`.
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
index 920cb04..dee7020 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS.rst
@@ -5,4 +5,4 @@
 After this, the :command:`ctest_test` command will truncate the output.
 Defaults to 50.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
index a1f1cc1..25c1135 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS.rst
@@ -5,4 +5,4 @@
 After this, the :command:`ctest_test` command will truncate the output.
 Defaults to 50.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
index 8545fc4..bc9d62c 100644
--- a/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
+++ b/Help/variable/CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE.rst
@@ -9,7 +9,7 @@
 If a test's output contains the literal string "CTEST_FULL_OUTPUT",
 the output will not be truncated and may exceed the maximum size.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
 
 For controlling the output collection of failing tests, see
 :variable:`CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE`.
diff --git a/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
index 578576c..ae7f6a5 100644
--- a/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
+++ b/Help/variable/CTEST_CUSTOM_MEMCHECK_IGNORE.rst
@@ -4,4 +4,4 @@
 A list of regular expressions to use to exclude tests during the
 :command:`ctest_memcheck` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
index 40291fe..a4b6dbd 100644
--- a/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
+++ b/Help/variable/CTEST_CUSTOM_POST_MEMCHECK.rst
@@ -3,4 +3,4 @@
 
 A list of commands to run at the end of the :command:`ctest_memcheck` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_POST_TEST.rst b/Help/variable/CTEST_CUSTOM_POST_TEST.rst
index 791292c..36af898 100644
--- a/Help/variable/CTEST_CUSTOM_POST_TEST.rst
+++ b/Help/variable/CTEST_CUSTOM_POST_TEST.rst
@@ -3,4 +3,4 @@
 
 A list of commands to run at the end of the :command:`ctest_test` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
index 00de8aa..458be84 100644
--- a/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
+++ b/Help/variable/CTEST_CUSTOM_PRE_MEMCHECK.rst
@@ -4,4 +4,4 @@
 A list of commands to run at the start of the :command:`ctest_memcheck`
 command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_PRE_TEST.rst b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
index 6af7152..cbea85b 100644
--- a/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
+++ b/Help/variable/CTEST_CUSTOM_PRE_TEST.rst
@@ -3,4 +3,4 @@
 
 A list of commands to run at the start of the :command:`ctest_test` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
index 7b1a4b8..cb0c3fc 100644
--- a/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
+++ b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
@@ -4,4 +4,4 @@
 A list of test names to be excluded from the set of tests run by the
 :command:`ctest_test` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst b/Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst
index 2d4219e..3ecc8e8 100644
--- a/Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst
+++ b/Help/variable/CTEST_CUSTOM_TEST_OUTPUT_TRUNCATION.rst
@@ -9,4 +9,4 @@
 By default the ``tail`` of the output will be truncated. Other possible
 values are ``middle`` and ``head``.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
index a03d473..d37148b 100644
--- a/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
+++ b/Help/variable/CTEST_CUSTOM_WARNING_EXCEPTION.rst
@@ -4,4 +4,4 @@
 A list of regular expressions which will be used to exclude when detecting
 warning messages in build outputs by the :command:`ctest_build` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
index 18aa6b3..c276473 100644
--- a/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
+++ b/Help/variable/CTEST_CUSTOM_WARNING_MATCH.rst
@@ -4,4 +4,4 @@
 A list of regular expressions which will be used to detect warning messages in
 build outputs by the :command:`ctest_build` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_CVS_CHECKOUT.rst b/Help/variable/CTEST_CVS_CHECKOUT.rst
index 32cf9eb..442138f 100644
--- a/Help/variable/CTEST_CVS_CHECKOUT.rst
+++ b/Help/variable/CTEST_CVS_CHECKOUT.rst
@@ -1,6 +1,6 @@
 CTEST_CVS_CHECKOUT
 ------------------
 
-.. versionadded:: 3.1
+.. deprecated:: 3.1
 
-Deprecated.  Use :variable:`CTEST_CHECKOUT_COMMAND` instead.
+  Use :variable:`CTEST_CHECKOUT_COMMAND` variable instead.
diff --git a/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
index 1d7e8d4..03540dd 100644
--- a/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
+++ b/Help/variable/CTEST_EXTRA_COVERAGE_GLOB.rst
@@ -6,4 +6,4 @@
 A list of regular expressions which will be used to find files which should be
 covered by the :command:`ctest_coverage` command.
 
-.. include:: CTEST_CUSTOM_XXX.txt
+.. include:: include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/CTEST_TLS_VERSION.rst b/Help/variable/CTEST_TLS_VERSION.rst
index f8123df..b2aec5b 100644
--- a/Help/variable/CTEST_TLS_VERSION.rst
+++ b/Help/variable/CTEST_TLS_VERSION.rst
@@ -10,7 +10,7 @@
 
 The value may be one of:
 
-.. include:: CMAKE_TLS_VERSION-VALUES.txt
+.. include:: include/CMAKE_TLS_VERSION-VALUES.rst
 
 If ``CTEST_TLS_VERSION`` is not set, the :variable:`CMAKE_TLS_VERSION` variable
 or :envvar:`CMAKE_TLS_VERSION` environment variable is used instead.
diff --git a/Help/variable/LINKER_FLAGS.txt b/Help/variable/LINKER_FLAGS.txt
deleted file mode 100644
index 7b0630a..0000000
--- a/Help/variable/LINKER_FLAGS.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-.. include:: ../command/LINK_LIBRARIES_LINKER.txt
-
-This support implies to parse and re-quote the content of the variable. See
-policy :policy:`CMP0181`.
diff --git a/Help/variable/PROJECT-NAME_COMPAT_VERSION.rst b/Help/variable/PROJECT-NAME_COMPAT_VERSION.rst
new file mode 100644
index 0000000..29c24b8
--- /dev/null
+++ b/Help/variable/PROJECT-NAME_COMPAT_VERSION.rst
@@ -0,0 +1,11 @@
+<PROJECT-NAME>_COMPAT_VERSION
+-----------------------------
+
+.. versionadded:: 4.1
+
+.. note::
+
+  Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
+
+Value given to the ``COMPAT_VERSION`` option of the most recent call to the
+:command:`project` command with project name ``<PROJECT-NAME>``, if any.
diff --git a/Help/variable/PROJECT_COMPAT_VERSION.rst b/Help/variable/PROJECT_COMPAT_VERSION.rst
new file mode 100644
index 0000000..cab800c
--- /dev/null
+++ b/Help/variable/PROJECT_COMPAT_VERSION.rst
@@ -0,0 +1,12 @@
+PROJECT_COMPAT_VERSION
+----------------------
+
+.. versionadded:: 4.1
+
+.. note::
+
+  Experimental. Gated by ``CMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO``.
+
+Value given to the ``COMPAT_VERSION`` option of the most recent call to the
+:command:`project` command, if any. To obtain the compatibility version of the
+top level project, see the :variable:`CMAKE_PROJECT_COMPAT_VERSION` variable.
diff --git a/Help/variable/include/CMAKE_FIND_LIBRARY_VAR.rst b/Help/variable/include/CMAKE_FIND_LIBRARY_VAR.rst
new file mode 100644
index 0000000..4fc24d2
--- /dev/null
+++ b/Help/variable/include/CMAKE_FIND_LIBRARY_VAR.rst
@@ -0,0 +1,2 @@
+CMake sets this variable automatically during toolchain inspection by
+calls to the :command:`project` or :command:`enable_language` commands.
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH_MODE_XXX.txt b/Help/variable/include/CMAKE_FIND_ROOT_PATH_MODE_XXX.rst
similarity index 100%
rename from Help/variable/CMAKE_FIND_ROOT_PATH_MODE_XXX.txt
rename to Help/variable/include/CMAKE_FIND_ROOT_PATH_MODE_XXX.rst
diff --git a/Help/variable/include/CMAKE_LINK_GROUP_USING_FEATURE.rst b/Help/variable/include/CMAKE_LINK_GROUP_USING_FEATURE.rst
new file mode 100644
index 0000000..0f23d00
--- /dev/null
+++ b/Help/variable/include/CMAKE_LINK_GROUP_USING_FEATURE.rst
@@ -0,0 +1,78 @@
+Feature names are case-sensitive and may only contain letters, numbers
+and underscores.  Feature names defined in all uppercase are reserved for
+CMake's own built-in features (see `Predefined Features`_ further below).
+
+
+Feature Definitions
+^^^^^^^^^^^^^^^^^^^
+
+A group feature definition is a list that contains exactly two elements:
+
+::
+
+  <PREFIX> <SUFFIX>
+
+On the linker command line, ``<PREFIX>`` will precede the list of libraries
+in the group and ``<SUFFIX>`` will follow after.
+
+For the elements of this variable, the ``LINKER:`` prefix can be used.
+
+.. include:: ../command/include/LINK_OPTIONS_LINKER.rst
+  :start-line: 3
+
+Examples
+^^^^^^^^
+
+Solving cross-references between two static libraries
+"""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+A project may define two or more static libraries which have circular
+dependencies between them.  In order for the linker to resolve all symbols
+at link time, it may need to search repeatedly among the libraries until no
+new undefined references are created.  Different linkers use different syntax
+for achieving this.  The following example shows how this may be implemented
+for some linkers.  Note that this is for illustration purposes only.
+Projects should use the built-in ``RESCAN`` group feature instead
+(see `Predefined Features`_), which provides a more complete and more robust
+implementation of this functionality.
+
+.. code-block:: cmake
+
+  set(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED TRUE)
+  if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    set(CMAKE_C_LINK_GROUP_USING_cross_refs
+      "LINKER:--start-group"
+      "LINKER:--end-group"
+    )
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "SunPro" AND CMAKE_SYSTEM_NAME STREQUAL "SunOS")
+    set(CMAKE_C_LINK_GROUP_USING_cross_refs
+      "LINKER:-z,rescan-start"
+      "LINKER:-z,rescan-end"
+    )
+  else()
+    # feature not yet supported for the other environments
+    set(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED FALSE)
+  endif()
+
+  add_library(lib1 STATIC ...)
+  add_library(lib2 SHARED ...)
+
+  if(CMAKE_C_LINK_GROUP_USING_cross_refs_SUPPORTED)
+    target_link_libraries(lib2 PRIVATE "$<LINK_GROUP:cross_refs,lib1,external>")
+  else()
+    target_link_libraries(lib2 PRIVATE lib1 external)
+  endif()
+
+CMake will generate the following linker command line fragments when linking
+``lib2``:
+
+* ``GNU``: ``-Wl,--start-group /path/to/lib1.a -lexternal -Wl,--end-group``
+* ``SunPro``: ``-Wl,-z,rescan-start /path/to/lib1.a -lexternal -Wl,-z,rescan-end``
+
+
+Predefined Features
+^^^^^^^^^^^^^^^^^^^
+
+The following built-in group features are pre-defined by CMake:
+
+.. include:: include/LINK_GROUP_PREDEFINED_FEATURES.rst
diff --git a/Help/variable/include/CMAKE_LINK_LIBRARY_USING_FEATURE.rst b/Help/variable/include/CMAKE_LINK_LIBRARY_USING_FEATURE.rst
new file mode 100644
index 0000000..41c2172
--- /dev/null
+++ b/Help/variable/include/CMAKE_LINK_LIBRARY_USING_FEATURE.rst
@@ -0,0 +1,153 @@
+Feature names are case-sensitive and may only contain letters, numbers
+and underscores.  Feature names defined in all uppercase are reserved for
+CMake's own built-in features (see `Predefined Features`_ further below).
+
+Some aspects of feature behavior can be defined by the
+:variable:`CMAKE_<LANG>_LINK_LIBRARY_<FEATURE>_ATTRIBUTES` and
+:variable:`CMAKE_LINK_LIBRARY_<FEATURE>_ATTRIBUTES` variables.
+
+Feature Definitions
+^^^^^^^^^^^^^^^^^^^
+
+A library feature definition is a list that contains one or three elements:
+
+::
+
+  [<PREFIX>] <LIBRARY_EXPRESSION> [<SUFFIX>]
+
+When ``<PREFIX>`` and ``<SUFFIX>`` are specified, they precede and follow
+respectively the whole list of libraries specified in the
+:genex:`LINK_LIBRARY` expression, not each library item individually.
+There is no guarantee that the list of specified libraries will be kept
+grouped together though, so the ``<PREFIX>`` and ``<SUFFIX>`` may appear
+more than once if the library list is reorganized by CMake to satisfy other
+constraints.  This means constructs like ``--start-group`` and ``--end-group``,
+as supported by the GNU ``ld`` linker, cannot be used in this way.  The
+:genex:`LINK_GROUP` generator expression should be used instead for such
+constructs.
+
+``<LIBRARY_EXPRESSION>`` is used to specify the pattern for constructing the
+corresponding fragment on the linker command line for each library.
+The following placeholders can be used in the expression:
+
+* ``<LIBRARY>`` is expanded to the full path to the library for CMake targets,
+  or to a platform-specific value based on the item otherwise (the same as
+  ``<LINK_ITEM>`` on Windows, or the library base name for other platforms).
+* ``<LINK_ITEM>`` is expanded to how the library would normally be linked on
+  the linker command line.
+* ``<LIB_ITEM>`` is expanded to the full path to the library for CMake targets,
+  or the item itself exactly as specified in the ``<LIBRARY_EXPRESSION>``
+  otherwise.
+
+In addition to the above, it is possible to have one pattern for paths
+(CMake targets and external libraries specified with file paths) and another
+for other items specified by name only.  The ``PATH{}`` and ``NAME{}`` wrappers
+can be used to provide the expansion for those two cases, respectively.
+When wrappers are used, both must be present.  For example:
+
+.. code-block:: cmake
+
+  set(CMAKE_LINK_LIBRARY_USING_weak_library
+      "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}"
+  )
+
+For all three elements of this variable (``<PREFIX>``, ``<LIBRARY_EXPRESSION>``,
+and ``<SUFFIX>``), the ``LINKER:`` prefix can be used.
+
+.. include:: ../command/include/LINK_OPTIONS_LINKER.rst
+  :start-line: 3
+
+Examples
+^^^^^^^^
+
+Loading a whole static library
+""""""""""""""""""""""""""""""
+
+A common need is to prevent the linker from discarding any symbols from a
+static library.  Different linkers use different syntax for achieving this.
+The following example shows how this may be implemented for some linkers.
+Note that this is for illustration purposes only.  Projects should use the
+built-in ``WHOLE_ARCHIVE`` feature instead (see `Predefined Features`_), which
+provides a more complete and more robust implementation of this functionality.
+
+.. code-block:: cmake
+
+  set(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED TRUE)
+  if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+    set(CMAKE_C_LINK_LIBRARY_USING_load_archive "-force_load <LIB_ITEM>")
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    set(CMAKE_C_LINK_LIBRARY_USING_load_archive
+      "LINKER:--push-state,--whole-archive"
+      "<LINK_ITEM>"
+      "LINKER:--pop-state"
+    )
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+    set(CMAKE_C_LINK_LIBRARY_USING_load_archive "/WHOLEARCHIVE:<LIBRARY>")
+  else()
+    # feature not yet supported for the other environments
+    set(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED FALSE)
+  endif()
+
+  add_library(lib1 STATIC ...)
+  add_library(lib2 SHARED ...)
+
+  if(CMAKE_C_LINK_LIBRARY_USING_load_archive_SUPPORTED)
+    # The -force_load Apple linker option requires a file name
+    set(external_lib
+      "$<IF:$<LINK_LANG_AND_ID:C,AppleClang>,libexternal.a,external>"
+    )
+    target_link_libraries(lib2 PRIVATE
+      "$<LINK_LIBRARY:load_archive,lib1,${external_lib}>"
+    )
+  else()
+    target_link_libraries(lib2 PRIVATE lib1 external)
+  endif()
+
+CMake will generate the following link expressions:
+
+* ``AppleClang``: ``-force_load /path/to/lib1.a -force_load libexternal.a``
+* ``GNU``: ``-Wl,--push-state,--whole-archive /path/to/lib1.a -lexternal -Wl,--pop-state``
+* ``MSVC``: ``/WHOLEARCHIVE:/path/to/lib1.lib /WHOLEARCHIVE:external.lib``
+
+Linking a library as weak
+"""""""""""""""""""""""""
+
+On macOS, it is possible to link a library in weak mode (the library and all
+references are marked as weak imports).  Different flags must be used for a
+library specified by file path compared to one specified by name.
+This constraint can be solved using ``PATH{}`` and ``NAME{}`` wrappers.
+Again, the following example shows how this may be implemented for some
+linkers, but it is for illustration purposes only.  Projects should use the
+built-in ``WEAK_FRAMEWORK`` or ``WEAK_LIBRARY`` features instead (see
+`Predefined Features`_), which provide more complete and more robust
+implementations of this functionality.
+
+.. code-block:: cmake
+
+  if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+    set(CMAKE_LINK_LIBRARY_USING_weak_library
+        "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}"
+    )
+    set(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED TRUE)
+  endif()
+
+  add_library(lib SHARED ...)
+  add_executable(main ...)
+  if(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED)
+    target_link_libraries(main PRIVATE "$<LINK_LIBRARY:weak_library,lib,external>")
+  else()
+    target_link_libraries(main PRIVATE lib external)
+  endif()
+
+CMake will generate the following linker command line fragment when linking
+``main`` using the ``AppleClang`` toolchain:
+
+``-weak_library /path/to/lib -Xlinker -weak-lexternal``.
+
+
+Predefined Features
+^^^^^^^^^^^^^^^^^^^
+
+The following built-in library features are pre-defined by CMake:
+
+.. include:: include/LINK_LIBRARY_PREDEFINED_FEATURES.rst
diff --git a/Help/variable/CMAKE_OSX_VARIABLE.txt b/Help/variable/include/CMAKE_OSX_VARIABLE.rst
similarity index 100%
rename from Help/variable/CMAKE_OSX_VARIABLE.txt
rename to Help/variable/include/CMAKE_OSX_VARIABLE.rst
diff --git a/Help/variable/CMAKE_TLS_VERSION-VALUES.txt b/Help/variable/include/CMAKE_TLS_VERSION-VALUES.rst
similarity index 100%
rename from Help/variable/CMAKE_TLS_VERSION-VALUES.txt
rename to Help/variable/include/CMAKE_TLS_VERSION-VALUES.rst
diff --git a/Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.txt b/Help/variable/include/CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.rst
similarity index 100%
rename from Help/variable/CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.txt
rename to Help/variable/include/CMAKE_VS_VERSION_BUILD_NUMBER_COMPONENTS.rst
diff --git a/Help/variable/CTEST_CUSTOM_XXX.txt b/Help/variable/include/CTEST_CUSTOM_XXX.rst
similarity index 100%
rename from Help/variable/CTEST_CUSTOM_XXX.txt
rename to Help/variable/include/CTEST_CUSTOM_XXX.rst
diff --git a/Help/variable/IGNORE_SEARCH_LOCATIONS.txt b/Help/variable/include/IGNORE_SEARCH_LOCATIONS.rst
similarity index 100%
rename from Help/variable/IGNORE_SEARCH_LOCATIONS.txt
rename to Help/variable/include/IGNORE_SEARCH_LOCATIONS.rst
diff --git a/Help/variable/IGNORE_SEARCH_NONSYSTEM.txt b/Help/variable/include/IGNORE_SEARCH_NONSYSTEM.rst
similarity index 100%
rename from Help/variable/IGNORE_SEARCH_NONSYSTEM.txt
rename to Help/variable/include/IGNORE_SEARCH_NONSYSTEM.rst
diff --git a/Help/variable/IGNORE_SEARCH_PATH.txt b/Help/variable/include/IGNORE_SEARCH_PATH.rst
similarity index 100%
rename from Help/variable/IGNORE_SEARCH_PATH.txt
rename to Help/variable/include/IGNORE_SEARCH_PATH.rst
diff --git a/Help/variable/IGNORE_SEARCH_PREFIX.txt b/Help/variable/include/IGNORE_SEARCH_PREFIX.rst
similarity index 100%
rename from Help/variable/IGNORE_SEARCH_PREFIX.txt
rename to Help/variable/include/IGNORE_SEARCH_PREFIX.rst
diff --git a/Help/variable/IGNORE_SEARCH_SYSTEM.txt b/Help/variable/include/IGNORE_SEARCH_SYSTEM.rst
similarity index 100%
rename from Help/variable/IGNORE_SEARCH_SYSTEM.txt
rename to Help/variable/include/IGNORE_SEARCH_SYSTEM.rst
diff --git a/Help/variable/include/LINKER_FLAGS.rst b/Help/variable/include/LINKER_FLAGS.rst
new file mode 100644
index 0000000..78bfc07
--- /dev/null
+++ b/Help/variable/include/LINKER_FLAGS.rst
@@ -0,0 +1,5 @@
+
+.. include:: ../command/include/LINK_LIBRARIES_LINKER.rst
+
+This support implies to parse and re-quote the content of the variable. See
+policy :policy:`CMP0181`.
diff --git a/Help/variable/LINKER_PREDEFINED_TYPES.txt b/Help/variable/include/LINKER_PREDEFINED_TYPES.rst
similarity index 100%
rename from Help/variable/LINKER_PREDEFINED_TYPES.txt
rename to Help/variable/include/LINKER_PREDEFINED_TYPES.rst
diff --git a/Help/variable/LINK_GROUP_PREDEFINED_FEATURES.txt b/Help/variable/include/LINK_GROUP_PREDEFINED_FEATURES.rst
similarity index 100%
rename from Help/variable/LINK_GROUP_PREDEFINED_FEATURES.txt
rename to Help/variable/include/LINK_GROUP_PREDEFINED_FEATURES.rst
diff --git a/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt b/Help/variable/include/LINK_LIBRARY_PREDEFINED_FEATURES.rst
similarity index 100%
rename from Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt
rename to Help/variable/include/LINK_LIBRARY_PREDEFINED_FEATURES.rst
diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake
index e8c8ee6..70f4c36 100644
--- a/Modules/AndroidTestUtilities.cmake
+++ b/Modules/AndroidTestUtilities.cmake
@@ -7,73 +7,87 @@
 
 .. versionadded:: 3.7
 
-Create a test that automatically loads specified data onto an Android device.
+This module provides a command to create a test that pushes data needed for
+testing an Android device behavior onto a connected Android device.
 
-Introduction
-^^^^^^^^^^^^
-
-Use this module to push data needed for testing an Android device behavior
-onto a connected Android device. The module will accept files and libraries as
-well as separate destinations for each. It will create a test that loads the
-files into a device object store and link to them from the specified
-destination. The files are only uploaded if they are not already in the object
-store.
-
-For example:
+Load this module in a CMake project with:
 
 .. code-block:: cmake
 
   include(AndroidTestUtilities)
-  android_add_test_data(
-    example_setup_test
-    FILES <files>...
-    LIBS <libs>...
-    DEVICE_TEST_DIR "/data/local/tests/example"
-    DEVICE_OBJECT_STORE "/sdcard/.ExternalData/SHA"
-    )
 
+Commands
+^^^^^^^^
 
-At build time a test named "example_setup_test" will be created.  Run this test
-on the command line with :manual:`ctest(1)` to load the data onto the Android
-device.
-
-Module Functions
-^^^^^^^^^^^^^^^^
+This module provides the following command:
 
 .. command:: android_add_test_data
 
+  Creates a test that automatically loads specified data onto an Android
+  device:
+
   .. code-block:: cmake
 
-    android_add_test_data(<test-name>
-      [FILES <files>...] [FILES_DEST <device-dir>]
-      [LIBS <libs>...]   [LIBS_DEST <device-dir>]
-      [DEVICE_OBJECT_STORE <device-dir>]
-      [DEVICE_TEST_DIR <device-dir>]
-      [NO_LINK_REGEX <strings>...]
-      )
+    android_add_test_data(
+      <test-name>
+      [FILES <files>...]
+      [FILES_DEST <device-dir>]
+      [LIBS <libs>...]
+      [LIBS_DEST <device-dir>]
+      DEVICE_OBJECT_STORE <device-dir>
+      DEVICE_TEST_DIR <device-dir>
+      [NO_LINK_REGEX <regexes>...]
+    )
 
-  The ``android_add_test_data`` function is used to copy files and libraries
-  needed to run project-specific tests. On the host operating system, this is
-  done at build time. For on-device testing, the files are loaded onto the
-  device by the manufactured test at run time.
+  This command accepts files and libraries needed to run project-specific
+  tests as well as separate destinations for each.  It will create a test
+  that loads the files into a device object store and link to them from the
+  specified destination.  The files are only uploaded if they are not
+  already in the object store.
 
-  This function accepts the following named parameters:
+  On the host operating system, files and libraries are copied at build
+  time.  For on-device testing, the files are loaded onto the device by the
+  manufactured test at run time.
+
+  This command accepts the following named parameters:
 
   ``FILES <files>...``
-    zero or more files needed for testing
-  ``LIBS <libs>...``
-    zero or more libraries needed for testing
+    Zero or more files needed for testing.
   ``FILES_DEST <device-dir>``
-    absolute path where the data files are expected to be
+    Absolute path where the data files are expected to be.
+  ``LIBS <libs>...``
+    Zero or more libraries needed for testing.
   ``LIBS_DEST <device-dir>``
-    absolute path where the libraries are expected to be
+    Absolute path where the libraries are expected to be.
   ``DEVICE_OBJECT_STORE <device-dir>``
-    absolute path to the location where the data is stored on-device
+    Absolute path to the on-device location where the data files are initially
+    stored.
   ``DEVICE_TEST_DIR <device-dir>``
-    absolute path to the root directory of the on-device test location
-  ``NO_LINK_REGEX <strings>...``
-    list of regex strings matching the names of files that should be
-    copied from the object store to the testing directory
+    Absolute path to the root directory of the on-device test location.
+  ``NO_LINK_REGEX <regexes>...``
+    A list of regular expression patterns matching file names to be copied
+    from the object store to the test directory, instead of being symlinked.
+
+Examples
+^^^^^^^^
+
+The following example shows how to use this module to create a test named
+``example_setup_test`` that prepares data during the build phase.  This test
+can then be run using :manual:`ctest(1)` to load the data onto the Android
+device.
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(AndroidTestUtilities)
+
+  android_add_test_data(
+    example_setup_test
+    FILES data/protobuffer.p data/file.txt
+    LIBS libs/library_1 libs/library_2
+    DEVICE_OBJECT_STORE "/sdcard/.ExternalData/SHA"
+    DEVICE_TEST_DIR "/data/local/tests/example"
+  )
 #]======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/ExternalData.cmake)
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 1189e92..4df5bb9 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -5,255 +5,505 @@
 BundleUtilities
 ---------------
 
-Functions to help assemble a standalone bundle application.
+This module provides utility commands for assembling standalone,
+bundle-style applications with CMake, such as macOS ``.app`` bundles or
+similar directory-based application bundles on other operating systems.
 
-A collection of CMake utility functions useful for dealing with ``.app``
-bundles on the Mac and bundle-like directories on any OS.
+Load this module in CMake installation with:
+
+.. code-block:: cmake
+
+  include(BundleUtilities)
 
 .. note::
 
-  Do not use these functions at configure time (from ``CMakeLists.txt``).
-  Instead, invoke them from an :command:`install(CODE)` or
-  :command:`install(SCRIPT)`.
+  Do not use this module at configure time (from ``CMakeLists.txt``).
+  Instead, include it and invoke its commands from an :command:`install(CODE)`
+  or :command:`install(SCRIPT)`.
 
-Functions
-^^^^^^^^^
+Commands
+^^^^^^^^
 
-The following functions are provided by this module:
+This module provides the following commands:
+
+* :command:`fixup_bundle`
+* :command:`copy_and_fixup_bundle`
+* :command:`verify_app`
+* :command:`get_bundle_main_executable`
+* :command:`get_dotapp_dir`
+* :command:`get_bundle_and_executable`
+* :command:`get_bundle_all_executables`
+* :command:`get_item_key`
+* :command:`get_item_rpaths`
+* :command:`clear_bundle_keys`
+* :command:`set_bundle_key_values`
+* :command:`get_bundle_keys`
+* :command:`copy_resolved_item_into_bundle`
+* :command:`copy_resolved_framework_into_bundle`
+* :command:`fixup_bundle_item`
+* :command:`verify_bundle_prerequisites`
+* :command:`verify_bundle_symlinks`
 
 .. command:: fixup_bundle
 
+  Prepares a bundle for distribution by fixing up its internal dependencies:
+
   .. code-block:: cmake
 
-    fixup_bundle(<app> <libs> <dirs> [IGNORE_ITEM <file>...])
+    fixup_bundle(<app> <libs> <dirs> [IGNORE_ITEM <files>...])
 
-  Fix up ``<app>`` bundle in-place and make it standalone, such that it can be
-  drag-n-drop copied to another machine and run on that machine as long
-  as all of the system libraries are compatible.
+  This command modifies the ``<app>`` bundle in-place to make it
+  self-contained and portable, so that it can be drag-n-drop copied to
+  another machine and run there, assuming all of the system libraries are
+  compatible.
 
-  If you pass plugins to ``fixup_bundle`` as the libs parameter, you should
-  install them or copy them into the bundle before calling ``fixup_bundle``.
-  The ``<libs>`` parameter is a list of libraries that must be fixed up, but
-  that cannot be determined by ``otool`` output analysis  (i.e. ``plugins``).
+  This command collects all dependencies (keys) for the executables and
+  libraries in the bundle.  For each dependency, it copies the required
+  files into the bundle and adjusts them according to their own
+  prerequisites.  Once complete, it clears the collected keys and invokes
+  the :command:`verify_app` command to ensure the final bundle is truly
+  standalone.
 
-  Gather all the keys for all the executables and libraries in a bundle,
-  and then, for each key, copy each prerequisite into the bundle.  Then
-  fix each one up according to its own list of prerequisites.
+  The arguments are:
 
-  Then clear all the keys and call ``verify_app`` on the final bundle to
-  ensure that it is truly standalone.
+  ``<app>``
+    The path to the bundle to fix.  This can be an ``.app`` directory or
+    direct path to an executable.
 
-  .. versionadded:: 3.6
-    As an optional parameter (``IGNORE_ITEM``) a list of file names can be
-    passed, which are then ignored
+  ``<libs>``
+    A list of libraries that must be fixed up, but that cannot be
+    automatically determined by the ``otool`` output analysis  (i.e.
+    ``plugins``).  If plugins are passed to this command as this parameter,
+    they should be installed or copied into the bundle before calling this
+    command.
+
+  ``<dirs>``
+    A list of paths where libraries might be found.  These paths are searched
+    first when a target without any path info is given.  Then standard system
+    locations are also searched: ``PATH``, Framework locations, ``/usr/lib``,
+    etc.
+
+  ``IGNORE_ITEM <files>...``
+    .. versionadded:: 3.6
+
+    Optional list of file names to ignore
     (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``).
 
 .. command:: copy_and_fixup_bundle
 
+  Copies the bundle and fixes up the new copied bundle in-place:
+
   .. code-block:: cmake
 
     copy_and_fixup_bundle(<src> <dst> <libs> <dirs>)
 
-  Makes a copy of the bundle ``<src>`` at location ``<dst>`` and then fixes up
-  the new copied bundle in-place at ``<dst>``.
+  This command makes a copy of the bundle ``<src>`` at location ``<dst>``
+  and then fixes up the new copied bundle in-place at ``<dst>``.
+
+  The arguments are:
+
+  ``<src>``
+    The directory of the bundle being copied.
+
+  ``<dst>``
+    The destination directory of the bundle copy.
+
+  ``<libs>``
+    A list of libraries that must be fixed up, but that cannot be
+    automatically determined by the ``otool`` output analysis  (i.e.
+    ``plugins``).  If plugins are passed to this command as this parameter,
+    they should be installed or copied into the bundle before calling this
+    command.
+
+  ``<dirs>``
+    A list of paths where libraries might be found.  These paths are searched
+    first when a target without any path info is given.  Then standard system
+    locations are also searched: ``PATH``, Framework locations, ``/usr/lib``,
+    etc.
 
 .. command:: verify_app
 
+  Verifies that an application bundle appears valid based on running analysis
+  tools on it:
+
   .. code-block:: cmake
 
-    verify_app(<app> [IGNORE_ITEM <file>...])
+    verify_app(<app> [IGNORE_ITEM <files>...])
 
-  Verifies that an application ``<app>`` appears valid based on running
-  analysis tools on it.  Calls :command:`message(FATAL_ERROR)` if the
-  application is not verified.
+  If the application fails verification, a :command:`message(FATAL_ERROR)`
+  is issued, halting the installation process.
 
-  .. versionadded:: 3.6
-    As an optional parameter (``IGNORE_ITEM``) a list of file names can be
-    passed, which are then ignored
-    (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
+  The arguments are:
+
+  ``<app>``
+    The path to the application to verify.  This can be a ``.app`` directory
+    or a standalone executable.
+
+  ``IGNORE_ITEM <files>...``
+    .. versionadded:: 3.6
+
+    Optional list of file names to ignore
+    (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``).
 
 .. command:: get_bundle_main_executable
 
+  Retrieves the main executable within a given application bundle:
+
   .. code-block:: cmake
 
-    get_bundle_main_executable(<bundle> <result_var>)
+    get_bundle_main_executable(<bundle> <result-var>)
 
-  The result will be the full path name of the bundle's main executable
-  file or an ``error:`` prefixed string if it could not be determined.
+  The result is stored in a ``<result-var>`` variable and will contain a
+  full path name of the bundle's main executable file, or an ``error:``
+  prefixed string if it could not be determined.
 
 .. command:: get_dotapp_dir
 
+  Locates the enclosing ``.app`` directory for the given executable:
+
   .. code-block:: cmake
 
-    get_dotapp_dir(<exe> <dotapp_dir_var>)
+    get_dotapp_dir(<exe> <dotapp-dir-var>)
 
-  Returns the nearest parent dir whose name ends with ``.app`` given the
-  full path to an executable.  If there is no such parent dir, then
-  simply return the dir containing the executable.
+  This command retrieves the nearest parent dir whose name ends with ``.app``
+  given the full path to an executable and stores it to the
+  ``<dotapp-dir-var>`` variable.  If there is no such parent dir, then it
+  simply retrieves the directory containing the executable.
 
-  The returned directory may or may not exist.
+  The retrieved directory may or may not exist.
 
 .. command:: get_bundle_and_executable
 
+  Takes either a ``.app`` directory name or the name of an executable
+  nested inside a ``.app`` directory and retrieves the path to the ``.app``
+  directory and the path to its main executable:
+
   .. code-block:: cmake
 
-    get_bundle_and_executable(<app> <bundle_var> <executable_var> <valid_var>)
+    get_bundle_and_executable(<app> <bundle-var> <executable-var> <valid-var>)
 
-  Takes either a ``.app`` directory name or the name of an executable
-  nested inside a ``.app`` directory and returns the path to the ``.app``
-  directory in ``<bundle_var>`` and the path to its main executable in
-  ``<executable_var>``.
+  The arguments are:
+
+  ``<app>``
+    The name of the application being processed.
+
+  ``<bundle-var>``
+    Variable name in which to store the resulting path to the ``.app``
+    directory.  In case of any error, this variable will contain an error
+    message prefixed with string ``error:``.
+
+  ``<executable-var>``
+    Variable name in which to store the resulting main executable.  In case
+    of any error, this variable will contain an error message prefixed with
+    string ``error:``.
+
+  ``<valid-var>``
+    Variable name in which the boolean result is stored whether this command
+    was successful or not.
 
 .. command:: get_bundle_all_executables
 
+  Gets all executables of a given bundle:
+
   .. code-block:: cmake
 
-    get_bundle_all_executables(<bundle> <exes_var>)
+    get_bundle_all_executables(<bundle> <exes-var>)
 
-  Scans ``<bundle>`` bundle recursively for all ``<exes_var>`` executable
-  files and accumulates them into a variable.
+  This command scans ``<bundle>`` bundle recursively for all executable
+  files and stores them into a variable ``<exes-var>``.
 
 .. command:: get_item_key
 
+  Generates a unique key for the given item:
+
   .. code-block:: cmake
 
-    get_item_key(<item> <key_var>)
+    get_item_key(<item> <key-var>)
 
-  Given ``<item>`` file name, generate ``<key_var>`` key that should be unique
-  considering the set of libraries that need copying or fixing up to
-  make a bundle standalone.  This is essentially the file name including
-  extension with ``.`` replaced by ``_``
+  Given ``<item>`` file name, this command generates ``<key-var>`` key that
+  should be unique considering the set of libraries that need copying or
+  fixing up to make a bundle standalone.  This is essentially the file name
+  including extension with ``.`` replaced by ``_``.
 
-  This key is used as a prefix for CMake variables so that we can
-  associate a set of variables with a given item based on its key.
+  This key is used as a prefix for CMake variables so that a set of
+  variables can be associated with a given item based on its key.
 
 .. command:: get_item_rpaths
 
+  Gets RPATHS (run-time search paths) for the given item:
+
   .. code-block:: cmake
 
-    get_item_rpaths(<item> <rpaths_var>)
+    get_item_rpaths(<item> <rpaths-var>)
 
-  Get RPATHS of the ``<item>`` file name and store them to the variable with
-  provided name ``<rpaths_var>``.
+  This command gets RPATHS of the ``<item>`` file name and stores them to
+  the variable with provided name ``<rpaths-var>``.
 
 .. command:: clear_bundle_keys
 
+  Clears all variables associated with keys:
+
   .. code-block:: cmake
 
-    clear_bundle_keys(<keys_var>)
+    clear_bundle_keys(<keys-var>)
 
-  Loop over the ``<keys_var>`` list of keys, clearing all the variables
-  associated with each key.  After the loop, clear the list of keys itself.
-
-  Caller of ``get_bundle_keys`` should call ``clear_bundle_keys`` when done with
-  list of keys.
+  This command loops over the ``<keys-var>`` list of keys, clearing all the
+  variables associated with each key.  After the loop, it clears the list of
+  keys itself.  This command should be called after the
+  :command:`get_bundle_keys` command, when done working with a list of keys.
 
 .. command:: set_bundle_key_values
 
+  Adds a key to the list of keys:
+
   .. code-block:: cmake
 
-    set_bundle_key_values(<keys_var> <context> <item> <exepath> <dirs>
-                          <copyflag> [<rpaths>])
+    set_bundle_key_values(
+      <keys-var>
+      <context>
+      <item>
+      <exepath>
+      <dirs>
+      <copyflag>
+      [<rpaths>]
+    )
 
-  Add ``<keys_var>`` key to the list (if necessary) for the given item.
-  If added, also set all the variables associated with that key.
+  This command adds the ``<keys-var>`` key to the list (if necessary) for
+  the given item.  If added, also set all the variables associated with
+  that key.
+
+  The arguments are:
+
+  ``<keys-var>``
+    Variable name holding the name of the key to be added to the list for
+    the given item.
+
+  ``<context>``
+    The path to the top level loading path used for ``@loader_path``
+    replacement on Apple operating systems.  When resolving item,
+    ``@loader_path`` references will be resolved relative to the directory
+    of the given context value (presumably another library).
+
+  ``<item>``
+    The item for which to add the key.
+
+  ``<exepath>``
+    The path to the top level executable used for ``@executable_path``
+    replacement on Apple operating systems.
+
+  ``<dirs>``
+    A list of paths where libraries might be found.  These paths are searched
+    first when a target without any path info is given.  Then standard system
+    locations are also searched: ``PATH``, Framework locations, ``/usr/lib``,
+    etc.
+
+  ``<copyflag>``
+    If set to ``1`` library symlink structure will be preserved.
+
+  ``<rpaths>``
+    Optional run-time search paths for an executable file or library to help
+    find files.
 
 .. command:: get_bundle_keys
 
+  Gets bundle keys:
+
   .. code-block:: cmake
 
-    get_bundle_keys(<app> <libs> <dirs> <keys_var> [IGNORE_ITEM <file>...])
+    get_bundle_keys(<app> <libs> <dirs> <keys-var> [IGNORE_ITEM <files>...])
 
-  Loop over all the executable and library files within ``<app>`` bundle (and
-  given as extra ``<libs>``) and accumulate a list of keys representing
-  them.  Set values associated with each key such that we can loop over
-  all of them and copy prerequisite libs into the bundle and then do
-  appropriate ``install_name_tool`` fixups.
+  This command loops over all the executable and library files within
+  ``<app>`` bundle (and given as extra ``<libs>``) and accumulate a list of
+  keys representing them.  It sets values associated with each key such
+  that they can be looped over all of them and copies prerequisite libs into
+  the bundle and then does appropriate ``install_name_tool`` fixups.
 
-  .. versionadded:: 3.6
-    As an optional parameter (``IGNORE_ITEM``) a list of file names can be
-    passed, which are then ignored
-    (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
+  The arguments are:
+
+  ``<app>``
+    The path to the bundle to fix.  This can be an ``.app`` directory or
+    direct path to an executable.
+
+  ``<libs>``
+    A list of libraries that must be fixed up, but that cannot be
+    automatically determined by the ``otool`` output analysis  (i.e.
+    ``plugins``).  If plugins are passed to this command as this parameter,
+    they should be installed or copied into the bundle before calling this
+    command.
+
+  ``<dirs>``
+    A list of paths where libraries might be found.  These paths are searched
+    first when a target without any path info is given.  Then standard system
+    locations are also searched: ``PATH``, Framework locations, ``/usr/lib``,
+    etc.
+
+  ``<keys-var>``
+    Variable name holding a list of keys that represent all executable and
+    library files within the bundle.
+
+  ``IGNORE_ITEM <files>...``
+    .. versionadded:: 3.6
+
+    Optional list of file names to ignore
+    (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``).
 
 .. command:: copy_resolved_item_into_bundle
 
+  Copies a resolved item into the bundle if necessary:
+
   .. code-block:: cmake
 
-    copy_resolved_item_into_bundle(<resolved_item> <resolved_embedded_item>)
+    copy_resolved_item_into_bundle(<resolved-item> <resolved-embedded-item>)
 
-  Copy a resolved item into the bundle if necessary.
-  Copy is not necessary, if the ``<resolved_item>`` is "the same as" the
-  ``<resolved_embedded_item>``.
+  Copy is not necessary, if the ``<resolved-item>`` is "the same as" the
+  ``<resolved-embedded-item>``.
 
 .. command:: copy_resolved_framework_into_bundle
 
+  Copies a resolved framework into the bundle if necessary:
+
   .. code-block:: cmake
 
-    copy_resolved_framework_into_bundle(<resolved_item> <resolved_embedded_item>)
+    copy_resolved_framework_into_bundle(<resolved-item> <resolved-embedded-item>)
 
-  Copy a resolved framework into the bundle if necessary.
-  Copy is not necessary, if the ``<resolved_item>`` is "the same as" the
-  ``<resolved_embedded_item>``.
+  Copy is not necessary, if the ``<resolved-item>`` is "the same as" the
+  ``<resolved-embedded-item>``.
 
-  By default, ``BU_COPY_FULL_FRAMEWORK_CONTENTS`` is not set.  If you want
-  full frameworks embedded in your bundles, set
-  ``BU_COPY_FULL_FRAMEWORK_CONTENTS`` to ``ON`` before calling fixup_bundle.  By
-  default, ``COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE`` copies the framework
-  dylib itself plus the framework ``Resources`` directory.
+  The following variables can be set before invoking this command:
+
+  ``BU_COPY_FULL_FRAMEWORK_CONTENTS``
+    By default, this variable is not set.  If full frameworks should be
+    embedded in the bundles, set this variable to boolean true before calling
+    the :command:`fixup_bundle` command.  By default, this command copies
+    the framework dylib itself plus the framework ``Resources`` directory.
 
 .. command:: fixup_bundle_item
 
+  Fixes up bundle item:
+
   .. code-block:: cmake
 
-    fixup_bundle_item(<resolved_embedded_item> <exepath> <dirs>)
+    fixup_bundle_item(<resolved-embedded-item> <exepath> <dirs>)
 
-  Get the direct/non-system prerequisites of the ``<resolved_embedded_item>``.
-  For each prerequisite, change the way it is referenced to the value of
-  the ``_EMBEDDED_ITEM`` keyed variable for that prerequisite.  (Most likely
-  changing to an ``@executable_path`` style reference.)
+  This command gets the direct/non-system prerequisites of the
+  ``<resolved-embedded-item>`` and for each prerequisite, it changes the
+  way it is referenced to the value of the ``_EMBEDDED_ITEM`` keyed variable
+  for that prerequisite.  Most likely changing to an ``@executable_path``
+  style reference.
 
-  This function requires that the ``<resolved_embedded_item>`` be ``inside``
-  the bundle already.  In other words, if you pass plugins to ``fixup_bundle``
-  as the libs parameter, you should install them or copy them into the
-  bundle before calling ``fixup_bundle``.  The ``libs`` parameter is a list of
-  libraries that must be fixed up, but that cannot be determined by
-  otool output analysis.  (i.e., ``plugins``)
+  This command requires that the ``<resolved-embedded-item>`` be ``inside``
+  the bundle already.  In other words, if plugins are passed to
+  :command:`fixup_bundle` command as its ``<libs>`` parameter, they should
+  be installed or copied into the bundle before calling the
+  :command:`fixup_bundle` command.
 
-  Also, change the id of the item being fixed up to its own
+  Also, it changes the id of the item being fixed up to its own
   ``_EMBEDDED_ITEM`` value.
 
-  Accumulate changes in a local variable and make *one* call to
-  ``install_name_tool`` at the end of the function with all the changes at
-  once.
+  Changes are accumulated in a local variable and *one* call is made to
+  ``install_name_tool`` command-line tool at the end of this command with
+  all the changes at once.
 
-  If the ``BU_CHMOD_BUNDLE_ITEMS`` variable is set then bundle items will be
-  marked writable before ``install_name_tool`` tries to change them.
+  The arguments are:
+
+  ``<resolved-embedded-item>``
+    The bundle item to be fixed up.
+
+  ``<exepath>``
+    The path to the top level executable used for ``@executable_path``
+    replacement on Apple operating systems.
+
+  ``<dirs>``
+    A list of paths where libraries might be found.  These paths are searched
+    first when a target without any path info is given.  Then standard system
+    locations are also searched: ``PATH``, Framework locations, ``/usr/lib``,
+    etc.
+
+  The following variables can be set before invoking this command:
+
+  ``BU_CHMOD_BUNDLE_ITEMS``
+    If this variable is set to boolean true value then bundle items will be
+    marked writable before ``install_name_tool`` tool tries to change them.
 
 .. command:: verify_bundle_prerequisites
 
-  .. code-block:: cmake
-
-    verify_bundle_prerequisites(<bundle> <result_var> <info_var>
-                                [IGNORE_ITEM <file>...])
-
   Verifies that the sum of all prerequisites of all files inside the
   bundle are contained within the bundle or are ``system`` libraries,
-  presumed to exist everywhere.
+  presumed to exist everywhere:
 
-  .. versionadded:: 3.6
-    As an optional parameter (``IGNORE_ITEM``) a list of file names can be
-    passed, which are then ignored
-    (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``)
+  .. code-block:: cmake
+
+    verify_bundle_prerequisites(
+      <bundle>
+      <result-var>
+      <info-var>
+      [IGNORE_ITEM <files>...]
+    )
+
+  The arguments are:
+
+  ``<bundle>``
+    Name of the bundle being verified.
+
+  ``<result-var>``
+    Name of the variable in which to store a boolean result of whether a
+    verification was successful.
+
+  ``<info-var>``
+    Name of the variable holding any informational messages produced by the
+    verification.
+
+  ``IGNORE_ITEM <files>...``
+    .. versionadded:: 3.6
+
+    Optional list of file names to ignore
+    (e.g. ``IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe"``).
 
 .. command:: verify_bundle_symlinks
 
+  Verifies that any symlinks found in the specified bundle point to other
+  files that are already also in the bundle:
+
   .. code-block:: cmake
 
-    verify_bundle_symlinks(<bundle> <result_var> <info_var>)
+    verify_bundle_symlinks(<bundle> <result-var> <info-var>)
 
-  Verifies that any symlinks found in the ``<bundle>`` bundle point to other
-  files that are already also in the bundle...  Anything that points to an
-  external file causes this function to fail the verification.
+  Anything that points to an external file causes this command to fail the
+  verification.
+
+  The arguments are:
+
+  ``<bundle>``
+    Name of the bundle being verified.
+
+  ``<result-var>``
+    Name of the variable in which to store a boolean result of whether a
+    verification was successful.
+
+  ``<info-var>``
+    Name of the variable holding any informational messages produced by the
+    verification.
+
+Examples
+^^^^^^^^
+
+Using this module inside the installation code that is executed at the
+installation phase:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  # ...
+
+  install(CODE "
+    include(BundleUtilities)
+    set(BU_CHMOD_BUNDLE_ITEMS TRUE)
+    fixup_bundle(
+      \"${fixup_exe}\"
+      \"${plugins}\"
+      \"${bin_dir};${library_dir};${binary_dir}\"
+    )
+  ")
 #]=======================================================================]
 
 function(_warn_cmp0080)
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in
index ac92379..5d54390 100644
--- a/Modules/CMakeASMCompiler.cmake.in
+++ b/Modules/CMakeASMCompiler.cmake.in
@@ -18,7 +18,7 @@
 set(CMAKE_ASM@ASM_DIALECT@_COMPILER_VERSION "@_CMAKE_ASM_COMPILER_VERSION@")
 set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
 @_SET_CMAKE_ASM_COMPILER_ID_VENDOR_MATCH@
-@_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARCHITECTURE_ID "@_CMAKE_ASM_COMPILER_ARCHITECTURE_ID@")
 @_SET_CMAKE_ASM_COMPILER_SYSROOT@
 
 set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 7530070..931dce2 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -22,7 +22,7 @@
   include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL  RESULT_VARIABLE _INCLUDED_FILE)
 endif()
 if(NOT _INCLUDED_FILE)
-  if("ASM${ASM_DIALECT}" STREQUAL "ASM")
+  if("ASM${ASM_DIALECT}" STREQUAL "ASM" AND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
     message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
   endif()
   include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
@@ -81,7 +81,7 @@
 
 if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
   set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
-    "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake
index 5ce4978..54e5153 100644
--- a/Modules/CMakeASM_NASMInformation.cmake
+++ b/Modules/CMakeASM_NASMInformation.cmake
@@ -46,7 +46,7 @@
 
 if(NOT CMAKE_ASM_NASM_LINK_EXECUTABLE)
   set(CMAKE_ASM_NASM_LINK_EXECUTABLE
-    "<CMAKE_LINKER> <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_LINKER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 if(CMAKE_ASM_NASM_COMPILER_ID STREQUAL "NASM")
diff --git a/Modules/CMakeAddFortranSubdirectory.cmake b/Modules/CMakeAddFortranSubdirectory.cmake
index dca6d23..9b386b0 100644
--- a/Modules/CMakeAddFortranSubdirectory.cmake
+++ b/Modules/CMakeAddFortranSubdirectory.cmake
@@ -5,42 +5,128 @@
 CMakeAddFortranSubdirectory
 ---------------------------
 
-Add a fortran-only subdirectory, find a fortran compiler, and build.
+This module provides a command to add a Fortran project located in a
+subdirectory.
 
-The ``cmake_add_fortran_subdirectory`` function adds a subdirectory
-to a project that contains a fortran-only subproject.  The module will
-check the current compiler and see if it can support fortran.  If no
-fortran compiler is found and the compiler is MSVC, then this module
-will find the MinGW gfortran.  It will then use an external project to
-build with the MinGW tools.  It will also create imported targets for
-the libraries created.  This will only work if the fortran code is
-built into a dll, so :variable:`BUILD_SHARED_LIBS` is turned on in
-the project.  In addition the :variable:`CMAKE_GNUtoMS` option is set
-to on, so that Microsoft ``.lib`` files are created.  Usage is as follows:
+Load it in a CMake project with:
 
 .. code-block:: cmake
 
+  include(CMakeAddFortranSubdirectory)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
+
+.. command:: cmake_add_fortran_subdirectory
+
+  Adds a Fortran-only subproject from subdirectory to the current project:
+
+  .. code-block:: cmake
+
+    cmake_add_fortran_subdirectory(
+      <subdir>
+      PROJECT <project-name>
+      ARCHIVE_DIR <dir>
+      RUNTIME_DIR <dir>
+      LIBRARIES <libs>...
+      LINK_LIBRARIES
+        [LINK_LIBS <lib> <deps>...]...
+      [CMAKE_COMMAND_LINE <flags>...]
+      NO_EXTERNAL_INSTALL
+    )
+
+  This command checks whether the current compiler supports Fortran or attempts
+  to locate a Fortran compiler.  If a compatible Fortran compiler is found, the
+  Fortran project located in ``<subdir>`` is added as a subdirectory to the
+  current project.
+
+  If no Fortran compiler is found and the compiler is ``MSVC``, it searches for
+  the MinGW ``gfortran`` compiler.  In this case, the Fortran project is built
+  as an external project using MinGW tools, and Fortran-related imported targets
+  are created.  This setup works only if the Fortran code is built as a shared
+  DLL library, so the :variable:`BUILD_SHARED_LIBS` variable is enabled in the
+  external project.  Additionally, the :variable:`CMAKE_GNUtoMS` variable is set
+  to ``ON`` to ensure that Microsoft-compatible ``.lib`` files are created.
+
+  The options are:
+
+  ``PROJECT``
+    The name of the Fortran project as defined in the top-level
+    ``CMakeLists.txt`` located in ``<subdir>``.
+
+  ``ARCHIVE_DIR``
+    Directory where the project places ``.lib`` archive files.  A relative path
+    is interpreted as relative to :variable:`CMAKE_CURRENT_BINARY_DIR`.
+
+  ``RUNTIME_DIR``
+    Directory where the project places ``.dll`` runtime files.  A relative path
+    is interpreted as relative to :variable:`CMAKE_CURRENT_BINARY_DIR`.
+
+  ``LIBRARIES``
+    Names of library targets to create or import into the current project.
+
+  ``LINK_LIBRARIES``
+    Specifies link interface libraries for ``LIBRARIES``.  This option expects a
+    list of ``LINK_LIBS <lib> <deps>...`` items, where:
+
+    * ``LINK_LIBS`` marks the start of a new pair
+    * ``<lib>`` is a library target.
+    * ``<deps>...`` represents one or more dependencies required by ``<lib>``.
+
+  ``CMAKE_COMMAND_LINE``
+    Additional command-line flags passed to :manual:`cmake(1)` command when
+    configuring the Fortran subproject.
+
+  ``NO_EXTERNAL_INSTALL``
+    Prevents installation of the external project.
+
+    .. note::
+
+      The ``NO_EXTERNAL_INSTALL`` option is required for forward compatibility
+      with a future version that supports installation of the external project
+      binaries during ``make install``.
+
+Examples
+^^^^^^^^
+
+Adding a Fortran subdirectory to a project can be done by including this module
+and calling the ``cmake_add_fortran_subdirectory()`` command.  In the following
+example, a Fortran project provides the ``hello`` library and its dependent
+``world`` library:
+
+.. code-block:: cmake
+
+  include(CMakeAddFortranSubdirectory)
+
   cmake_add_fortran_subdirectory(
-   <subdir>                # name of subdirectory
-   PROJECT <project_name>  # project name in subdir top CMakeLists.txt
-   ARCHIVE_DIR <dir>       # dir where project places .lib files
-   RUNTIME_DIR <dir>       # dir where project places .dll files
-   LIBRARIES <lib>...      # names of library targets to import
-   LINK_LIBRARIES          # link interface libraries for LIBRARIES
-    [LINK_LIBS <lib> <dep>...]...
-   CMAKE_COMMAND_LINE ...  # extra command line flags to pass to cmake
-   NO_EXTERNAL_INSTALL     # skip installation of external project
-   )
+    fortran-subdir
+    PROJECT FortranHelloWorld
+    ARCHIVE_DIR lib
+    RUNTIME_DIR bin
+    LIBRARIES hello world
+    LINK_LIBRARIES
+      LINK_LIBS hello world # hello library depends on the world library
+    NO_EXTERNAL_INSTALL
+  )
 
-Relative paths in ``ARCHIVE_DIR`` and ``RUNTIME_DIR`` are interpreted with
-respect to the build directory corresponding to the source directory
-in which the function is invoked.
+  # The Fortran target can be then linked to the main project target.
+  add_executable(main main.c)
+  target_link_libraries(main PRIVATE hello)
 
-Limitations:
+See Also
+^^^^^^^^
 
-``NO_EXTERNAL_INSTALL`` is required for forward compatibility with a
-future version that supports installation of the external project
-binaries during ``make install``.
+There are multiple ways to integrate Fortran libraries.  Alternative approaches
+include:
+
+* The :command:`add_subdirectory` command to add the subdirectory directly to
+  the build.
+* The :command:`export` command can be used in the subproject to provide
+  :ref:`Imported Targets` or similar for integration with other projects.
+* The :module:`FetchContent` or :module:`ExternalProject` modules when working
+  with external dependencies.
 #]=======================================================================]
 
 include(CheckLanguage)
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index e6b87f6..bd57731 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -5,21 +5,59 @@
 CMakeBackwardCompatibilityCXX
 -----------------------------
 
-define a bunch of backwards compatibility variables
+This module defines several backward compatibility cache variables for the
+``CXX`` language to support early C++ (pre-C++98, ANSI C++).
 
-::
+Load this module in a CMake project with:
 
-  CMAKE_ANSI_CXXFLAGS - flag for ansi c++
-  CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
-  include(TestForANSIStreamHeaders)
-  include(CheckIncludeFileCXX)
-  include(TestForSTDNamespace)
-  include(TestForANSIForScope)
+.. code-block:: cmake
+
+  include(CMakeBackwardCompatibilityCXX)
+
+The following modules are included by this module:
+
+* :module:`TestForANSIForScope`
+* :module:`TestForANSIStreamHeaders`
+* :module:`TestForSSTREAM`
+* :module:`TestForSTDNamespace`
+
+Additionally, the following cache variable may be defined:
+
+``CMAKE_ANSI_CXXFLAGS``
+  A space-separated string of compiler options for enabling ANSI C++ mode, if
+  available.
+
+.. note::
+
+  This module is intended for C++ code written before ``C++ 98``.  As of the
+  ``C++ 98`` standard, these issues have been formally addressed, making such
+  checks obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module provides backward compatibility cache variables, which
+can be used in C++.  For example:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(CMakeBackwardCompatibilityCXX)
+  file(
+    CONFIGURE
+    OUTPUT config.h
+    CONTENT [[
+      #cmakedefine CMAKE_NO_ANSI_FOR_SCOPE
+      #cmakedefine CMAKE_NO_ANSI_STRING_STREAM
+      #cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS
+      #cmakedefine CMAKE_NO_STD_NAMESPACE
+    ]]
+  )
 #]=======================================================================]
 
 if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
   # check for some ANSI flags in the CXX compiler if it is not gnu
-  if(NOT CMAKE_COMPILER_IS_GNUCXX)
+  if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     include(TestCXXAcceptsFlag)
     set(CMAKE_TRY_ANSI_CXX_FLAGS "")
     if(CMAKE_SYSTEM_NAME MATCHES "OSF")
@@ -28,7 +66,7 @@
     # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
     # if the compiler accepts it
     if(NOT CMAKE_TRY_ANSI_CXX_FLAGS STREQUAL "")
-      CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
+      check_cxx_accepts_flag(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
       # if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
       # to the flag
       if(CMAKE_CXX_ACCEPTS_FLAGS)
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 01d2885..1ccc7f5 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -19,7 +19,7 @@
 set(CMAKE_C_COMPILER_FRONTEND_VARIANT "@CMAKE_C_COMPILER_FRONTEND_VARIANT@")
 set(CMAKE_C_COMPILER_APPLE_SYSROOT "@CMAKE_C_COMPILER_APPLE_SYSROOT@")
 set(CMAKE_C_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@")
-@_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_C_COMPILER_ARCHITECTURE_ID "@CMAKE_C_COMPILER_ARCHITECTURE_ID@")
 @_SET_CMAKE_C_COMPILER_SYSROOT@
 @SET_MSVC_C_ARCHITECTURE_ID@
 @SET_CMAKE_XCODE_ARCHS@
diff --git a/Modules/CMakeCCompilerABI.c b/Modules/CMakeCCompilerABI.c
index 63596be..61e31d5 100644
--- a/Modules/CMakeCCompilerABI.c
+++ b/Modules/CMakeCCompilerABI.c
@@ -23,6 +23,9 @@
 #if defined(ABI_ID)
   require += info_abi[argc];
 #endif
+#if defined(ARCHITECTURE_ID)
+  require += info_arch[argc];
+#endif
   (void)argv;
   return require;
 }
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index ae53f91..c79362e 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -48,7 +48,7 @@
 #  define C_STD __STDC_VERSION__
 #endif
 
-#if !defined(__STDC__) && !defined(__clang__)
+#if !defined(__STDC__) && !defined(__clang__) && !defined(__RENESAS__)
 # if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
 #  define C_VERSION "90"
 # else
@@ -70,7 +70,7 @@
 
 const char* info_language_extensions_default = "INFO" ":" "extensions_default["
 #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) ||           \
-     defined(__TI_COMPILER_VERSION__)) &&                                     \
+     defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) &&             \
   !defined(__STRICT_ANSI__)
   "ON"
 #else
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index 98b97de..0540988 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -27,7 +27,7 @@
 
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME "${CMAKE_C_COMPILER}" NAME_WE)
-if(CMAKE_COMPILER_IS_GNUCC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_BASE_NAME gcc)
 endif()
 
@@ -132,9 +132,6 @@
 
 # C compiler information
 # <CMAKE_C_COMPILER>
-# <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
-# <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
-# <CMAKE_C_LINK_FLAGS>
 
 # Static library tools
 # <CMAKE_AR>
@@ -144,7 +141,7 @@
 # create a C shared library
 if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
   set(CMAKE_C_CREATE_SHARED_LIBRARY
-      "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 endif()
 
 # create a C shared module just copy the shared library rule
@@ -172,7 +169,7 @@
 
 if(NOT CMAKE_C_LINK_EXECUTABLE)
   set(CMAKE_C_LINK_EXECUTABLE
-    "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_C_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 set(CMAKE_C_USE_LINKER_INFORMATION TRUE)
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 6b8b433..ea31ea0 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -23,6 +23,7 @@
 set(CMAKE_CUDA_SIMULATE_ID "@CMAKE_CUDA_SIMULATE_ID@")
 set(CMAKE_CUDA_COMPILER_FRONTEND_VARIANT "@CMAKE_CUDA_COMPILER_FRONTEND_VARIANT@")
 set(CMAKE_CUDA_SIMULATE_VERSION "@CMAKE_CUDA_SIMULATE_VERSION@")
+set(CMAKE_CUDA_COMPILER_ARCHITECTURE_ID "@CMAKE_CUDA_COMPILER_ARCHITECTURE_ID@")
 @SET_MSVC_CUDA_ARCHITECTURE_ID@
 @_SET_CMAKE_CUDA_COMPILER_SYSROOT@
 
diff --git a/Modules/CMakeCUDACompilerABI.cu b/Modules/CMakeCUDACompilerABI.cu
index b04d0ec..1550a9d 100644
--- a/Modules/CMakeCUDACompilerABI.cu
+++ b/Modules/CMakeCUDACompilerABI.cu
@@ -14,6 +14,9 @@
 #if defined(ABI_ID)
   require += info_abi[argc];
 #endif
+#if defined(ARCHITECTURE_ID)
+  require += info_arch[argc];
+#endif
   static_cast<void>(argv);
 
   if (!cmakeCompilerCUDAArch()) {
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index 49a4270..70a0e71 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -75,6 +75,11 @@
     CACHE STRING "Compiler launcher for CUDA.")
 endif()
 
+if(NOT CMAKE_CUDA_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_CUDA_LINKER_LAUNCHER})
+  set(CMAKE_CUDA_LINKER_LAUNCHER "$ENV{CMAKE_CUDA_LINKER_LAUNCHER}"
+          CACHE STRING "Linker launcher for CUDA.")
+endif()
+
 include(CMakeCommonLanguageInclude)
 _cmake_common_language_platform_flags(CUDA)
 
@@ -88,7 +93,7 @@
 # create a shared library
 if(NOT CMAKE_CUDA_CREATE_SHARED_LIBRARY)
   set(CMAKE_CUDA_CREATE_SHARED_LIBRARY
-      "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+      "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
 endif()
 
 # create a shared module copy the shared library rule by default
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 799c88c..8e2e3d6 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -21,7 +21,7 @@
 set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "@CMAKE_CXX_COMPILER_FRONTEND_VARIANT@")
 set(CMAKE_CXX_COMPILER_APPLE_SYSROOT "@CMAKE_CXX_COMPILER_APPLE_SYSROOT@")
 set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@")
-@_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "@CMAKE_CXX_COMPILER_ARCHITECTURE_ID@")
 @_SET_CMAKE_CXX_COMPILER_SYSROOT@
 @SET_MSVC_CXX_ARCHITECTURE_ID@
 @SET_CMAKE_XCODE_ARCHS@
diff --git a/Modules/CMakeCXXCompilerABI.cpp b/Modules/CMakeCXXCompilerABI.cpp
index 036b96e..23e4bdf 100644
--- a/Modules/CMakeCXXCompilerABI.cpp
+++ b/Modules/CMakeCXXCompilerABI.cpp
@@ -13,6 +13,9 @@
 #if defined(ABI_ID)
   require += info_abi[argc];
 #endif
+#if defined(ARCHITECTURE_ID)
+  require += info_arch[argc];
+#endif
   (void)argv;
   return require;
 }
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 5287e50..4d78c2a 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -108,7 +108,7 @@
 
 const char* info_language_extensions_default = "INFO" ":" "extensions_default["
 #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) ||           \
-     defined(__TI_COMPILER_VERSION__)) &&                                     \
+     defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) &&             \
   !defined(__STRICT_ANSI__)
   "ON"
 #else
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 99f7201..465679c 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -28,7 +28,7 @@
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME "${CMAKE_CXX_COMPILER}" NAME_WE)
 # since the gnu compiler has several names force g++
-if(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_BASE_NAME g++)
 endif()
 
@@ -135,9 +135,6 @@
 
 # CXX compiler information
 # <CMAKE_CXX_COMPILER>
-# <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
-# <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
-# <CMAKE_CXX_LINK_FLAGS>
 
 # Static library tools
 # <CMAKE_AR>
@@ -147,7 +144,7 @@
 # create a shared C++ library
 if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
   set(CMAKE_CXX_CREATE_SHARED_LIBRARY
-      "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 endif()
 
 # create a c++ shared module copy the shared library rule by default
@@ -176,7 +173,7 @@
 
 if(NOT CMAKE_CXX_LINK_EXECUTABLE)
   set(CMAKE_CXX_LINK_EXECUTABLE
-    "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_CXX_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 mark_as_advanced(
diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake
index 831dc4a..0dd8b65 100644
--- a/Modules/CMakeCommonLanguageInclude.cmake
+++ b/Modules/CMakeCommonLanguageInclude.cmake
@@ -13,7 +13,7 @@
 cmake_initialize_per_config_variable(CMAKE_EXE_LINKER_FLAGS    "Flags used by the linker")
 cmake_initialize_per_config_variable(CMAKE_SHARED_LINKER_FLAGS "Flags used by the linker during the creation of shared libraries")
 cmake_initialize_per_config_variable(CMAKE_MODULE_LINKER_FLAGS "Flags used by the linker during the creation of modules")
-cmake_initialize_per_config_variable(CMAKE_STATIC_LINKER_FLAGS "Flags used by the linker during the creation of static libraries")
+cmake_initialize_per_config_variable(CMAKE_STATIC_LINKER_FLAGS "Flags used by the archiver during the creation of static libraries")
 
 # Alias the build tool variable for backward compatibility.
 set(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM})
@@ -99,15 +99,15 @@
   # so unless the variable CMAKE_MODULE_EXISTS is set just
   # copy the values from the LIBRARY variables
   if(NOT CMAKE_MODULE_EXISTS)
-    set(CMAKE_SHARED_MODULE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_${lang}_FLAGS})
-    set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS})
+    set(CMAKE_SHARED_MODULE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_${lang}_FLAGS}")
+    set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS}")
   endif()
 
   if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS)
-    set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
+    set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
   endif()
   if(NOT DEFINED CMAKE_SHARED_MODULE_${lang}_FLAGS)
-    set(CMAKE_SHARED_MODULE_${lang}_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
+    set(CMAKE_SHARED_MODULE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")
   endif()
 
   foreach(type IN ITEMS SHARED_LIBRARY SHARED_MODULE EXE)
diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h
index 621e3f8..dc71f9f 100644
--- a/Modules/CMakeCompilerABI.h
+++ b/Modules/CMakeCompilerABI.h
@@ -40,6 +40,110 @@
 #  define ABI_ID "ELF"
 #endif
 
+/* Sync with:
+ *   Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+ *   Modules/CMakeFortranCompilerABI.F
+ *   Modules/CMakeFortranCompilerABI.F90
+ *   Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+ */
+#if defined(__APPLE__) && defined(__arm64__)
+#  if defined(__ARM64_ARCH_8_32__)
+#    define ARCHITECTURE_ID "arm64_32"
+#  elif defined(__arm64e__)
+#    define ARCHITECTURE_ID "arm64e"
+#  else
+#    define ARCHITECTURE_ID "arm64"
+#  endif
+#elif defined(_MSC_VER) && defined(_M_ARM64EC)
+#  define ARCHITECTURE_ID "arm64ec"
+#elif defined(_MSC_VER) && defined(_M_ARM64)
+#  define ARCHITECTURE_ID "arm64"
+#elif defined(__arm64ec__)
+#  define ARCHITECTURE_ID "arm64ec"
+#elif defined(__aarch64__)
+#  define ARCHITECTURE_ID "aarch64"
+#elif __ARM_ARCH == 7 || _M_ARM == 7 || defined(__ARM_ARCH_7__) ||            \
+  defined(__TI_ARM_V7__)
+#  if defined(__APPLE__) && defined(__ARM_ARCH_7K__)
+#    define ARCHITECTURE_ID "armv7k"
+#  elif defined(__APPLE__) && defined(__ARM_ARCH_7S__)
+#    define ARCHITECTURE_ID "armv7s"
+#  else
+#    define ARCHITECTURE_ID "armv7"
+#  endif
+#elif __ARM_ARCH == 6 || _M_ARM == 6 || defined(__ARM_ARCH_6__) ||            \
+  defined(__TI_ARM_V6__)
+#  define ARCHITECTURE_ID "armv6"
+#elif __ARM_ARCH == 5 || _M_ARM == 5 || defined(__ARM_ARCH_5__) ||            \
+  defined(__TI_ARM_V5__)
+#  define ARCHITECTURE_ID "armv5"
+#elif defined(__alpha) || defined(__alpha) || defined(_M_ALPHA)
+#  define ARCHITECTURE_ID "alpha"
+#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) ||         \
+  defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+#  define ARCHITECTURE_ID "x86_64"
+#elif defined(__i686) || defined(__i686__) || _M_IX86 == 600
+#  define ARCHITECTURE_ID "i686"
+#elif defined(__i586) || defined(__i586__) || _M_IX86 == 500
+#  define ARCHITECTURE_ID "i586"
+#elif defined(__i486) || defined(__i486__) || _M_IX86 == 400
+#  define ARCHITECTURE_ID "i486"
+#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
+#  define ARCHITECTURE_ID "i386"
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+#  define ARCHITECTURE_ID "ia64"
+#elif defined(__loongarch64)
+#  define ARCHITECTURE_ID "loongarch64"
+#elif defined(__loongarch__)
+#  define ARCHITECTURE_ID "loongarch32"
+#elif defined(__m68k__)
+#  define ARCHITECTURE_ID "m68k"
+#elif defined(__mips64) || defined(__mips64__)
+#  if defined(_MIPSEL)
+#    define ARCHITECTURE_ID "mips64el"
+#  else
+#    define ARCHITECTURE_ID "mips64"
+#  endif
+#elif defined(__mips) || defined(__mips__)
+#  if defined(_MIPSEL)
+#    define ARCHITECTURE_ID "mipsel"
+#  else
+#    define ARCHITECTURE_ID "mips"
+#  endif
+#elif defined(__riscv) && __riscv_xlen == 64
+#  define ARCHITECTURE_ID "riscv64"
+#elif defined(__riscv) && __riscv_xlen == 32
+#  define ARCHITECTURE_ID "riscv32"
+#elif defined(__s390x__)
+#  define ARCHITECTURE_ID "s390x"
+#elif defined(__s390__)
+#  define ARCHITECTURE_ID "s390"
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+#  define ARCHITECTURE_ID "sparcv9"
+#elif defined(__sparc) || defined(__sparc__)
+#  define ARCHITECTURE_ID "sparc"
+#elif defined(__hppa) || defined(__hppa__)
+#  if defined(__LP64__)
+#    define ARCHITECTURE_ID "parisc64"
+#  else
+#    define ARCHITECTURE_ID "parisc"
+#  endif
+#elif defined(__ppc64__) || defined(__powerpc64__) || defined(__PPC64__) ||   \
+  defined(_ARCH_PPC64)
+#  if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+#    define ARCHITECTURE_ID "ppc64le"
+#  else
+#    define ARCHITECTURE_ID "ppc64"
+#  endif
+#elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__) ||         \
+  defined(_ARCH_PPC)
+#  if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+#    define ARCHITECTURE_ID "ppcle"
+#  else
+#    define ARCHITECTURE_ID "ppc"
+#  endif
+#endif
+
 /* Construct the string literal in pieces to prevent the source from
    getting matched.  Store it in a pointer rather than an array
    because some compilers will just produce instructions to fill the
@@ -49,3 +153,8 @@
                               ":"
                               "abi[" ABI_ID "]";
 #endif
+#if defined(ARCHITECTURE_ID)
+static char const* info_arch = "INFO"
+                               ":"
+                               "arch[" ARCHITECTURE_ID "]";
+#endif
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index dbbb65a..68182b8 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -68,6 +68,7 @@
       GHS
       Tasking
       OrangeC
+      Renesas
     )
     if ("x${lang}" STREQUAL "xC")
       list(APPEND ordered_compilers
@@ -89,6 +90,7 @@
       MSVC
       ADSP
       IAR
+      Diab
     )
     if ("x${lang}" STREQUAL "xC")
       list(APPEND ordered_compilers
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index acafd56..3db05da 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -5,61 +5,204 @@
 CMakeDependentOption
 --------------------
 
-Macro to provide an option dependent on other options.
+This module provides a command to define boolean options whose availability and
+default values depend on specified conditions or other options.  This helps
+maintain a clean configuration interface by only displaying options that are
+relevant to the current settings.
 
-This macro presents an option to the user only if a set of other
-conditions are true.
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CMakeDependentOption)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: cmake_dependent_option
 
+  Provides a boolean option that depends on a set of conditions:
+
   .. code-block:: cmake
 
-    cmake_dependent_option(<option> "<help_text>" <value> <depends> <force>)
+    cmake_dependent_option(<variable> <help> <value> <condition> <else-value>)
 
-  Makes ``<option>`` available to the user if the
-  :ref:`semicolon-separated list <CMake Language Lists>` of conditions in
-  ``<depends>`` are all true.  Otherwise, a local variable named ``<option>``
-  is set to ``<force>``.
+  This command creates a boolean ``<variable>`` and makes it available to the
+  user in the GUI (such as :manual:`cmake-gui(1)` or :manual:`ccmake(1)`), if
+  a set of conditions evaluates to boolean true.
 
-  When ``<option>`` is available, the given ``<help_text>`` and initial
-  ``<value>`` are used. Otherwise, any value set by the user is preserved for
-  when ``<depends>`` is satisfied in the future.
+  The arguments are:
 
-  Note that the ``<option>`` variable only has a value which satisfies the
-  ``<depends>`` condition within the scope of the caller because it is a local
-  variable.
+  ``<variable>``
+    The name of a variable that stores the option value.
 
-.. versionadded:: 3.22
+  ``<help>``
+    A brief description of the option.  This string is typically a short line of
+    text and is displayed in the GUI.
 
-  Full :ref:`Condition Syntax` is now supported.  See policy :policy:`CMP0127`.
+  ``<value>``
+    Boolean value for the ``<variable>``, when ``<condition>`` evaluates to
+    boolean true.
+
+  ``<condition>``
+    Specifies the conditions that determine whether ``<variable>`` is set and
+    visible in the GUI.
+
+    * If ``<condition>`` evaluates to boolean false, option is hidden from the
+      user in the GUI, and a local variable ``<variable>`` is set to
+      ``<else-value>``.
+
+    * If ``<condition>`` evaluates to boolean true, a boolean cache variable
+      named ``<variable>`` is created with default ``<value>``, and option is
+      shown in the GUI, allowing the user to enable or disable it.
+
+    * If ``<condition>`` later evaluates to boolean false (on consecutive
+      configuration run),  option is hidden from the user in the GUI and the
+      ``<variable>`` type is changed to an internal cache variable.  In that
+      case a local variable of the same name is set to ``<else-value>``.
+
+    * If ``<condition>`` becomes true again in consecutive configuration runs,
+      the user's previously set value is preserved.
+
+    The ``<condition>`` argument can be:
+
+    * A single condition (such as a variable name).
+
+    * A :ref:`semicolon-separated list <CMake Language Lists>` of multiple
+      conditions.
+
+    * .. versionadded:: 3.22
+        A full :ref:`Condition Syntax` as used in an ``if(<condition>)`` clause.
+        See policy :policy:`CMP0127`.  This enables using entire condition
+        syntax (such as grouping conditions with parens and similar).
+
+  ``<else-value>``
+    The value assigned to a local variable named ``<variable>``, when
+    ``<condition>`` evaluates to boolean false.
 
 Examples
 ^^^^^^^^
 
-Semicolon-separated list of conditions:
+Example: Basic Usage
+""""""""""""""""""""
+
+Using this module in a project to conditionally set an option:
 
 .. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(CMakeDependentOption)
+
+  cmake_dependent_option(USE_SSL_GNUTLS "Use GnuTLS for SSL" ON USE_SSL OFF)
+
+Example: Enabling/Disabling Dependent Option
+""""""""""""""""""""""""""""""""""""""""""""
+
+Extending the previous example, this demonstrates how the module allows
+user-configurable options based on a condition during the configuration phase:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(CMakeDependentOption)
+
+  option(USE_SSL "Enable SSL in the project" OFF)
+
+  cmake_dependent_option(USE_SSL_GNUTLS "Use GnuTLS for SSL" ON USE_SSL OFF)
+
+  message(STATUS "USE_SSL: ${USE_SSL}")
+  message(STATUS "USE_SSL_GNUTLS: ${USE_SSL_GNUTLS}")
+
+On the first configuration run, a boolean cache variable ``USE_SSL`` is set to
+OFF, and a local variable ``USE_SSL_GNUTLS`` is set to OFF:
+
+.. code-block:: console
+
+  $ cmake -B build-dir
+
+  -- USE_SSL: OFF
+  -- USE_SSL_GNUTLS: OFF
+
+Running CMake with ``USE_SSL=ON`` sets both ``USE_SSL`` and ``USE_SSL_GNUTLS``
+boolean cache variables to ON:
+
+.. code-block:: console
+
+  $ cmake -B build-dir -D USE_SSL=ON
+
+  -- USE_SSL: ON
+  -- USE_SSL_GNUTLS: ON
+
+On a subsequent configuration run with ``USE_SSL=OFF``, ``USE_SSL_GNUTLS``
+follows suit.  However, its value is preserved in the internal cache while being
+overridden locally:
+
+.. code-block:: console
+
+  $ cmake -B build-dir -D USE_SSL=OFF
+
+  -- USE_SSL: OFF
+  -- USE_SSL_GNUTLS: OFF
+
+Example: Semicolon-separated List of Conditions
+"""""""""""""""""""""""""""""""""""""""""""""""
+
+The ``<condition>`` argument can also be a semicolon-separated list of
+conditions.  In the following example, if the variable ``USE_BAR`` is ON and
+variable ``USE_ZOT`` is OFF, the option ``USE_FOO`` is available and defaults to
+ON.  Otherwise, ``USE_FOO`` is set to OFF and hidden from the user.
+
+If the values of ``USE_BAR`` or ``USE_ZOT`` change in the future configuration
+runs, the previous value of ``USE_FOO`` is preserved so that when it becomes
+available again, it retains its last set value.
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(CMakeDependentOption)
 
   cmake_dependent_option(USE_FOO "Use Foo" ON "USE_BAR;NOT USE_ZOT" OFF)
 
-If ``USE_BAR`` is true and ``USE_ZOT`` is false, this provides an option called
-``USE_FOO`` that defaults to ON. Otherwise, it sets ``USE_FOO`` to OFF and
-hides the option from the user. If the status of ``USE_BAR`` or ``USE_ZOT``
-ever changes, any value for the ``USE_FOO`` option is saved so that when the
-option is re-enabled it retains its old value.
+Example: Full Condition Syntax
+""""""""""""""""""""""""""""""
 
-Full condition syntax:
+As of CMake 3.22, ``cmake_dependent_option()`` supports full condition syntax.
+
+In fhe following example, if the condition evaluates to true, the option
+``USE_FOO`` is available and set to ON.  Otherwise, it is set to OFF and hidden
+in the GUI.  The value of ``USE_FOO`` is preserved across configuration runs,
+similar to the previous example.
 
 .. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(CMakeDependentOption)
 
   cmake_dependent_option(USE_FOO "Use Foo" ON "USE_A AND (USE_B OR USE_C)" OFF)
 
-Similar to the previous example, if the argument with full condition syntax
-evaluates to true, this provides an option called ``USE_FOO`` that defaults to
-ON. Otherwise, it sets ``USE_FOO`` to OFF and hides the option from the user in
-the GUI. When condition changes, option is saved in similar way as described
-above. This enables using entire condition syntax as being the ``if`` clause
-argument, such as grouping conditions with parens and similar.
+Another example demonstrates how an option can be conditionally available based
+on the target system:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(CMakeDependentOption)
+
+  cmake_dependent_option(
+    ENABLE_FOO
+    "Enable feature Foo (this option is available when building for Windows)"
+    ON
+    [[CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
+    OFF
+  )
+
+See Also
+^^^^^^^^
+
+* The :command:`option` command to provide a boolean option that the user can
+  optionally select.
 #]=======================================================================]
 
 macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 9124285..5f72d2f 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -6,6 +6,8 @@
 
 include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
 
+cmake_policy(GET CMP0194 _CMAKE_ASM_CMP0194)
+
 if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
   # prefer the environment variable ASM
   if(NOT $ENV{ASM${ASM_DIALECT}} STREQUAL "")
@@ -21,15 +23,32 @@
   # finally list compilers to try
   if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
     if(NOT CMAKE_ASM_COMPILER_INIT)
-      if(CMAKE_C_COMPILER)
-        set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_C_COMPILER})
-      elseif(CMAKE_CXX_COMPILER)
-        set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_CXX_COMPILER})
+      if(_CMAKE_ASM_CMP0194 STREQUAL "NEW")
+        set(_CMAKE_ASM_REGEX_MSVC "^(MSVC)$")
+        set(_CMAKE_ASM_REGEX_CL "(^|/)[Cc][Ll](\\.|$)")
+        set(_CMAKE_ASM_MAYBE_CL "")
+      else()
+        set(_CMAKE_ASM_REGEX_MSVC "CMP0194_OLD_MSVC_NOT_EXCLUDED")
+        set(_CMAKE_ASM_REGEX_CL "CMP0194_OLD_MSVC_NOT_EXCLUDED")
+        set(_CMAKE_ASM_MAYBE_CL "cl")
+      endif()
+      if(CMAKE_C_COMPILER_LOADED AND NOT CMAKE_C_COMPILER_ID MATCHES "${_CMAKE_ASM_REGEX_MSVC}")
+        set(CMAKE_ASM_COMPILER_LIST ${CMAKE_C_COMPILER})
+      elseif(NOT CMAKE_C_COMPILER_LOADED AND CMAKE_C_COMPILER AND NOT CMAKE_C_COMPILER MATCHES "${_CMAKE_ASM_REGEX_CL}")
+        set(CMAKE_ASM_COMPILER_LIST ${CMAKE_C_COMPILER})
+      elseif(CMAKE_CXX_COMPILER_LOADED AND NOT CMAKE_CXX_COMPILER_ID MATCHES "${_CMAKE_ASM_REGEX_MSVC}")
+        set(CMAKE_ASM_COMPILER_LIST ${CMAKE_CXX_COMPILER})
+      elseif(NOT CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER AND NOT CMAKE_CXX_COMPILER MATCHES "${_CMAKE_ASM_REGEX_CL}")
+        set(CMAKE_ASM_COMPILER_LIST ${CMAKE_CXX_COMPILER})
       else()
         # List all default C and CXX compilers
-        set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
-             ${_CMAKE_TOOLCHAIN_PREFIX}cc  ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc
-          CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC)
+        set(CMAKE_ASM_COMPILER_LIST
+             ${_CMAKE_TOOLCHAIN_PREFIX}cc  ${_CMAKE_TOOLCHAIN_PREFIX}gcc xlc
+             ${_CMAKE_ASM_MAYBE_CL}
+          CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ xlC)
+        unset(_CMAKE_ASM_MAYBE_CL)
+        unset(_CMAKE_ASM_REGEX_CL)
+        unset(_CMAKE_ASM_REGEX_MSVC)
       endif()
     endif()
   else() # some specific assembler "dialect"
@@ -96,7 +115,11 @@
 
   list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "-?")
-  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
+  if(_CMAKE_ASM_CMP0194 STREQUAL "NEW")
+    set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft.*Macro Assembler")
+  else()
+    set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
+  endif()
 
   list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI )
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI "-h")
@@ -110,6 +133,10 @@
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_IAR )
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_IAR "IAR Assembler")
 
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Diab)
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Diab "-V" )
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Diab "Wind River Systems")
+
   list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS ARMCC)
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ARMCC )
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ARMCC "(ARM Compiler)|(ARM Assembler)|(Arm Compiler)")
@@ -134,6 +161,10 @@
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Tasking "--version")
   set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Tasking "TASKING")
 
+  list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Renesas)
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Renesas "-v")
+  set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Renesas "(RX Family C/C\\+\\+ Compiler)|(RL78 Family Compiler)|(RH850 Family Compiler)")
+
   include(CMakeDetermineCompilerId)
   set(userflags)
   CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}")
@@ -162,6 +193,10 @@
         set(CMAKE_ASM${ASM_DIALECT}_COMPILER_FRONTEND_VARIANT "GNU")
       endif()
       set(_variant " with ${CMAKE_ASM${ASM_DIALECT}_COMPILER_FRONTEND_VARIANT}-like command-line")
+  elseif("x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xRenesas")
+    string(REGEX MATCH "[A-Za-z0-9]+ Family (C/C\\+\\+ )*Compiler [V|E][0-9|.]+" _compiler_id "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_OUTPUT}")
+    string(REGEX MATCH "R[A-Za-z0-9]+" CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID "${_compiler_id}")
+    string(REGEX MATCH "V[0-9|.]+" CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION "${_compiler_id}")
   endif()
 
   _cmake_find_compiler_sysroot(ASM${ASM_DIALECT})
@@ -181,6 +216,8 @@
   endif()
   if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID AND "x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xIAR")
     set(_archid " ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}")
+  elseif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID AND "x${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}" STREQUAL "xRenesas")
+    set(_archid " ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID} Family Assembler")
   else()
     set(_archid "")
   endif()
@@ -192,6 +229,11 @@
   message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
 endif()
 
+if("ASM${ASM_DIALECT}" STREQUAL "ASM" AND CMAKE_ASM_COMPILER_ID STREQUAL "MSVC" AND _CMAKE_ASM_CMP0194 STREQUAL "")
+  cmake_policy(GET_WARNING CMP0194 _CMAKE_ASM_CMP0194_WARNING)
+  message(AUTHOR_WARNING "${_CMAKE_ASM_CMP0194_WARNING}")
+endif()
+
 # If we have a gas/as cross compiler, they have usually some prefix, like
 # e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas , optionally
 # with a 3-component version number at the end
@@ -234,18 +276,6 @@
   message(STATUS "Didn't find assembler")
 endif()
 
-foreach(_var
-    COMPILER
-    COMPILER_ID
-    COMPILER_ARG1
-    COMPILER_ENV_VAR
-    COMPILER_AR
-    COMPILER_RANLIB
-    COMPILER_VERSION
-    )
-  set(_CMAKE_ASM_${_var} "${CMAKE_ASM${ASM_DIALECT}_${_var}}")
-endforeach()
-
 if(CMAKE_ASM${ASM_DIALECT}_COMPILER_SYSROOT)
   string(CONCAT _SET_CMAKE_ASM_COMPILER_SYSROOT
     "set(CMAKE_ASM${ASM_DIALECT}_COMPILER_SYSROOT \"${CMAKE_ASM${ASM_DIALECT}_COMPILER_SYSROOT}\")\n"
@@ -261,25 +291,21 @@
   set(_SET_CMAKE_ASM_COMPILER_ID_VENDOR_MATCH "")
 endif()
 
-if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID)
-  set(_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID
-    "set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID})")
-else()
-  set(_SET_CMAKE_ASM_COMPILER_ARCHITECTURE_ID "")
-endif()
-
 # configure variables set in this file for fast reload later on
-configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
-  ${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake @ONLY)
-
-foreach(_var
-    COMPILER
-    COMPILER_ID
-    COMPILER_ARG1
-    COMPILER_ENV_VAR
-    COMPILER_AR
-    COMPILER_RANLIB
-    COMPILER_VERSION
-    )
-  unset(_CMAKE_ASM_${_var})
-endforeach()
+block()
+  foreach(_var IN ITEMS
+      # Keep in sync with Internal/CMakeTestASMLinker.
+      COMPILER
+      COMPILER_ID
+      COMPILER_ARG1
+      COMPILER_ENV_VAR
+      COMPILER_AR
+      COMPILER_RANLIB
+      COMPILER_VERSION
+      COMPILER_ARCHITECTURE_ID
+      )
+    set(_CMAKE_ASM_${_var} "${CMAKE_ASM${ASM_DIALECT}_${_var}}")
+  endforeach()
+  configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
+    ${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake @ONLY)
+endblock()
diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake
index f110efd..82d7430 100644
--- a/Modules/CMakeDetermineASM_NASMCompiler.cmake
+++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake
@@ -11,20 +11,14 @@
   set(_CMAKE_ASM_NASM_COMPILER_PATHS
     "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]"
     "$ENV{ProgramFiles}/NASM"
-    "$ENV{${ENV_VARX86}}/NASM"
+    "$ENV{${_CMAKE_ENV_VARX86}}/NASM"
     "$ENV{LOCALAPPDATA}/NASM"
-    )
-  find_program(CMAKE_ASM_NASM_COMPILER
-    NAMES ${CMAKE_ASM_NASM_COMPILER_LIST}
-    PATHS ${_CMAKE_ASM_NASM_COMPILER_PATHS}
-    NO_DEFAULT_PATH
-    DOC "NASM compiler"
   )
   unset(_CMAKE_ENV_VARX86)
-  unset(_CMAKE_ASM_NASM_COMPILER_PATHS)
 endif()
 
 # Load the generic DetermineASM compiler file with the DIALECT set properly:
 set(ASM_DIALECT "_NASM")
 include(CMakeDetermineASMCompiler)
 set(ASM_DIALECT)
+unset(_CMAKE_ASM_NASM_COMPILER_PATHS)
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 214bca1..fbe5166 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -16,7 +16,6 @@
 #   CMAKE_C_COMPILER
 #   CMAKE_AR
 #   CMAKE_RANLIB
-#   CMAKE_COMPILER_IS_GNUCC
 #
 # If not already set before, it also sets
 #   _CMAKE_TOOLCHAIN_PREFIX
@@ -210,13 +209,6 @@
   set(_SET_CMAKE_C_COMPILER_SYSROOT "")
 endif()
 
-if(CMAKE_C_COMPILER_ARCHITECTURE_ID)
-  set(_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID
-    "set(CMAKE_C_COMPILER_ARCHITECTURE_ID ${CMAKE_C_COMPILER_ARCHITECTURE_ID})")
-else()
-  set(_SET_CMAKE_C_COMPILER_ARCHITECTURE_ID "")
-endif()
-
 if(MSVC_C_ARCHITECTURE_ID)
   set(SET_MSVC_C_ARCHITECTURE_ID
     "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 47f7140..edb3cc8 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -49,6 +49,29 @@
     if(NOT EXISTS ${CMAKE_CUDA_HOST_COMPILER})
       message(FATAL_ERROR "Could not find compiler set in environment variable CUDAHOSTCXX:\n$ENV{CUDAHOSTCXX}.\n${CMAKE_CUDA_HOST_COMPILER}")
     endif()
+  elseif(CMAKE_CUDA_HOST_COMPILER)
+    # We get here if CMAKE_CUDA_HOST_COMPILER was specified by the user or toolchain file.
+    if(IS_ABSOLUTE "${CMAKE_CUDA_HOST_COMPILER}")
+      # Convert to forward slashes.
+      cmake_path(CONVERT "${CMAKE_CUDA_HOST_COMPILER}" TO_CMAKE_PATH_LIST CMAKE_CUDA_HOST_COMPILER NORMALIZE)
+    else()
+      # Convert to absolute path so changes in `PATH` do not impact CUDA compilation.
+      find_program(_CMAKE_CUDA_HOST_COMPILER_PATH NO_CACHE NAMES "${CMAKE_CUDA_HOST_COMPILER}")
+      if(_CMAKE_CUDA_HOST_COMPILER_PATH)
+        set(CMAKE_CUDA_HOST_COMPILER "${_CMAKE_CUDA_HOST_COMPILER_PATH}")
+      endif()
+      unset(_CMAKE_CUDA_HOST_COMPILER_PATH)
+    endif()
+    if(NOT EXISTS "${CMAKE_CUDA_HOST_COMPILER}")
+      message(FATAL_ERROR "Could not find compiler set in variable CMAKE_CUDA_HOST_COMPILER:\n  ${CMAKE_CUDA_HOST_COMPILER}")
+    endif()
+    # If the value was cached, update the cache entry with our modifications.
+    get_property(_CMAKE_CUDA_HOST_COMPILER_CACHED CACHE CMAKE_CUDA_HOST_COMPILER PROPERTY TYPE)
+    if(_CMAKE_CUDA_HOST_COMPILER_CACHED)
+      set_property(CACHE CMAKE_CUDA_HOST_COMPILER PROPERTY VALUE "${CMAKE_CUDA_HOST_COMPILER}")
+      mark_as_advanced(CMAKE_CUDA_HOST_COMPILER)
+    endif()
+    unset(_CMAKE_CUDA_HOST_COMPILER_CACHED)
   endif()
 endif()
 
@@ -70,7 +93,7 @@
     # We determine the vendor to help with find the toolkit and use the right flags for detection right away.
     # The main compiler identification is still needed below to extract other information.
     list(APPEND CMAKE_CUDA_COMPILER_ID_VENDORS NVIDIA Clang)
-    set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: NVIDIA \\(R\\) Cuda compiler driver")
+    set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: [^\n]+ Cuda compiler driver")
     set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)")
     CMAKE_DETERMINE_COMPILER_ID_VENDOR(CUDA "--version")
 
@@ -179,24 +202,40 @@
 
   # Find target directory when crosscompiling.
   if(CMAKE_CROSSCOMPILING)
-    if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
+    if(CMAKE_CUDA_COMPILER_TARGET MATCHES "^([^-]+)(-|$)")
+      set(_CUDA_TARGET_PROCESSOR "${CMAKE_MATCH_1}")
+    elseif(CMAKE_SYSTEM_PROCESSOR)
+      set(_CUDA_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+    else()
+      message(FATAL_ERROR "Cross-compiling CUDA with Clang requires CMAKE_CUDA_COMPILER_TARGET and/or CMAKE_SYSTEM_PROCESSOR to be set.")
+    endif()
+    # Keep in sync with equivalent table in FindCUDAToolkit!
+    if(_CUDA_TARGET_PROCESSOR STREQUAL "armv7-a")
       # Support for NVPACK
-      set(_CUDA_TARGET_NAME "armv7-linux-androideabi")
-    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
-      set(_CUDA_TARGET_NAME "armv7-linux-gnueabihf")
-    elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
+      set(_CUDA_TARGET_NAMES "armv7-linux-androideabi")
+    elseif(_CUDA_TARGET_PROCESSOR MATCHES "arm")
+      set(_CUDA_TARGET_NAMES "armv7-linux-gnueabihf")
+    elseif(_CUDA_TARGET_PROCESSOR MATCHES "aarch64")
       if(ANDROID_ARCH_NAME STREQUAL "arm64")
-        set(_CUDA_TARGET_NAME "aarch64-linux-androideabi")
+        set(_CUDA_TARGET_NAMES "aarch64-linux-androideabi")
+      elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+        set(_CUDA_TARGET_NAMES "aarch64-qnx")
       else()
-        set(_CUDA_TARGET_NAME "aarch64-linux")
+        set(_CUDA_TARGET_NAMES "aarch64-linux" "sbsa-linux")
       endif()
-    elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-      set(_CUDA_TARGET_NAME "x86_64-linux")
+    elseif(_CUDA_TARGET_PROCESSOR STREQUAL "x86_64")
+      set(_CUDA_TARGET_NAMES "x86_64-linux")
     endif()
 
-    if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
-      set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
-    endif()
+    foreach(_CUDA_TARGET_NAME IN LISTS _CUDA_TARGET_NAMES)
+      if(EXISTS "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
+        set(_CUDA_TARGET_DIR "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}/targets/${_CUDA_TARGET_NAME}")
+        break()
+      endif()
+    endforeach()
+    unset(_CUDA_TARGET_NAME)
+    unset(_CUDA_TARGET_NAMES)
+    unset(_CUDA_TARGET_PROCESSOR)
   endif()
 
   # If not already set we can simply use the toolkit root or it's a scattered installation.
@@ -241,7 +280,6 @@
   unset(_CUDA_INCLUDE_DIRS)
   unset(_CUDA_LIBRARY_DIR)
   unset(_CUDA_TARGET_DIR)
-  unset(_CUDA_TARGET_NAME)
 elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
   include(Internal/CMakeNVCCParseImplicitInfo)
   # Parse CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT to get:
@@ -274,7 +312,7 @@
 # If the user did not set CMAKE_CUDA_ARCHITECTURES, use the compiler's default.
 if("${CMAKE_CUDA_ARCHITECTURES}" STREQUAL "")
   cmake_policy(GET CMP0104 _CUDA_CMP0104)
-  if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" OR _CUDA_CMP0104 STREQUAL "NEW")
+  if(CMAKE_CUDA_COMPILER_ID AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" OR _CUDA_CMP0104 STREQUAL "NEW"))
     set(CMAKE_CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES_DEFAULT}" CACHE STRING "CUDA architectures")
     if(NOT CMAKE_CUDA_ARCHITECTURES)
       message(FATAL_ERROR "Failed to detect a default CUDA architecture.\n\nCompiler output:\n${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}")
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 895f558..5331681 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -13,7 +13,6 @@
 #
 # Sets the following variables:
 #   CMAKE_CXX_COMPILER
-#   CMAKE_COMPILER_IS_GNUCXX
 #   CMAKE_AR
 #   CMAKE_RANLIB
 #
@@ -216,13 +215,6 @@
   set(_SET_CMAKE_CXX_COMPILER_SYSROOT "")
 endif()
 
-if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
-  set(_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID
-    "set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID})")
-else()
-  set(_SET_CMAKE_CXX_COMPILER_ARCHITECTURE_ID "")
-endif()
-
 if(MSVC_CXX_ARCHITECTURE_ID)
   set(SET_MSVC_CXX_ARCHITECTURE_ID
     "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 06e8bed..16c5554 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -4,7 +4,11 @@
 
 macro(_cmake_find_compiler lang)
   # Use already-enabled languages for reference.
-  get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+  if(DEFINED _CMAKE_CHECK_ENABLED_LANGUAGES)
+    set(_languages "${_CMAKE_CHECK_ENABLED_LANGUAGES}")
+  else()
+    get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+  endif()
   list(REMOVE_ITEM _languages "${lang}")
 
   if(CMAKE_${lang}_COMPILER_INIT)
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index acd372e..2d89f9d 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -150,6 +150,7 @@
       set(ABI_SIZEOF_DPTR "NOTFOUND")
       set(ABI_BYTE_ORDER "NOTFOUND")
       set(ABI_NAME "NOTFOUND")
+      set(ARCHITECTURE_ID "")
       foreach(info ${ABI_STRINGS})
         if("${info}" MATCHES "INFO:sizeof_dptr\\[0*([^]]*)\\]" AND NOT ABI_SIZEOF_DPTR)
           set(ABI_SIZEOF_DPTR "${CMAKE_MATCH_1}")
@@ -167,6 +168,9 @@
         if("${info}" MATCHES "INFO:abi\\[([^]]*)\\]" AND NOT ABI_NAME)
           set(ABI_NAME "${CMAKE_MATCH_1}")
         endif()
+        if("${info}" MATCHES "INFO:arch\\[([^]\"]*)\\]")
+          list(APPEND ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+        endif()
       endforeach()
 
       if(ABI_SIZEOF_DPTR)
@@ -183,6 +187,28 @@
         set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
       endif()
 
+      # The GNU Fortran compiler does not predefine architecture macros.
+      if(NOT CMAKE_${lang}_COMPILER_ARCHITECTURE_ID AND NOT ARCHITECTURE_ID
+         AND lang STREQUAL "Fortran" AND CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
+        execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" -dumpmachine
+          OUTPUT_VARIABLE _dumpmachine_triple OUTPUT_STRIP_TRAILING_WHITESPACE
+          ERROR_VARIABLE  _dumpmachine_stderr
+          RESULT_VARIABLE _dumpmachine_result
+          )
+        if(_dumpmachine_result EQUAL 0)
+          include(Internal/CMakeParseCompilerArchitectureId)
+          cmake_parse_compiler_architecture_id("${_dumpmachine_triple}" ARCHITECTURE_ID)
+        endif()
+      endif()
+
+      # For some compilers we detect the architecture id during compiler identification.
+      # If this was not one of those, use what was detected during compiler ABI detection,
+      # which might be a list, e.g., when CMAKE_OSX_ARCHITECTURES has multiple values.
+      if(NOT CMAKE_${lang}_COMPILER_ARCHITECTURE_ID AND ARCHITECTURE_ID)
+        list(SORT ARCHITECTURE_ID)
+        set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${ARCHITECTURE_ID}" PARENT_SCOPE)
+      endif()
+
       # Parse implicit include directory for this language, if available.
       if(CMAKE_${lang}_VERBOSE_FLAG)
         set (implicit_incdirs "")
@@ -261,7 +287,10 @@
         list(REMOVE_ITEM implicit_dirs ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
       endif()
 
-      # Filter out implicit link directories excluded by the environment.
+      # Filter out implicit link information excluded by the environment.
+      if(DEFINED ENV{CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES_EXCLUDE})
+        list(REMOVE_ITEM implicit_libs $ENV{CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES_EXCLUDE})
+      endif()
       if(DEFINED ENV{CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
         list(REMOVE_ITEM implicit_dirs $ENV{CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES_EXCLUDE})
       endif()
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 85c9754..2b7d797 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -386,6 +386,25 @@
     endif()
     if(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID AND "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xIAR")
       set(_archid " ${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}")
+    elseif(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID AND "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xRenesas")
+      # Architecture is "RH850", "RL78" or "RX", compiler name to show is "CC-RH", "CC-RL" or "CC-RX"
+      string(SUBSTRING ${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID} 0 2 _archid)
+      set(_archid " CC-${_archid}")
+      # Detected compiler version is in the form as "3.2.1", show it as "3.02.01" according to the compiler's document.
+      string(REPLACE "." ";" _version_list ${_version})
+      list(GET _version_list 0 _version)
+      foreach(_i RANGE 1 2)
+        list(GET _version_list ${_i} _minor)
+        string(LENGTH ${_minor} _minor_len)
+        if (${_minor_len} EQUAL 1)
+          set(_minor "0${_minor}")
+        endif()
+        string(APPEND _version ".${_minor}")
+        unset(_minor)
+        unset(_minor_len)
+      endforeach()
+      string(REPLACE " " " V" _version ${_version})
+      unset(_version_list)
     else()
       set(_archid "")
     endif()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index e0f9bef..f7727a9 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -327,13 +327,6 @@
   set(_SET_CMAKE_Fortran_COMPILER_SYSROOT "")
 endif()
 
-if(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID)
-  set(_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID
-    "set(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID ${CMAKE_Fortran_COMPILER_ARCHITECTURE_ID})")
-else()
-  set(_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID "")
-endif()
-
 if(MSVC_Fortran_ARCHITECTURE_ID)
   set(SET_MSVC_Fortran_ARCHITECTURE_ID
     "set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineHIPCompiler.cmake b/Modules/CMakeDetermineHIPCompiler.cmake
index 041302a..13ec392 100644
--- a/Modules/CMakeDetermineHIPCompiler.cmake
+++ b/Modules/CMakeDetermineHIPCompiler.cmake
@@ -90,7 +90,7 @@
   # We determine the vendor to use the right flags for detection right away.
   # The main compiler identification is still needed below to extract other information.
   list(APPEND CMAKE_HIP_COMPILER_ID_VENDORS NVIDIA Clang)
-  set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: NVIDIA \\(R\\) Cuda compiler driver")
+  set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_NVIDIA "nvcc: [^\n]+ Cuda compiler driver")
   set(CMAKE_HIP_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)")
   CMAKE_DETERMINE_COMPILER_ID_VENDOR(HIP "--version")
 
@@ -113,6 +113,29 @@
       if(NOT EXISTS "${CMAKE_HIP_HOST_COMPILER}")
         message(FATAL_ERROR "Could not find compiler set in environment variable HIPHOSTCXX:\n$ENV{HIPHOSTCXX}.\n${CMAKE_HIP_HOST_COMPILER}")
       endif()
+    elseif(CMAKE_HIP_HOST_COMPILER)
+      # We get here if CMAKE_HIP_HOST_COMPILER was specified by the user or toolchain file.
+      if(IS_ABSOLUTE "${CMAKE_HIP_HOST_COMPILER}")
+        # Convert to forward slashes.
+        cmake_path(CONVERT "${CMAKE_HIP_HOST_COMPILER}" TO_CMAKE_PATH_LIST CMAKE_HIP_HOST_COMPILER NORMALIZE)
+      else()
+        # Convert to absolute path so changes in `PATH` do not impact HIP compilation.
+        find_program(_CMAKE_HIP_HOST_COMPILER_PATH NO_CACHE NAMES "${CMAKE_HIP_HOST_COMPILER}")
+        if(_CMAKE_HIP_HOST_COMPILER_PATH)
+          set(CMAKE_HIP_HOST_COMPILER "${_CMAKE_HIP_HOST_COMPILER_PATH}")
+        endif()
+        unset(_CMAKE_HIP_HOST_COMPILER_PATH)
+      endif()
+      if(NOT EXISTS "${CMAKE_HIP_HOST_COMPILER}")
+        message(FATAL_ERROR "Could not find compiler set in variable CMAKE_HIP_HOST_COMPILER:\n  ${CMAKE_HIP_HOST_COMPILER}")
+      endif()
+      # If the value was cached, update the cache entry with our modifications.
+      get_property(_CMAKE_HIP_HOST_COMPILER_CACHED CACHE CMAKE_HIP_HOST_COMPILER PROPERTY TYPE)
+      if(_CMAKE_HIP_HOST_COMPILER_CACHED)
+        set_property(CACHE CMAKE_HIP_HOST_COMPILER PROPERTY VALUE "${CMAKE_HIP_HOST_COMPILER}")
+        mark_as_advanced(CMAKE_HIP_HOST_COMPILER)
+      endif()
+      unset(_CMAKE_HIP_HOST_COMPILER_CACHED)
     endif()
   endif()
 
@@ -268,13 +291,6 @@
   set(_SET_CMAKE_HIP_COMPILER_SYSROOT "")
 endif()
 
-if(CMAKE_HIP_COMPILER_ARCHITECTURE_ID)
-  set(_SET_CMAKE_HIP_COMPILER_ARCHITECTURE_ID
-    "set(CMAKE_HIP_COMPILER_ARCHITECTURE_ID ${CMAKE_HIP_COMPILER_ARCHITECTURE_ID})")
-else()
-  set(_SET_CMAKE_HIP_COMPILER_ARCHITECTURE_ID "")
-endif()
-
 if(MSVC_HIP_ARCHITECTURE_ID)
   set(SET_MSVC_HIP_ARCHITECTURE_ID
     "set(MSVC_HIP_ARCHITECTURE_ID ${MSVC_HIP_ARCHITECTURE_ID})")
diff --git a/Modules/CMakeDetermineOBJCCompiler.cmake b/Modules/CMakeDetermineOBJCCompiler.cmake
index 280be74..75b3900 100644
--- a/Modules/CMakeDetermineOBJCCompiler.cmake
+++ b/Modules/CMakeDetermineOBJCCompiler.cmake
@@ -13,8 +13,6 @@
 #   CMAKE_OBJC_COMPILER
 #   CMAKE_AR
 #   CMAKE_RANLIB
-#   CMAKE_COMPILER_IS_GNUOBJC
-#   CMAKE_COMPILER_IS_CLANGOBJC
 #
 # If not already set before, it also sets
 #   _CMAKE_TOOLCHAIN_PREFIX
@@ -169,13 +167,6 @@
 include(Compiler/${CMAKE_OBJC_COMPILER_ID}-FindBinUtils OPTIONAL)
 unset(_CMAKE_PROCESSING_LANGUAGE)
 
-if(CMAKE_OBJC_COMPILER_ARCHITECTURE_ID)
-  set(_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID
-    "set(CMAKE_OBJC_COMPILER_ARCHITECTURE_ID ${CMAKE_OBJC_COMPILER_ARCHITECTURE_ID})")
-else()
-  set(_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID "")
-endif()
-
 if(CMAKE_OBJC_XCODE_ARCHS)
   set(SET_CMAKE_XCODE_ARCHS
     "set(CMAKE_XCODE_ARCHS \"${CMAKE_OBJC_XCODE_ARCHS}\")")
diff --git a/Modules/CMakeDetermineOBJCXXCompiler.cmake b/Modules/CMakeDetermineOBJCXXCompiler.cmake
index 24f9175..8036da2 100644
--- a/Modules/CMakeDetermineOBJCXXCompiler.cmake
+++ b/Modules/CMakeDetermineOBJCXXCompiler.cmake
@@ -13,8 +13,6 @@
 #
 # Sets the following variables:
 #   CMAKE_OBJCXX_COMPILER
-#   CMAKE_COMPILER_IS_GNUOBJCXX
-#   CMAKE_COMPILER_IS_CLANGOBJCXX
 #   CMAKE_AR
 #   CMAKE_RANLIB
 #
@@ -176,13 +174,6 @@
 include(Compiler/${CMAKE_OBJCXX_COMPILER_ID}-FindBinUtils OPTIONAL)
 unset(_CMAKE_PROCESSING_LANGUAGE)
 
-if(CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID)
-  set(_SET_CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID
-    "set(CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID ${CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID})")
-else()
-  set(_SET_CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID "")
-endif()
-
 if(CMAKE_OBJCXX_XCODE_ARCHS)
   set(SET_CMAKE_XCODE_ARCHS
     "set(CMAKE_XCODE_ARCHS \"${CMAKE_OBJCXX_XCODE_ARCHS}\")")
diff --git a/Modules/CMakeDetermineSwiftCompiler.cmake b/Modules/CMakeDetermineSwiftCompiler.cmake
index a7dc150..6d46e78 100644
--- a/Modules/CMakeDetermineSwiftCompiler.cmake
+++ b/Modules/CMakeDetermineSwiftCompiler.cmake
@@ -126,6 +126,19 @@
   unset(_CMAKE_Swift_COMPILER_CHECK_OUTPUT)
 endif()
 
+if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.2)
+  set(target_info_command "${CMAKE_Swift_COMPILER}" -print-target-info)
+  if(CMAKE_Swift_COMPILER_TARGET)
+    list(APPEND target_info_command -target ${CMAKE_Swift_COMPILER_TARGET})
+  endif()
+  execute_process(
+    COMMAND ${target_info_command}
+    OUTPUT_VARIABLE swift_target_info)
+  message(CONFIGURE_LOG "Swift target info:\n" "${swift_target_info}")
+  string(JSON module_triple GET "${swift_target_info}" "target" "moduleTriple")
+  set(CMAKE_Swift_MODULE_TRIPLE ${module_triple})
+endif()
+
 if (NOT _CMAKE_TOOLCHAIN_LOCATION)
   get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_Swift_COMPILER}" PATH)
 endif ()
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index b2dfd1d..c9a9fb9 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -5,17 +5,52 @@
 CMakeDetermineVSServicePack
 ---------------------------
 
+.. versionchanged:: 4.1
+
+  This module is available only if policy :policy:`CMP0196` is not set to ``NEW``.
+
 .. deprecated:: 3.0
 
-  Do not use.
+  This module should no longer be used.  The functionality of this module has
+  been superseded by the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that
+  contains the compiler version number.
 
-The functionality of this module has been superseded by the
-:variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains
-the compiler version number.
+This module provides a command to determine the installed Visual Studio
+service pack version for Visual Studio 2012 and earlier.
 
-Determine the Visual Studio service pack of the 'cl' in use.
+Load this module in a CMake project with:
 
-Usage:
+.. code-block:: cmake
+
+  include(CMakeDetermineVSServicePack)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
+
+.. command:: DetermineVSServicePack
+
+  Determines the Visual Studio service pack version of the ``cl`` compiler
+  in use:
+
+  .. code-block:: cmake
+
+    DetermineVSServicePack(<variable>)
+
+  The result is stored in the specified internal cache variable ``<variable>``,
+  which is set to one of the following values, or to an empty string if the
+  service pack cannot be determined:
+
+  * ``vc80``, ``vc80sp1``
+  * ``vc90``, ``vc90sp1``
+  * ``vc100``, ``vc100sp1``
+  * ``vc110``, ``vc110sp1``, ``vc110sp2``, ``vc110sp3``, ``vc110sp4``
+
+Examples
+^^^^^^^^
+
+Determining the Visual Studio service pack version in a project:
 
 .. code-block:: cmake
 
@@ -26,16 +61,18 @@
       message(STATUS "Detected: ${my_service_pack}")
     endif()
   endif()
-
-Function DetermineVSServicePack sets the given variable to one of the
-following values or an empty string if unknown::
-
-  vc80, vc80sp1
-  vc90, vc90sp1
-  vc100, vc100sp1
-  vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
 #]=======================================================================]
 
+cmake_policy(GET CMP0196 _CMakeDetermineVSServicePack_CMP0196)
+if(_CMakeDetermineVSServicePack_CMP0196 STREQUAL "NEW")
+  message(FATAL_ERROR "The CMakeDetermineVSServicePack module has been removed by policy CMP0196.")
+endif()
+
+if(_CMakeDetermineVSServicePack_testing)
+  set(_CMakeDetermineVSServicePack_included TRUE)
+  return()
+endif()
+
 if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
   message(DEPRECATION
     "This module is deprecated and should not be used.  "
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index 4fad7f6..e9e04f6 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -7,37 +7,78 @@
 
 .. deprecated:: 3.4
 
-  Do not use.
+  This module should no longer be used.
 
-This module was once needed to expand imported targets to the underlying
-libraries they reference on disk for use with the :command:`try_compile`
-and :command:`try_run` commands.  These commands now support imported
-libraries in their ``LINK_LIBRARIES`` options (since CMake 2.8.11
-for :command:`try_compile` and since CMake 3.2 for :command:`try_run`).
+  It was once needed to replace :ref:`Imported Targets` with their underlying
+  libraries referenced on disk for use with the :command:`try_compile` and
+  :command:`try_run` commands.  These commands now support imported targets in
+  their ``LINK_LIBRARIES`` options (since CMake 2.8.11 for
+  :command:`try_compile` command and since CMake 3.2 for :command:`try_run`
+  command).
 
-This module does not support the policy :policy:`CMP0022` ``NEW``
-behavior or use of the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property
-because :manual:`generator expressions <cmake-generator-expressions(7)>`
-cannot be evaluated during configuration.
+Load this module in a CMake project with:
 
 .. code-block:: cmake
 
- CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
-                               [CONFIGURATION <config>])
+  include(CMakeExpandImportedTargets)
 
-CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
-all imported targets contained in this list with their actual file
-paths of the referenced libraries on disk, including the libraries
-from their link interfaces.  If a CONFIGURATION is given, it uses the
-respective configuration of the imported targets if it exists.  If no
-CONFIGURATION is given, it uses the first configuration from
-${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
+.. note::
+
+  This module does not support the policy :policy:`CMP0022` ``NEW`` behavior,
+  nor does it use the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property, because
+  :manual:`generator expressions <cmake-generator-expressions(7)>` cannot be
+  evaluated at the configuration phase.
+
+Commands
+^^^^^^^^^
+
+This module provides the following command:
+
+.. command:: cmake_expand_imported_targets
+
+  Expands all imported targets in a given list of libraries to their
+  corresponding file paths on disk and stores the resulting list in a local
+  variable:
+
+  .. code-block:: cmake
+
+    cmake_expand_imported_targets(
+      <result-var>
+      LIBRARIES <libs>...
+      [CONFIGURATION <config>]
+    )
+
+  The arguments are:
+
+  ``<result-var>``
+    Name of a CMake variable containing the resulting list of file paths.
+
+  ``LIBRARIES <libs>...``
+    A :ref:`semicolon-separated list <CMake Language Lists>` of system and
+    imported targets.  Imported targets in this list are replaced with their
+    corresponding library file paths, including libraries from their link
+    interfaces.
+
+  ``CONFIGURATION <config>``
+    If this option is given, it uses the respective build configuration
+    ``<config>`` of the imported targets if it exists.  If omitted, it defaults
+    to the first entry in the :variable:`CMAKE_CONFIGURATION_TYPES` variable, or
+    falls back to :variable:`CMAKE_BUILD_TYPE` if ``CMAKE_CONFIGURATION_TYPES``
+    is not set.
+
+Examples
+^^^^^^^^
+
+Using this module to get a list of library paths:
 
 .. code-block:: cmake
 
-    cmake_expand_imported_targets(expandedLibs
-      LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
-      CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+  include(CMakeExpandImportedTargets)
+  cmake_expand_imported_targets(
+    expandedLibs
+    LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
+    CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}"
+  )
 #]=======================================================================]
 
 function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 9a441ad..1948c63 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -145,7 +145,22 @@
   set(_CMAKE_IAR_SYMEXPORT_NAMES
     "isymexport" "isymexport.exe"
   )
-  list(APPEND _CMAKE_TOOL_VARS AR LINKER IAR_ELFDUMP IAR_ELFTOOL IAR_EXE2OBJ IAR_OBJMANIP IAR_SYMEXPORT)
+  # IAR C-STAT Command Line Interface
+  set(_CMAKE_IAR_CSTAT_NAMES
+    "icstat" "icstat.exe"
+  )
+  # IAR C-STAT Checks Manifest Handler
+  set(_CMAKE_IAR_CHECKS_NAMES
+    "ichecks" "ichecks.exe"
+  )
+  # IAR C-STAT Report Generator
+  set(_CMAKE_IAR_REPORT_NAMES
+    "ireport" "ireport.exe"
+  )
+  list(APPEND _CMAKE_TOOL_VARS
+    AR LINKER IAR_ELFDUMP IAR_ELFTOOL IAR_EXE2OBJ IAR_OBJMANIP IAR_SYMEXPORT
+    IAR_CSTAT IAR_CHECKS IAR_REPORT
+  )
   unset(__iar_selected_compiler)
   unset(__iar_arch_id)
 
@@ -172,7 +187,7 @@
   set(_CMAKE_TAPI_NAMES "tapi")
 
   # Prepend toolchain-specific names.
-  if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL Clang)
+  if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^x(Clang|IntelLLVM|LLVMFlang)$")
     if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC")
       list(PREPEND _CMAKE_LINKER_NAMES "lld-link")
     elseif(NOT APPLE)
diff --git a/Modules/CMakeFindCodeBlocks.cmake b/Modules/CMakeFindCodeBlocks.cmake
index fc769a1..b330fee 100644
--- a/Modules/CMakeFindCodeBlocks.cmake
+++ b/Modules/CMakeFindCodeBlocks.cmake
@@ -18,7 +18,7 @@
 set(_CMAKE_CODEBLOCKS_INITIAL_MAKE_ARGS "")
 
 include(ProcessorCount)
-processorcount(_CMAKE_CODEBLOCKS_PROCESSOR_COUNT)
+ProcessorCount(_CMAKE_CODEBLOCKS_PROCESSOR_COUNT)
 
 # Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
 # (we may also get here in the future e.g. for ninja)
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index b980fa4..398f9e3 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -68,7 +68,7 @@
 set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
 
 include(ProcessorCount)
-processorcount(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
+ProcessorCount(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
 
 # Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
 # (we may also get here in the future e.g. for ninja)
diff --git a/Modules/CMakeFindKate.cmake b/Modules/CMakeFindKate.cmake
index a4bf2ed..2adb532 100644
--- a/Modules/CMakeFindKate.cmake
+++ b/Modules/CMakeFindKate.cmake
@@ -9,7 +9,7 @@
 # Try to find out how many CPUs we have and set the -j argument for make accordingly
 
 include(ProcessorCount)
-processorcount(_CMAKE_KATE_PROCESSOR_COUNT)
+ProcessorCount(_CMAKE_KATE_PROCESSOR_COUNT)
 
 # Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
 # (we may also get here in the future e.g. for ninja)
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index eaf1574..6e2762c 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -5,28 +5,15 @@
 CMakeFindPackageMode
 --------------------
 
-This file is executed by cmake when invoked with
-:ref:`--find-package <Find-Package Tool Mode>`.
-It expects that the following variables are set using ``-D``:
+This module is executed by ``cmake`` when invoked with the
+:ref:`--find-package <Find-Package Tool Mode>` option to locate the requested
+package.
 
-``NAME``
-  name of the package
-``COMPILER_ID``
-  the CMake compiler ID for which the result is,
-  i.e. GNU/Intel/Clang/MSVC, etc.
-``LANGUAGE``
-  language for which the result will be used,
-  i.e. C/CXX/Fortran/ASM
-``MODE``
-  ``EXIST``
-    only check for existence of the given package
-  ``COMPILE``
-    print the flags needed for compiling an object file which uses
-    the given package
-  ``LINK``
-    print the flags needed for linking when using the given package
-``QUIET``
-  if TRUE, don't print anything
+.. note::
+
+  This is internal module and is not meant to be included directly in the
+  project.  For usage details, refer to the :ref:`--find-package
+  <Find-Package Tool Mode>` documentation.
 #]=======================================================================]
 
 if(NOT NAME)
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 1a4acc4..bfcf3f4 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -8,7 +8,7 @@
 set(CMAKE_Fortran_COMPILER_FRONTEND_VARIANT "@CMAKE_Fortran_COMPILER_FRONTEND_VARIANT@")
 set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
 @_SET_CMAKE_Fortran_XL_CPP@
-@_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_Fortran_COMPILER_ARCHITECTURE_ID "@CMAKE_Fortran_COMPILER_ARCHITECTURE_ID@")
 @_SET_CMAKE_Fortran_COMPILER_SYSROOT@
 @SET_MSVC_Fortran_ARCHITECTURE_ID@
 set(CMAKE_AR "@CMAKE_AR@")
diff --git a/Modules/CMakeFortranCompilerABI.F b/Modules/CMakeFortranCompilerABI.F
index f4a5489..81676cb 100644
--- a/Modules/CMakeFortranCompilerABI.F
+++ b/Modules/CMakeFortranCompilerABI.F
@@ -12,6 +12,8 @@
         PRINT *, 'INFO:sizeof_dptr[8]'
 #elif defined(__x86_64__)
         PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+        PRINT *, 'INFO:sizeof_dptr[8]'
 
 #elif defined(_ILP32)
         PRINT *, 'INFO:sizeof_dptr[4]'
@@ -19,6 +21,8 @@
         PRINT *, 'INFO:sizeof_dptr[4]'
 #elif defined(__i386__)
         PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(__sparc) || defined(__sparc__)
+        PRINT *, 'INFO:sizeof_dptr[4]'
 
 #elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
         PRINT *, 'INFO:sizeof_dptr[8]'
@@ -36,5 +40,108 @@
 #if defined(__ELF__)
         PRINT *, 'INFO:abi[ELF]'
 #endif
+
+#if 0
+! Sync with
+!   Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+!   Modules/CMakeCompilerABI.h
+!   Modules/CMakeFortranCompilerABI.F90
+!   Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+#endif
+#if defined(__APPLE__) && defined(__arm64__)
+#  if defined(__ARM64_ARCH_8_32__)
+        PRINT *, 'INFO:arch[arm64_32]'
+#  elif defined(__arm64e__)
+        PRINT *, 'INFO:arch[arm64e]'
+#  else
+        PRINT *, 'INFO:arch[arm64]'
+#  endif
+#elif defined(_MSC_VER) && defined(_M_ARM64EC)
+        PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(_MSC_VER) && defined(_M_ARM64)
+        PRINT *, 'INFO:arch[arm64]'
+#elif defined(__arm64ec__)
+        PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(__aarch64__)
+        PRINT *, 'INFO:arch[aarch64]'
+#elif __ARM_ARCH == 7 || _M_ARM == 7 || defined(__ARM_ARCH_7__)
+#  if defined(__APPLE__) && defined(__ARM_ARCH_7K__)
+        PRINT *, 'INFO:arch[armv7k]'
+#  elif defined(__APPLE__) && defined(__ARM_ARCH_7S__)
+        PRINT *, 'INFO:arch[armv7s]'
+#  else
+        PRINT *, 'INFO:arch[armv7]'
+#  endif
+#elif __ARM_ARCH == 6 || _M_ARM == 6 || defined(__ARM_ARCH_6__)
+        PRINT *, 'INFO:arch[armv6]'
+#elif __ARM_ARCH == 5 || _M_ARM == 5 || defined(__ARM_ARCH_5__)
+        PRINT *, 'INFO:arch[armv5]'
+#elif defined(__alpha) || defined(__alpha) || defined(_M_ALPHA)
+        PRINT *, 'INFO:arch[alpha]'
+#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) ||         \
+  defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+        PRINT *, 'INFO:arch[x86_64]'
+#elif defined(__i686) || defined(__i686__) || _M_IX86 == 600
+        PRINT *, 'INFO:arch[i686]'
+#elif defined(__i586) || defined(__i586__) || _M_IX86 == 500
+        PRINT *, 'INFO:arch[i586]'
+#elif defined(__i486) || defined(__i486__) || _M_IX86 == 400
+        PRINT *, 'INFO:arch[i486]'
+#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
+        PRINT *, 'INFO:arch[i386]'
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+        PRINT *, 'INFO:arch[ia64]'
+#elif defined(__loongarch64)
+        PRINT *, 'INFO:arch[loongarch64]'
+#elif defined(__loongarch__)
+        PRINT *, 'INFO:arch[loongarch32]'
+#elif defined(__m68k__)
+        PRINT *, 'INFO:arch[m68k]'
+#elif defined(__mips64) || defined(__mips64__)
+#  if defined(_MIPSEL)
+        PRINT *, 'INFO:arch[mips64el]'
+#  else
+        PRINT *, 'INFO:arch[mips64]'
+#  endif
+#elif defined(__mips) || defined(__mips__)
+#  if defined(_MIPSEL)
+        PRINT *, 'INFO:arch[mipsel]'
+#  else
+        PRINT *, 'INFO:arch[mips]'
+#  endif
+#elif defined(__riscv) && __riscv_xlen == 64
+        PRINT *, 'INFO:arch[riscv64]'
+#elif defined(__riscv) && __riscv_xlen == 32
+        PRINT *, 'INFO:arch[riscv32]'
+#elif defined(__s390x__)
+        PRINT *, 'INFO:arch[s390x]'
+#elif defined(__s390__)
+        PRINT *, 'INFO:arch[s390]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+        PRINT *, 'INFO:arch[sparcv9]'
+#elif defined(__sparc) || defined(__sparc__)
+        PRINT *, 'INFO:arch[sparc]'
+#elif defined(__hppa) || defined(__hppa__)
+#  if defined(__LP64__)
+        PRINT *, 'INFO:arch[parisc64]'
+#  else
+        PRINT *, 'INFO:arch[parisc]'
+#  endif
+#elif defined(__ppc64__) || defined(__powerpc64__) || defined(__PPC64__) ||   \
+  defined(_ARCH_PPC64)
+#  if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+        PRINT *, 'INFO:arch[ppc64le]'
+#  else
+        PRINT *, 'INFO:arch[ppc64]'
+#  endif
+#elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__) ||         \
+  defined(_ARCH_PPC)
+#  if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+        PRINT *, 'INFO:arch[ppcle]'
+#  else
+        PRINT *, 'INFO:arch[ppc]'
+#  endif
+#endif
+
         PRINT *, 'ABI Detection'
       END
diff --git a/Modules/CMakeFortranCompilerABI.F90 b/Modules/CMakeFortranCompilerABI.F90
index 4a17153..2a9259b 100644
--- a/Modules/CMakeFortranCompilerABI.F90
+++ b/Modules/CMakeFortranCompilerABI.F90
@@ -20,6 +20,8 @@
 PRINT *, 'INFO:sizeof_dptr[8]'
 #elif defined(__x86_64__)
 PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+PRINT *, 'INFO:sizeof_dptr[8]'
 
 #elif defined(_ILP32)
 PRINT *, 'INFO:sizeof_dptr[4]'
@@ -27,6 +29,8 @@
 PRINT *, 'INFO:sizeof_dptr[4]'
 #elif defined(__i386__)
 PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(__sparc) || defined(__sparc__)
+PRINT *, 'INFO:sizeof_dptr[4]'
 
 #elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
 PRINT *, 'INFO:sizeof_dptr[8]'
@@ -44,5 +48,108 @@
 #if defined(__ELF__)
 PRINT *, 'INFO:abi[ELF]'
 #endif
+
+#if 0
+! Sync with
+!   Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+!   Modules/CMakeCompilerABI.h
+!   Modules/CMakeFortranCompilerABI.F
+!   Modules/Internal/CMakeParseCompilerArchitectureId.cmake
+#endif
+#if defined(__APPLE__) && defined(__arm64__)
+#  if defined(__ARM64_ARCH_8_32__)
+PRINT *, 'INFO:arch[arm64_32]'
+#  elif defined(__arm64e__)
+PRINT *, 'INFO:arch[arm64e]'
+#  else
+PRINT *, 'INFO:arch[arm64]'
+#  endif
+#elif defined(_MSC_VER) && defined(_M_ARM64EC)
+PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(_MSC_VER) && defined(_M_ARM64)
+PRINT *, 'INFO:arch[arm64]'
+#elif defined(__arm64ec__)
+PRINT *, 'INFO:arch[arm64ec]'
+#elif defined(__aarch64__)
+PRINT *, 'INFO:arch[aarch64]'
+#elif __ARM_ARCH == 7 || _M_ARM == 7 || defined(__ARM_ARCH_7__)
+#  if defined(__APPLE__) && defined(__ARM_ARCH_7K__)
+PRINT *, 'INFO:arch[armv7k]'
+#  elif defined(__APPLE__) && defined(__ARM_ARCH_7S__)
+PRINT *, 'INFO:arch[armv7s]'
+#  else
+PRINT *, 'INFO:arch[armv7]'
+#  endif
+#elif __ARM_ARCH == 6 || _M_ARM == 6 || defined(__ARM_ARCH_6__)
+PRINT *, 'INFO:arch[armv6]'
+#elif __ARM_ARCH == 5 || _M_ARM == 5 || defined(__ARM_ARCH_5__)
+PRINT *, 'INFO:arch[armv5]'
+#elif defined(__alpha) || defined(__alpha) || defined(_M_ALPHA)
+PRINT *, 'INFO:arch[alpha]'
+#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) ||         \
+  defined(__amd64__) || defined(_M_X64) || defined(_M_AMD64)
+PRINT *, 'INFO:arch[x86_64]'
+#elif defined(__i686) || defined(__i686__) || _M_IX86 == 600
+PRINT *, 'INFO:arch[i686]'
+#elif defined(__i586) || defined(__i586__) || _M_IX86 == 500
+PRINT *, 'INFO:arch[i586]'
+#elif defined(__i486) || defined(__i486__) || _M_IX86 == 400
+PRINT *, 'INFO:arch[i486]'
+#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
+PRINT *, 'INFO:arch[i386]'
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+PRINT *, 'INFO:arch[ia64]'
+#elif defined(__loongarch64)
+PRINT *, 'INFO:arch[loongarch64]'
+#elif defined(__loongarch__)
+PRINT *, 'INFO:arch[loongarch32]'
+#elif defined(__m68k__)
+PRINT *, 'INFO:arch[m68k]'
+#elif defined(__mips64) || defined(__mips64__)
+#  if defined(_MIPSEL)
+PRINT *, 'INFO:arch[mips64el]'
+#  else
+PRINT *, 'INFO:arch[mips64]'
+#  endif
+#elif defined(__mips) || defined(__mips__)
+#  if defined(_MIPSEL)
+PRINT *, 'INFO:arch[mipsel]'
+#  else
+PRINT *, 'INFO:arch[mips]'
+#  endif
+#elif defined(__riscv) && __riscv_xlen == 64
+PRINT *, 'INFO:arch[riscv64]'
+#elif defined(__riscv) && __riscv_xlen == 32
+PRINT *, 'INFO:arch[riscv32]'
+#elif defined(__s390x__)
+PRINT *, 'INFO:arch[s390x]'
+#elif defined(__s390__)
+PRINT *, 'INFO:arch[s390]'
+#elif defined(__sparcv9) || defined(__sparcv9__) || defined(__sparc64__)
+PRINT *, 'INFO:arch[sparcv9]'
+#elif defined(__sparc) || defined(__sparc__)
+PRINT *, 'INFO:arch[sparc]'
+#elif defined(__hppa) || defined(__hppa__)
+#  if defined(__LP64__)
+PRINT *, 'INFO:arch[parisc64]'
+#  else
+PRINT *, 'INFO:arch[parisc]'
+#  endif
+#elif defined(__ppc64__) || defined(__powerpc64__) || defined(__PPC64__) ||   \
+  defined(_ARCH_PPC64)
+#  if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+PRINT *, 'INFO:arch[ppc64le]'
+#  else
+PRINT *, 'INFO:arch[ppc64]'
+#  endif
+#elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__) ||         \
+  defined(_ARCH_PPC)
+#  if defined(_LITTLE_ENDIAN) || defined(__LITTLE_ENDIAN__)
+PRINT *, 'INFO:arch[ppcle]'
+#  else
+PRINT *, 'INFO:arch[ppc]'
+#  endif
+#endif
+
 PRINT *, 'ABI Detection'
 end program
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 8d8ff20..2c25218 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -18,7 +18,7 @@
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME "${CMAKE_Fortran_COMPILER}" NAME_WE)
 # since the gnu compiler has several names force g++
-if(CMAKE_COMPILER_IS_GNUG77)
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_BASE_NAME g77)
 endif()
 if(CMAKE_Fortran_COMPILER_ID)
@@ -78,6 +78,11 @@
     CACHE STRING "Compiler launcher for Fortran.")
 endif()
 
+if(NOT CMAKE_Fortran_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_Fortran_LINKER_LAUNCHER})
+  set(CMAKE_Fortran_LINKER_LAUNCHER "$ENV{CMAKE_Fortran_LINKER_LAUNCHER}"
+          CACHE STRING "Linker launcher for Fortran.")
+endif()
+
 include(CMakeCommonLanguageInclude)
 _cmake_common_language_platform_flags(Fortran)
 
@@ -90,7 +95,7 @@
 # create a Fortran shared library
 if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
   set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
-      "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 endif()
 
 # create a Fortran shared module just copy the shared library rule
@@ -120,7 +125,7 @@
 # link a fortran program
 if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
   set(CMAKE_Fortran_LINK_EXECUTABLE
-    "<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_Fortran_COMPILER> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
diff --git a/Modules/CMakeHIPCompiler.cmake.in b/Modules/CMakeHIPCompiler.cmake.in
index 0077c19..2c762b8 100644
--- a/Modules/CMakeHIPCompiler.cmake.in
+++ b/Modules/CMakeHIPCompiler.cmake.in
@@ -21,6 +21,7 @@
 set(CMAKE_HIP_SIMULATE_ID "@CMAKE_HIP_SIMULATE_ID@")
 set(CMAKE_HIP_COMPILER_FRONTEND_VARIANT "@CMAKE_HIP_COMPILER_FRONTEND_VARIANT@")
 set(CMAKE_HIP_SIMULATE_VERSION "@CMAKE_HIP_SIMULATE_VERSION@")
+set(CMAKE_HIP_COMPILER_ARCHITECTURE_ID "@CMAKE_HIP_COMPILER_ARCHITECTURE_ID@")
 @SET_MSVC_HIP_ARCHITECTURE_ID@
 @_SET_CMAKE_HIP_COMPILER_SYSROOT@
 set(CMAKE_HIP_COMPILER_ROCM_ROOT "@CMAKE_HIP_COMPILER_ROCM_ROOT@")
diff --git a/Modules/CMakeHIPCompilerABI.hip b/Modules/CMakeHIPCompilerABI.hip
index 7d8b815..9910195 100644
--- a/Modules/CMakeHIPCompilerABI.hip
+++ b/Modules/CMakeHIPCompilerABI.hip
@@ -15,6 +15,9 @@
 #if defined(ABI_ID)
   require += info_abi[argc];
 #endif
+#if defined(ARCHITECTURE_ID)
+  require += info_arch[argc];
+#endif
   static_cast<void>(argv);
 
 #if defined(__NVCC__)
diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake
index f015cdf..9162129 100644
--- a/Modules/CMakeHIPInformation.cmake
+++ b/Modules/CMakeHIPInformation.cmake
@@ -55,6 +55,11 @@
     CACHE STRING "Compiler launcher for HIP.")
 endif()
 
+if(NOT CMAKE_HIP_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_HIP_LINKER_LAUNCHER})
+  set(CMAKE_HIP_LINKER_LAUNCHER "$ENV{CMAKE_HIP_LINKER_LAUNCHER}"
+          CACHE STRING "Linker launcher for HIP.")
+endif()
+
 include(CMakeCommonLanguageInclude)
 _cmake_common_language_platform_flags(HIP)
 
@@ -67,7 +72,7 @@
 # create a shared library
 if(NOT CMAKE_HIP_CREATE_SHARED_LIBRARY)
   set(CMAKE_HIP_CREATE_SHARED_LIBRARY
-      "<CMAKE_HIP_COMPILER> <CMAKE_SHARED_LIBRARY_HIP_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_HIP_COMPILER> <CMAKE_SHARED_LIBRARY_HIP_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 endif()
 
 # create a shared module copy the shared library rule by default
@@ -95,7 +100,7 @@
 # compile a cu file into an executable
 if(NOT CMAKE_HIP_LINK_EXECUTABLE)
   set(CMAKE_HIP_LINK_EXECUTABLE
-    "<CMAKE_HIP_COMPILER> <FLAGS> <CMAKE_HIP_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_HIP_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 set(CMAKE_HIP_USE_LINKER_INFORMATION TRUE)
diff --git a/Modules/CMakeOBJCCompiler.cmake.in b/Modules/CMakeOBJCCompiler.cmake.in
index fd453e3..2eb5a55 100644
--- a/Modules/CMakeOBJCCompiler.cmake.in
+++ b/Modules/CMakeOBJCCompiler.cmake.in
@@ -19,7 +19,7 @@
 set(CMAKE_OBJC_COMPILER_FRONTEND_VARIANT "@CMAKE_OBJC_COMPILER_FRONTEND_VARIANT@")
 set(CMAKE_OBJC_COMPILER_APPLE_SYSROOT "@CMAKE_OBJC_COMPILER_APPLE_SYSROOT@")
 set(CMAKE_OBJC_SIMULATE_VERSION "@CMAKE_OBJC_SIMULATE_VERSION@")
-@_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_OBJC_COMPILER_ARCHITECTURE_ID "@CMAKE_OBJC_COMPILER_ARCHITECTURE_ID@")
 @SET_CMAKE_XCODE_ARCHS@
 set(CMAKE_AR "@CMAKE_AR@")
 set(CMAKE_OBJC_COMPILER_AR "@CMAKE_OBJC_COMPILER_AR@")
diff --git a/Modules/CMakeOBJCCompilerABI.m b/Modules/CMakeOBJCCompilerABI.m
index 0726cd3..8a6e99f 100644
--- a/Modules/CMakeOBJCCompilerABI.m
+++ b/Modules/CMakeOBJCCompilerABI.m
@@ -17,6 +17,9 @@
 #if defined(ABI_ID)
   require += info_abi[argc];
 #endif
+#if defined(ARCHITECTURE_ID)
+  require += info_arch[argc];
+#endif
   (void)argv;
   return require;
 }
diff --git a/Modules/CMakeOBJCInformation.cmake b/Modules/CMakeOBJCInformation.cmake
index bac6673..4804516 100644
--- a/Modules/CMakeOBJCInformation.cmake
+++ b/Modules/CMakeOBJCInformation.cmake
@@ -27,7 +27,7 @@
 
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME "${CMAKE_OBJC_COMPILER}" NAME_WE)
-if(CMAKE_COMPILER_IS_GNUOBJC)
+if(CMAKE_OBJC_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_BASE_NAME gcc)
 endif()
 
@@ -132,9 +132,6 @@
 
 # Objective-C compiler information
 # <CMAKE_OBJC_COMPILER>
-# <CMAKE_SHARED_LIBRARY_CREATE_OBJC_FLAGS>
-# <CMAKE_SHARED_MODULE_CREATE_OBJC_FLAGS>
-# <CMAKE_OBJC_LINK_FLAGS>
 
 # Static library tools
 # <CMAKE_AR>
@@ -144,7 +141,7 @@
 # create an Objective-C shared library
 if(NOT CMAKE_OBJC_CREATE_SHARED_LIBRARY)
   set(CMAKE_OBJC_CREATE_SHARED_LIBRARY
-      "<CMAKE_OBJC_COMPILER> <CMAKE_SHARED_LIBRARY_OBJC_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_OBJC_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_OBJC_COMPILER> <CMAKE_SHARED_LIBRARY_OBJC_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 endif()
 
 # create an Objective-C shared module just copy the shared library rule
@@ -172,7 +169,7 @@
 
 if(NOT CMAKE_OBJC_LINK_EXECUTABLE)
   set(CMAKE_OBJC_LINK_EXECUTABLE
-    "<CMAKE_OBJC_COMPILER> <FLAGS> <CMAKE_OBJC_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_OBJC_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 if(NOT CMAKE_EXECUTABLE_RUNTIME_OBJC_FLAG)
diff --git a/Modules/CMakeOBJCXXCompiler.cmake.in b/Modules/CMakeOBJCXXCompiler.cmake.in
index 393eb87..94fcee3 100644
--- a/Modules/CMakeOBJCXXCompiler.cmake.in
+++ b/Modules/CMakeOBJCXXCompiler.cmake.in
@@ -20,7 +20,7 @@
 set(CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT "@CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT@")
 set(CMAKE_OBJCXX_COMPILER_APPLE_SYSROOT "@CMAKE_OBJCXX_COMPILER_APPLE_SYSROOT@")
 set(CMAKE_OBJCXX_SIMULATE_VERSION "@CMAKE_OBJCXX_SIMULATE_VERSION@")
-@_SET_CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID@
+set(CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID "@CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID@")
 @SET_CMAKE_XCODE_ARCHS@
 set(CMAKE_AR "@CMAKE_AR@")
 set(CMAKE_OBJCXX_COMPILER_AR "@CMAKE_OBJCXX_COMPILER_AR@")
diff --git a/Modules/CMakeOBJCXXCompilerABI.mm b/Modules/CMakeOBJCXXCompilerABI.mm
index 7b9fefc..84a96d4 100644
--- a/Modules/CMakeOBJCXXCompilerABI.mm
+++ b/Modules/CMakeOBJCXXCompilerABI.mm
@@ -17,6 +17,9 @@
 #if defined(ABI_ID)
   require += info_abi[argc];
 #endif
+#if defined(ARCHITECTURE_ID)
+  require += info_arch[argc];
+#endif
   (void)argv;
   return require;
 }
diff --git a/Modules/CMakeOBJCXXInformation.cmake b/Modules/CMakeOBJCXXInformation.cmake
index 8a7a42c..8304e1b 100644
--- a/Modules/CMakeOBJCXXInformation.cmake
+++ b/Modules/CMakeOBJCXXInformation.cmake
@@ -24,7 +24,7 @@
 set(CMAKE_BASE_NAME)
 get_filename_component(CMAKE_BASE_NAME "${CMAKE_OBJCXX_COMPILER}" NAME_WE)
 # since the gnu compiler has several names force g++
-if(CMAKE_COMPILER_IS_GNUOBJCXX)
+if(CMAKE_OBJCXX_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_BASE_NAME g++)
 endif()
 
@@ -131,9 +131,6 @@
 
 # Objective-C++ compiler information
 # <CMAKE_OBJCXX_COMPILER>
-# <CMAKE_SHARED_LIBRARY_CREATE_OBJCXX_FLAGS>
-# <CMAKE_OBJCXX_SHARED_MODULE_CREATE_FLAGS>
-# <CMAKE_OBJCXX_LINK_FLAGS>
 
 # Static library tools
 # <CMAKE_AR>
@@ -143,7 +140,7 @@
 # create a shared Objective-C++ library
 if(NOT CMAKE_OBJCXX_CREATE_SHARED_LIBRARY)
   set(CMAKE_OBJCXX_CREATE_SHARED_LIBRARY
-      "<CMAKE_OBJCXX_COMPILER> <CMAKE_SHARED_LIBRARY_OBJCXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_OBJCXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_OBJCXX_COMPILER> <CMAKE_SHARED_LIBRARY_OBJCXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 endif()
 
 # create an Objective-C++ shared module copy the shared library rule by default
@@ -172,7 +169,7 @@
 
 if(NOT CMAKE_OBJCXX_LINK_EXECUTABLE)
   set(CMAKE_OBJCXX_LINK_EXECUTABLE
-    "<CMAKE_OBJCXX_COMPILER> <FLAGS> <CMAKE_OBJCXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_OBJCXX_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endif()
 
 mark_as_advanced(
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index d9f6bad..77e999c 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -47,6 +47,7 @@
 
   set(is_lfortran_less_0_40 0)
   set(is_msvc 0)
+  set(is_cray 0)
   if(EXTRA_PARSE_LANGUAGE)
     if("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_ID}" STREQUAL "xMSVC" OR
         "x${CMAKE_${EXTRA_PARSE_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC")
@@ -54,6 +55,8 @@
     elseif("x${CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_ID}" STREQUAL "xLFortran"
         AND CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_VERSION VERSION_LESS "0.40")
       set(is_lfortran_less_0_40 1)
+    elseif("${CMAKE_${EXTRA_PARSE_LANGUAGE}_COMPILER_ID}" MATCHES "^(Cray|CrayClang)$")
+      set(is_cray 1)
     endif()
   endif()
   # Parse implicit linker arguments.
@@ -65,6 +68,9 @@
   if(is_msvc)
     string(APPEND linker "|link\\.exe|lld-link(\\.exe)?")
   endif()
+  if(is_cray)
+    string(APPEND linker "|cce_omp_offload_linker")
+  endif()
   if(CMAKE_LINKER)
     get_filename_component(default_linker ${CMAKE_LINKER} NAME)
     if (NOT default_linker MATCHES "(${linker})")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index 24c8567..1504d04 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -274,6 +274,20 @@
 #  define ARCHITECTURE_ID ""
 # endif
 
+#elif defined(__RENESAS__)
+# if defined(__CCRX__)
+#  define ARCHITECTURE_ID "RX"
+
+# elif defined(__CCRL__)
+#  define ARCHITECTURE_ID "RL78"
+
+# elif defined(__CCRH__)
+#  define ARCHITECTURE_ID "RH850"
+
+# else
+#  define ARCHITECTURE_ID ""
+# endif
+
 #else
 #  define ARCHITECTURE_ID
 #endif
diff --git a/Modules/CMakePrintHelpers.cmake b/Modules/CMakePrintHelpers.cmake
index 98555aa..4025dc3 100644
--- a/Modules/CMakePrintHelpers.cmake
+++ b/Modules/CMakePrintHelpers.cmake
@@ -5,35 +5,47 @@
 CMakePrintHelpers
 -----------------
 
-Convenience functions for printing properties and variables, useful
-e.g. for debugging.
+This module provides convenience commands, primarily intended for debugging,
+to print the values of properties and variables.
+
+Load this module in CMake with:
+
+.. code-block:: cmake
+
+  include(CMakePrintHelpers)
 
 Commands
 ^^^^^^^^
 
+This module provides the following commands:
+
 .. command:: cmake_print_properties
 
+  Prints the values of properties for the specified targets, source files,
+  directories, tests, or cache entries:
+
   .. code-block:: cmake
 
-    cmake_print_properties(<TARGETS       [<target1> ...] |
-                            SOURCES       [<source1> ...] |
-                            DIRECTORIES   [<dir1> ...]    |
-                            TESTS         [<test1> ...]   |
-                            CACHE_ENTRIES [<entry1> ...]  >
-                           PROPERTIES [<prop1> ...])
+    cmake_print_properties(
+      <TARGETS       [<targets>...] |
+       SOURCES       [<sources>...] |
+       DIRECTORIES   [<dirs>...]    |
+       TESTS         [<tests>...]   |
+       CACHE_ENTRIES [<entries>...] >
+      PROPERTIES [<properties>...]
+    )
 
-  This function prints the values of the properties of the given targets,
-  source files, directories, tests or cache entries.  Exactly one of the
-  scope keywords must be used.  The scope keyword and its arguments must
-  come before the ``PROPERTIES`` keyword in the arguments list.
+  Exactly one of the scope keywords must be specified.  The scope keyword
+  and its arguments must appear before the ``PROPERTIES`` keyword in the
+  argument list.
 
 .. command:: cmake_print_variables
 
+  Prints each variable name followed by its value:
+
   .. code-block:: cmake
 
-    cmake_print_variables([var1 [var2 ... [varN]]])
-
-  This function prints the name of each variable followed by its value.
+    cmake_print_variables([<vars>...])
 
 Examples
 ^^^^^^^^
diff --git a/Modules/CMakePrintSystemInformation.cmake b/Modules/CMakePrintSystemInformation.cmake
index 45ad38e..4a539bc 100644
--- a/Modules/CMakePrintSystemInformation.cmake
+++ b/Modules/CMakePrintSystemInformation.cmake
@@ -5,10 +5,26 @@
 CMakePrintSystemInformation
 ---------------------------
 
-Print system information.
+This module can be used for diagnostics to print system information.
 
-This module serves diagnostic purposes. Just include it in a
-project to see various internal CMake variables.
+Examples
+^^^^^^^^
+
+Including this module in a project:
+
+.. code-block:: cmake
+
+  include(CMakePrintSystemInformation)
+
+prints various internal CMake variables.  For example::
+
+  CMAKE_SYSTEM is Linux-6.11.0-17-generic Linux 6.11.0-17-generic x86_64
+  CMAKE_SYSTEM file is Platform/Linux
+  CMAKE_C_COMPILER is /usr/bin/cc
+  CMAKE_CXX_COMPILER is /usr/bin/c++
+  CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is -shared
+  CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is -shared
+  ...
 #]=======================================================================]
 
 message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR}")
@@ -22,8 +38,8 @@
 message("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
 message("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
 message("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
-message("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
-message("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
+message("CMAKE_C_COMPILER_ID = ${CMAKE_C_COMPILER_ID}")
+message("CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
 
 message("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
 message("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index a179670..cbf49de 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -7,76 +7,117 @@
 CMakePushCheckState
 -------------------
 
-This module provides macros for managing the state of variables that influence
-how various CMake check commands (e.g., ``check_symbol_exists()``, etc.) are
-performed.  These macros save, reset, and restore the following variables:
+This module provides commands for managing the state of variables that influence
+how various CMake check commands (e.g., :command:`check_symbol_exists`, etc.)
+are performed.
 
-* ``CMAKE_REQUIRED_FLAGS``
-* ``CMAKE_REQUIRED_DEFINITIONS``
-* ``CMAKE_REQUIRED_INCLUDES``
-* ``CMAKE_REQUIRED_LINK_OPTIONS``
-* ``CMAKE_REQUIRED_LIBRARIES``
-* ``CMAKE_REQUIRED_LINK_DIRECTORIES``
-* ``CMAKE_REQUIRED_QUIET``
-* ``CMAKE_EXTRA_INCLUDE_FILES``
+Load this module in CMake project with:
 
-Macros
-^^^^^^
+.. code-block:: cmake
+
+  include(CMakePushCheckState)
+
+This module provides the following commands, which are useful for scoped
+configuration, for example, in CMake modules or when performing checks in a
+controlled environment, ensuring that temporary modifications are isolated
+to the scope of the check and do not propagate into other parts of the build
+system:
+
+* :command:`cmake_push_check_state`
+* :command:`cmake_reset_check_state`
+* :command:`cmake_pop_check_state`
+
+Affected Variables
+^^^^^^^^^^^^^^^^^^
+
+The following CMake variables are saved, reset, and restored by this module's
+commands:
+
+.. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+.. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+.. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
+
+.. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+.. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+.. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+.. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+``CMAKE_EXTRA_INCLUDE_FILES``
+  .. versionadded:: 3.6
+    Previously used already by the :command:`check_type_size` command;  now
+    also supported by this module.
+
+  A :ref:`semicolon-separated list <CMake Language Lists>` of extra header
+  files to include when performing the check.
+
+.. note::
+
+  Other CMake variables, such as :variable:`CMAKE_<LANG>_FLAGS`, propagate
+  to all checks regardless of commands provided by this module, as those
+  fundamental variables are designed to influence the global state of the
+  build system.
+
+Commands
+^^^^^^^^
 
 .. command:: cmake_push_check_state
 
-  Saves (pushes) the current states of the above variables onto a stack.  This
-  is typically used to preserve the current configuration before making
-  temporary modifications for specific checks.
+  Pushes (saves) the current states of the above variables onto a stack:
 
   .. code-block:: cmake
 
     cmake_push_check_state([RESET])
 
+  Use this command to preserve the current configuration before making
+  temporary modifications for specific checks.
+
   ``RESET``
-    When this option is specified, the macro not only saves the current states
+    When this option is specified, the command not only saves the current states
     of the listed variables but also resets them to empty, allowing them to be
     reconfigured from a clean state.
 
 .. command:: cmake_reset_check_state
 
-  Resets (clears) the contents of the variables listed above to empty states.
+  Resets (clears) the contents of the variables listed above to empty states:
 
   .. code-block:: cmake
 
     cmake_reset_check_state()
 
-  This macro can be used, for example, when performing multiple sequential
-  checks that require entirely new configurations, ensuring no previous
-  configuration unintentionally carries over.
+  Use this command when performing multiple sequential checks that require
+  entirely new configurations, ensuring no previous configuration
+  unintentionally carries over.
 
 .. command:: cmake_pop_check_state
 
   Restores the states of the variables listed above to their values at the time
-  of the most recent ``cmake_push_check_state()`` call.
+  of the most recent ``cmake_push_check_state()`` call:
 
   .. code-block:: cmake
 
     cmake_pop_check_state()
 
-  This macro is used to revert temporary changes made during a check.  To
+  Use this command to revert temporary changes made during a check.  To
   prevent unexpected behavior, pair each ``cmake_push_check_state()`` with a
   corresponding ``cmake_pop_check_state()``.
 
-These macros are useful for scoped configuration, for example, in
-:ref:`Find modules <Find Modules>` or when performing checks in a controlled
-environment, ensuring that temporary modifications are isolated to the scope of
-the check and do not propagate into other parts of the build system.
-
-.. note::
-
-  Other CMake variables, such as ``CMAKE_<LANG>_FLAGS``, propagate to all checks
-  regardless of these macros, as those fundamental variables are designed to
-  influence the global state of the build system.
-
 Examples
 ^^^^^^^^
 
+Example: Isolated Check With Compile Definitions
+""""""""""""""""""""""""""""""""""""""""""""""""
+
+In the following example, a check for the C symbol ``memfd_create()`` is
+performed with an additional ``_GNU_SOURCE`` compile definition,  without
+affecting global compile flags.  The ``RESET`` option is used to ensure
+that any prior values of the check-related variables are explicitly cleared
+before the check.
+
 .. code-block:: cmake
 
   include(CMakePushCheckState)
@@ -92,9 +133,12 @@
   # Restore the original state
   cmake_pop_check_state()
 
-Variable states can be pushed onto the stack multiple times, allowing for nested
-or sequential configurations.  Each ``cmake_pop_check_state()`` restores the
-most recent pushed states.
+Example: Nested Configuration Scopes
+""""""""""""""""""""""""""""""""""""
+
+In the following example, variable states are pushed onto the stack multiple
+times, allowing for sequential or nested checks.  Each
+``cmake_pop_check_state()`` restores the most recent pushed states.
 
 .. code-block:: cmake
 
diff --git a/Modules/CMakeSwiftCompiler.cmake.in b/Modules/CMakeSwiftCompiler.cmake.in
index 9210880..5e2483a 100644
--- a/Modules/CMakeSwiftCompiler.cmake.in
+++ b/Modules/CMakeSwiftCompiler.cmake.in
@@ -16,3 +16,5 @@
 set(CMAKE_Swift_COMPILER_USE_OLD_DRIVER "@CMAKE_Swift_COMPILER_USE_OLD_DRIVER@")
 
 set(CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_Swift_IMPLICIT_INCLUDE_DIRECTORIES@")
+
+set(CMAKE_Swift_MODULE_TRIPLE "@CMAKE_Swift_MODULE_TRIPLE@")
diff --git a/Modules/CMakeSwiftInformation.cmake b/Modules/CMakeSwiftInformation.cmake
index 63ffcc3..bafc6ce 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -125,11 +125,11 @@
   endif()
 
   if(NOT CMAKE_Swift_CREATE_SHARED_LIBRARY)
-    set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> ${CMAKE_Swift_PARALLEL_FLAGS} -emit-library <CMAKE_SHARED_LIBRARY_Swift_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+    set(CMAKE_Swift_CREATE_SHARED_LIBRARY "<CMAKE_Swift_COMPILER> ${CMAKE_Swift_PARALLEL_FLAGS} -emit-library <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> ${CMAKE_Swift_IMPLIB_LINKER_FLAGS} <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
   endif()
 
   if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
-    set(CMAKE_Swift_CREATE_SHARED_MODULE "${CMAKE_Swift_CREATE_SHARED_LIBRARY} <CMAKE_SHARED_MODULE_CREATE_Swift_FLAGS>")
+    set(CMAKE_Swift_CREATE_SHARED_MODULE "${CMAKE_Swift_CREATE_SHARED_LIBRARY}")
   endif()
 
   if(NOT CMAKE_Swift_LINK_EXECUTABLE)
@@ -153,7 +153,7 @@
   endif()
 
   if(NOT CMAKE_Swift_CREATE_SHARED_MODULE)
-    set(CMAKE_Swift_CREATE_SHARED_MODULE "${CMAKE_Swift_CREATE_SHARED_LIBRARY} <CMAKE_SHARED_MODULE_CREATE_Swift_FLAGS>")
+    set(CMAKE_Swift_CREATE_SHARED_MODULE "${CMAKE_Swift_CREATE_SHARED_LIBRARY}")
   endif()
 
   if(NOT CMAKE_Swift_LINK_EXECUTABLE)
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 026b8c0..803332b 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -572,6 +572,11 @@
   set("${var}" "${escaped}" PARENT_SCOPE)
 endfunction()
 
+# Resolve CPACK_PROJECT_CONFIG_FILE relative to the source directory
+if(DEFINED CPACK_PROJECT_CONFIG_FILE)
+  cmake_path(ABSOLUTE_PATH CPACK_PROJECT_CONFIG_FILE)
+endif()
+
 # Set the package name
 _cpack_set_default(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
 
diff --git a/Modules/CSharpUtilities.cmake b/Modules/CSharpUtilities.cmake
index cf6300f..477e3d1 100644
--- a/Modules/CSharpUtilities.cmake
+++ b/Modules/CSharpUtilities.cmake
@@ -7,198 +7,216 @@
 
 .. versionadded:: 3.8
 
-Functions to make configuration of CSharp/.NET targets easier.
+This utility module is intended to simplify the configuration of CSharp/.NET
+targets and provides a collection of commands for managing CSharp targets
+with :ref:`Visual Studio Generators`, version 2010 and newer.
 
-A collection of CMake utility functions useful for dealing with CSharp
-targets for Visual Studio generators from version 2010 and later.
+Load this module in a CMake project with:
 
-The following functions are provided by this module:
+.. code-block:: cmake
 
-**Main functions**
+  include(CSharpUtilities)
+
+Commands
+^^^^^^^^
+
+This module provides the following commands:
+
+.. rubric:: Main Commands
 
 - :command:`csharp_set_windows_forms_properties`
 - :command:`csharp_set_designer_cs_properties`
 - :command:`csharp_set_xaml_cs_properties`
 
-**Helper functions**
+.. rubric:: Helper Commands
 
 - :command:`csharp_get_filename_keys`
 - :command:`csharp_get_filename_key_base`
 - :command:`csharp_get_dependentupon_name`
 
-Main functions provided by the module
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Main Commands
+"""""""""""""
 
 .. command:: csharp_set_windows_forms_properties
 
-  Sets source file properties for use of Windows Forms. Use this, if your CSharp
-  target uses Windows Forms:
+  Sets source file properties for use of Windows Forms:
 
   .. code-block:: cmake
 
-    csharp_set_windows_forms_properties([<file1> [<file2> [...]]])
+    csharp_set_windows_forms_properties([<files>...])
 
-  ``<fileN>``
-    List of all source files which are relevant for setting the
-    :prop_sf:`VS_CSHARP_<tagname>` properties (including ``.cs``, ``.resx`` and
-    ``.Designer.cs`` extensions).
+  ``<files>...``
+    A list of zero or more source files which are relevant for setting the
+    :prop_sf:`VS_CSHARP_<tagname>` source file properties. This typically
+    includes files with ``.cs``, ``.resx``, and ``.Designer.cs`` extensions.
 
-  In the list of all given files for all files ending with ``.Designer.cs`` and
-  ``.resx`` is searched.  For every *designer* or *resource* file a file with the
-  same base name but only ``.cs`` as extension is searched.  If this is found, the
-  :prop_sf:`VS_CSHARP_<tagname>` properties are set as follows:
+  Use this command when a CSharp target in the project uses Windows Forms.
 
-  for the **.cs** file:
-   - VS_CSHARP_SubType "Form"
+  This command searches in the provided list of files for pairs of related
+  files ending with ``.Designer.cs`` (*designer* files) or ``.resx``
+  (*resource* files).  For each such file, a corresponding base ``.cs``
+  file is searched (with the same base name).  When found, the
+  :prop_sf:`VS_CSHARP_<tagname>` source file properties are set as follows:
 
-  for the **.Designer.cs** file (if it exists):
-   - VS_CSHARP_DependentUpon <cs-filename>
-   - VS_CSHARP_DesignTime "" (delete tag if previously defined)
-   - VS_CSHARP_AutoGen ""(delete tag if previously defined)
+  For the **.cs** file:
+   - ``VS_CSHARP_SubType "Form"``
 
-  for the **.resx** file (if it exists):
-   - VS_RESOURCE_GENERATOR "" (delete tag if previously defined)
-   - VS_CSHARP_DependentUpon <cs-filename>
-   - VS_CSHARP_SubType "Designer"
+  For the **.Designer.cs** file (if it exists):
+   - ``VS_CSHARP_DependentUpon <cs-filename>``
+   - ``VS_CSHARP_DesignTime ""`` (tag is removed if previously defined)
+   - ``VS_CSHARP_AutoGen ""`` (tag is removed if previously defined)
+
+  For the **.resx** file (if it exists):
+   - ``VS_RESOURCE_GENERATOR ""`` (tag is removed if previously defined)
+   - ``VS_CSHARP_DependentUpon <cs-filename>``
+   - ``VS_CSHARP_SubType "Designer"``
 
 .. command:: csharp_set_designer_cs_properties
 
-  Sets source file properties of ``.Designer.cs`` files depending on
-  sibling filenames. Use this, if your CSharp target does **not**
-  use Windows Forms (for Windows Forms use
-  :command:`csharp_set_windows_forms_properties` instead):
+  Sets source file properties for ``.Designer.cs`` files depending on
+  sibling filenames:
 
   .. code-block:: cmake
 
-    csharp_set_designer_cs_properties([<file1> [<file2> [...]]])
+    csharp_set_designer_cs_properties([<files>...])
 
-  ``<fileN>``
-    List of all source files which are relevant for setting the
-    :prop_sf:`VS_CSHARP_<tagname>` properties (including ``.cs``,
-    ``.resx``, ``.settings`` and ``.Designer.cs`` extensions).
+  ``<files>...``
+    A list of zero or more source files which are relevant for setting the
+    :prop_sf:`VS_CSHARP_<tagname>` source file properties.  This typically
+    includes files with ``.resx``, ``.settings``, and ``.Designer.cs``
+    extensions.
 
-  In the list of all given files for all files ending with
-  ``.Designer.cs`` is searched. For every *designer* file all files
-  with the same base name but different extensions are searched. If
-  a match is found, the source file properties of the *designer* file
-  are set depending on the extension of the matched file:
+  Use this command, if the CSharp target does **not** use Windows Forms
+  (for Windows Forms use :command:`csharp_set_windows_forms_properties`
+  instead).
 
-  if match is **.resx** file:
+  This command searches through the provided list for files ending in
+  ``.Designer.cs`` (*designer* files).  For each such file, it looks for
+  sibling files with the same base name but different extensions.  If a
+  matching file is found, the appropriate source file properties are set on
+  the corresponding ``.Designer.cs`` file based on the matched extension:
 
-  - VS_CSHARP_AutoGen "True"
-  - VS_CSHARP_DesignTime "True"
-  - VS_CSHARP_DependentUpon <resx-filename>
+  If match is **.resx** file:
 
-  if match is **.cs** file:
+  - ``VS_CSHARP_AutoGen "True"``
+  - ``VS_CSHARP_DesignTime "True"``
+  - ``VS_CSHARP_DependentUpon <resx-filename>``
 
-  - VS_CSHARP_DependentUpon <cs-filename>
+  If match is **.cs** file:
 
-  if match is **.settings** file:
+  - ``VS_CSHARP_DependentUpon <cs-filename>``
 
-  - VS_CSHARP_AutoGen "True"
-  - VS_CSHARP_DesignTimeSharedInput "True"
-  - VS_CSHARP_DependentUpon <settings-filename>
+  If match is **.settings** file:
+
+  - ``VS_CSHARP_AutoGen "True"``
+  - ``VS_CSHARP_DesignTimeSharedInput "True"``
+  - ``VS_CSHARP_DependentUpon <settings-filename>``
 
 .. note::
 
-    Because the source file properties of the ``.Designer.cs`` file are set according
-    to the found matches and every match sets the **VS_CSHARP_DependentUpon**
-    property, there should only be one match for each ``Designer.cs`` file.
+    Because the source file properties of the ``.Designer.cs`` file are set
+    according to the found matches and every match sets the
+    :prop_sf:`VS_CSHARP_DependentUpon <VS_CSHARP_<tagname>>`
+    source file property, there should only be one match for
+    each ``Designer.cs`` file.
 
 .. command:: csharp_set_xaml_cs_properties
 
-  Sets source file properties for use of Windows Presentation Foundation (WPF) and
-  XAML. Use this, if your CSharp target uses WPF/XAML:
+  Sets source file properties for use of Windows Presentation Foundation (WPF)
+  and XAML:
 
   .. code-block:: cmake
 
-    csharp_set_xaml_cs_properties([<file1> [<file2> [...]]])
+    csharp_set_xaml_cs_properties([<files>...])
 
-  ``<fileN>``
-    List of all source files which are relevant for setting the
-    :prop_sf:`VS_CSHARP_<tagname>` properties (including ``.cs``,
-    ``.xaml``, and ``.xaml.cs`` extensions).
+  Use this command, if the CSharp target uses WPF/XAML.
 
-  In the list of all given files for all files ending with
-  ``.xaml.cs`` is searched. For every *xaml-cs* file, a file
-  with the same base name but extension ``.xaml`` is searched.
-  If a match is found, the source file properties of the ``.xaml.cs``
-  file are set:
+  ``<files>...``
+    A list of zero or more source files which are relevant for setting the
+    :prop_sf:`VS_CSHARP_<tagname>` source file properties.  This typically
+    includes files with ``.cs``, ``.xaml``, and ``.xaml.cs`` extensions.
 
-  - VS_CSHARP_DependentUpon <xaml-filename>
+  This command searches the provided file list for files ending with
+  ``.xaml.cs``.  For each such XAML code-behind file, a corresponding
+  ``.xaml`` file with the same base name is searched.  If found, the
+  following source file property is set on the ``.xaml.cs`` file:
 
-Helper functions which are used by the above ones
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  - ``VS_CSHARP_DependentUpon <xaml-filename>``
+
+Helper Commands
+"""""""""""""""
+
+These commands are used by the above main commands and typically aren't
+used directly:
 
 .. command:: csharp_get_filename_keys
 
-  Helper function which computes a list of key values to identify
-  source files independently of relative/absolute paths given in cmake
-  and eliminates case sensitivity:
+  Computes a normalized list of key values to identify source files
+  independently of relative or absolute paths given in CMake and eliminates
+  case sensitivity:
 
   .. code-block:: cmake
 
-    csharp_get_filename_keys(OUT [<file1> [<file2> [...]]])
+    csharp_get_filename_keys(<variable> [<files>...])
 
-  ``OUT``
-    Name of the variable in which the list of keys is stored
+  ``<variable>``
+    Name of the variable in which the list of computed keys is stored.
 
-  ``<fileN>``
-    filename(s) as given to CSharp target using :command:`add_library`
-    or :command:`add_executable`
+  ``<files>...``
+    Zero or more source file paths as given to CSharp target using commands
+    like :command:`add_library`, or :command:`add_executable`.
 
-  In some way the function applies a canonicalization to the source names.
-  This is necessary to find file matches if the files have been added to
-  the target with different directory prefixes:
+  This command canonicalizes file paths to ensure consistent identification
+  of source files.  This is useful when source files are added to a target
+  using different path forms.  Without normalization, CMake may treat paths
+  like ``myfile.Designer.cs`` and
+  ``${CMAKE_CURRENT_SOURCE_DIR}/myfile.Designer.cs`` as different files,
+  which can cause issues when setting source file properties.
+
+  For example, the following code will fail to set properties because the
+  file paths do not match exactly:
 
   .. code-block:: cmake
 
-    add_library(lib
-      myfile.cs
-      ${CMAKE_CURRENT_SOURCE_DIR}/myfile.Designer.cs)
+    add_library(lib myfile.cs ${CMAKE_CURRENT_SOURCE_DIR}/myfile.Designer.cs)
 
-    set_source_files_properties(myfile.Designer.cs PROPERTIES
-      VS_CSHARP_DependentUpon myfile.cs)
-
-    # this will fail, because in cmake
-    #  - ${CMAKE_CURRENT_SOURCE_DIR}/myfile.Designer.cs
-    #  - myfile.Designer.cs
-    # are not the same source file. The source file property is not set.
+    set_source_files_properties(
+      myfile.Designer.cs
+      PROPERTIES VS_CSHARP_DependentUpon myfile.cs
+    )
 
 .. command:: csharp_get_filename_key_base
 
-  Returns the full filepath and name **without** extension of a key.
-  KEY is expected to be a key from csharp_get_filename_keys. In BASE
-  the value of KEY without the file extension is returned:
+  Returns the full filepath and name **without** extension of a key:
 
   .. code-block:: cmake
 
-    csharp_get_filename_key_base(BASE KEY)
+    csharp_get_filename_key_base(<base> <key>)
 
-  ``BASE``
-    Name of the variable with the computed "base" of ``KEY``.
+  ``<base>``
+    Name of the variable with the computed base value of the ``<key>``
+    without the file extension.
 
-  ``KEY``
-    The key of which the base will be computed. Expected to be a
-    upper case full filename.
+  ``<key>``
+    The key of which the base will be computed.  Expected to be a
+    uppercase full filename from :command:`csharp_get_filename_keys`.
 
 .. command:: csharp_get_dependentupon_name
 
   Computes a string which can be used as value for the source file property
-  :prop_sf:`VS_CSHARP_<tagname>` with *target* being ``DependentUpon``:
+  :prop_sf:`VS_CSHARP_<tagname>` with ``<tagname>`` being ``DependentUpon``:
 
   .. code-block:: cmake
 
-    csharp_get_dependentupon_name(NAME FILE)
+    csharp_get_dependentupon_name(<variable> <file>)
 
-  ``NAME``
-    Name of the variable with the result value
+  ``<variable>``
+    Name of the variable with the result value.  Value contains the name
+    of the ``<file>`` without directory.
 
-  ``FILE``
-    Filename to convert to ``<DependentUpon>`` value
-
-  Actually this is only the filename without any path given at the moment.
-
+  ``<file>``
+    Filename to convert for using in the value of the
+    ``VS_CSHARP_DependentUpon`` source file property.
 #]=======================================================================]
 
 function(csharp_get_filename_keys OUT)
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index 0b4f374..4c1211f 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -7,61 +7,82 @@
 
 .. versionadded:: 3.2
 
-This module provides the ``ctest_coverage_collect_gcov`` function.
+This module is intended for use in CTest dashboard scripts and provides a
+command to generate a tarball containing code coverage reports.
 
-This function runs gcov on all .gcda files found in the binary tree
-and packages the resulting .gcov files into a tar file.
-This tarball also contains the following:
+Load this module in a CTest script with:
 
-* *data.json* defines the source and build directories for use by CDash.
-* *Labels.json* indicates any :prop_sf:`LABELS` that have been set on the
-  source files.
-* The *uncovered* directory holds any uncovered files found by
-  :variable:`CTEST_EXTRA_COVERAGE_GLOB`.
+.. code-block:: cmake
 
-After generating this tar file, it can be sent to CDash for display with the
-:command:`ctest_submit(CDASH_UPLOAD)` command.
+  include(CTestCoverageCollectGCOV)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: ctest_coverage_collect_gcov
 
+  Runs ``gcov`` and packages a tar file for CDash:
+
   .. code-block:: cmake
 
-    ctest_coverage_collect_gcov(TARBALL <tarfile>
-      [SOURCE <source_dir>][BUILD <build_dir>]
-      [GCOV_COMMAND <gcov_command>]
+    ctest_coverage_collect_gcov(
+      TARBALL <tar-file>
+      [TARBALL_COMPRESSION <compression>]
+      [SOURCE <source-dir>]
+      [BUILD <build-dir>]
+      [GCOV_COMMAND <gcov-command>]
       [GCOV_OPTIONS <options>...]
-      )
+      [GLOB]
+      [DELETE]
+      [QUIET]
+    )
 
-  Run gcov and package a tar file for CDash.  The options are:
+  This command runs ``gcov`` on all ``.gcda`` files found in the binary tree
+  and packages the resulting ``.gcov`` files into a tar file, along with the
+  following:
 
-  ``TARBALL <tarfile>``
+  * *data.json* file that defines the source and build directories for use
+    by CDash.
+  * *Labels.json* files that indicate any :prop_sf:`LABELS` that have been
+    set on the source files.
+  * The *uncovered* directory containing any uncovered files found by
+    :variable:`CTEST_EXTRA_COVERAGE_GLOB`.
+
+  The resulting tar file can be submitted to CDash for display using the
+  :command:`ctest_submit(CDASH_UPLOAD)` command.
+
+  The arguments are:
+
+  ``TARBALL <tar-file>``
     Specify the location of the ``.tar`` file to be created for later
     upload to CDash.  Relative paths will be interpreted with respect
     to the top-level build directory.
 
-  ``TARBALL_COMPRESSION <option>``
+  ``TARBALL_COMPRESSION <compression>``
     .. versionadded:: 3.18
 
     Specify a compression algorithm for the
     ``TARBALL`` data file.  Using this option reduces the size of the data file
-    before it is submitted to CDash.  ``<option>`` must be one of ``GZIP``,
+    before it is submitted to CDash.  ``<compression>`` must be one of ``GZIP``,
     ``BZIP2``, ``XZ``, ``ZSTD``, ``FROM_EXT``, or an expression that CMake
-    evaluates as ``FALSE``. The default value is ``BZIP2``.
+    evaluates as ``FALSE``.  The default value is ``BZIP2``.
 
     If ``FROM_EXT`` is specified, the resulting file will be compressed based on
-    the file extension of the ``<tarfile>`` (i.e. ``.tar.gz`` will use ``GZIP``
+    the file extension of the ``<tar-file>`` (i.e. ``.tar.gz`` will use ``GZIP``
     compression). File extensions that will produce compressed output include
     ``.tar.gz``, ``.tgz``, ``.tar.bzip2``, ``.tbz``, ``.tar.xz``, and ``.txz``.
 
-  ``SOURCE <source_dir>``
+  ``SOURCE <source-dir>``
     Specify the top-level source directory for the build.
     Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`.
 
-  ``BUILD <build_dir>``
+  ``BUILD <build-dir>``
     Specify the top-level build directory for the build.
     Default is the value of :variable:`CTEST_BINARY_DIRECTORY`.
 
-  ``GCOV_COMMAND <gcov_command>``
+  ``GCOV_COMMAND <gcov-command>``
     Specify the full path to the ``gcov`` command on the machine.
     Default is the value of :variable:`CTEST_COVERAGE_COMMAND`.
 
@@ -73,21 +94,37 @@
   ``GLOB``
     .. versionadded:: 3.6
 
-    Recursively search for .gcda files in build_dir rather than
-    determining search locations by reading TargetDirectories.txt.
+    Recursively search for ``.gcda`` files in ``<build-dir>`` rather than
+    determining search locations by reading ``CMakeFiles/TargetDirectories.txt``
+    (file generated by CMake at the generation phase).
 
   ``DELETE``
     .. versionadded:: 3.6
 
-    Delete coverage files after they've been packaged into the .tar.
+    Delete coverage files after they've been packaged into the ``.tar``.
 
   ``QUIET``
     Suppress non-error messages that otherwise would have been
-    printed out by this function.
+    printed out by this command.
 
   .. versionadded:: 3.3
     Added support for the :variable:`CTEST_CUSTOM_COVERAGE_EXCLUDE` variable.
 
+Examples
+^^^^^^^^
+
+Generating code coverage data packaged as a ``.tar.gz`` file in a
+:option:`ctest -S` script:
+
+.. code-block:: cmake
+  :caption: ``script.cmake``
+
+  include(CTestCoverageCollectGCOV)
+
+  ctest_coverage_collect_gcov(
+    TARBALL "${CTEST_BINARY_DIRECTORY}/gcov.tar.gz"
+    TARBALL_COMPRESSION "GZIP"
+  )
 #]=======================================================================]
 
 function(ctest_coverage_collect_gcov)
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index 0a08b71..5a7232f 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -44,6 +44,9 @@
       ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
       ${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
   endif()
+  configure_file(
+    ${CMAKE_ROOT}/Templates/CTestScript.cmake.in
+    ${PROJECT_BINARY_DIR}/CMakeFiles/CTestScript.cmake @ONLY)
 endblock()
 
 #
@@ -73,7 +76,9 @@
   # For all generators add basic testing targets.
   foreach(mode Experimental Nightly Continuous NightlyMemoryCheck)
     add_custom_target(${mode}
-      ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
+      COMMAND
+        ${CMAKE_CTEST_COMMAND} ${__conf_types}
+        -DMODEL=${mode} -S CMakeFiles/CTestScript.cmake -V
       USES_TERMINAL
       )
     set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
@@ -89,7 +94,10 @@
           # missing purify
           )
         add_custom_target(${mode}${testtype}
-          ${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
+          COMMAND
+            ${CMAKE_CTEST_COMMAND} ${__conf_types}
+            -DMODEL=${mode} -DACTIONS=${testtype}
+            -S CMakeFiles/CTestScript.cmake -V
           USES_TERMINAL
           )
         set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
index 5578c3d..dc015f8 100644
--- a/Modules/CTestUseLaunchers.cmake
+++ b/Modules/CTestUseLaunchers.cmake
@@ -5,34 +5,48 @@
 CTestUseLaunchers
 -----------------
 
-Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+This module sets the ``RULE_LAUNCH_*`` global properties when the
+:variable:`CTEST_USE_LAUNCHERS` variable is set to a true-like value (e.g.,
+``ON``):
 
-CTestUseLaunchers is automatically included when you include(CTest).
-However, it is split out into its own module file so projects can use
-the CTEST_USE_LAUNCHERS functionality independently.
+* :prop_gbl:`RULE_LAUNCH_COMPILE`
+* :prop_gbl:`RULE_LAUNCH_CUSTOM`
+* :prop_gbl:`RULE_LAUNCH_LINK`
 
-To use launchers, set CTEST_USE_LAUNCHERS to ON in a :option:`ctest -S`
-dashboard script, and then also set it in the cache of the configured
-project.  Both cmake and ctest need to know the value of it for the
-launchers to work properly.  CMake needs to know in order to generate
-proper build rules, and ctest, in order to produce the proper error
-and warning analysis.
+The ``CTestUseLaunchers`` module is automatically included by the
+:module:`CTest` module when ``include(CTest)`` is called.  However, it is
+provided as a separate module so that projects can use the
+``CTEST_USE_LAUNCHERS`` functionality independently.
 
-For convenience, you may set the ENV variable
-CTEST_USE_LAUNCHERS_DEFAULT in your ctest -S script, too.  Then, as
-long as your CMakeLists uses include(CTest) or
-include(CTestUseLaunchers), it will use the value of the ENV variable
-to initialize a CTEST_USE_LAUNCHERS cache variable.  This cache
-variable initialization only occurs if CTEST_USE_LAUNCHERS is not
-already defined.
+To use launchers, set the ``CTEST_USE_LAUNCHERS`` variable to a true-like value
+in a :option:`ctest -S` dashboard script, and then also set the
+``CTEST_USE_LAUNCHERS`` cache variable in the configured project.  Both
+``cmake`` and ``ctest`` must be aware of its value for the launchers to function
+correctly:
+
+* ``cmake`` needs it to generate the appropriate build rules
+* ``ctest`` requires it for accurate error and warning analysis
+
+For convenience, the environment variable :envvar:`CTEST_USE_LAUNCHERS_DEFAULT`
+may be set in the :option:`ctest -S` script.  Then, as long as the
+``CMakeLists.txt`` includes the ``CTest`` or ``CTestUseLaunchers`` module, it
+will use the value of the environment variable to initialize a
+``CTEST_USE_LAUNCHERS`` cache variable.  This cache variable initialization only
+occurs if ``CTEST_USE_LAUNCHERS`` is not already defined.
 
 .. versionadded:: 3.8
-  If CTEST_USE_LAUNCHERS is on in a :option:`ctest -S` script
-  the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
-  to the cmake command used to configure the project.
+  If ``CTEST_USE_LAUNCHERS`` is set to a true-like value in a
+  :option:`ctest -S` script, the :command:`ctest_configure` command will add
+  ``-DCTEST_USE_LAUNCHERS:BOOL=TRUE`` to the ``cmake`` command when configuring
+  the project.
 
-.. TODO Use RST markup
+Examples
+^^^^^^^^
 
+.. code-block:: cmake
+
+  set(CTEST_USE_LAUNCHERS ON)
+  include(CTestUseLaunchers)
 #]=======================================================================]
 
 if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 4d09a7f..8cf387d 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -5,48 +5,97 @@
 CheckCCompilerFlag
 ------------------
 
-Check once whether the C compiler supports a given flag.
+This module provides a command to check whether the C compiler supports a
+given flag.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCCompilerFlag)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_c_compiler_flag
 
+  Checks once whether the C compiler supports a given flag:
+
   .. code-block:: cmake
 
-    check_c_compiler_flag(<flag> <resultVar>)
+    check_c_compiler_flag(<flag> <variable>)
 
-Check once that the ``<flag>`` is accepted by the compiler without a diagnostic.
-The result is stored in the internal cache variable specified by
-``<resultVar>``, with boolean ``true`` for success and boolean ``false`` for
-failure.
+  This command checks once that the ``<flag>`` is accepted by the C compiler
+  without producing a diagnostic message.  Multiple flags can be specified
+  in one argument as a string using a :ref:`semicolon-separated list
+  <CMake Language Lists>`.
 
-``true`` indicates only that the compiler did not issue a diagnostic message
-when given the flag. Whether the flag has any effect is beyond the scope of
-this module.
+  The result of the check is stored in the internal cache variable specified
+  by ``<variable>``, with boolean true for success and boolean false for
+  failure.
 
-Internally, :command:`try_compile` is used to perform the check. If
-:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-the check compiles and links an executable program. If set to
-``STATIC_LIBRARY``, the check is compiled but not linked.
+  A successful result only indicates that the compiler did not report an
+  error when given the flag.  Whether the flag has any effect, or the
+  intended one, is outside the scope of this module.
 
-See also :command:`check_compiler_flag` for a more general command syntax.
+  .. note::
 
-The compile and link commands can be influenced by setting any of the
-following variables prior to calling ``check_c_compiler_flag()``. Unknown flags
-in these variables can case a false negative result.
+    Since the underlying :command:`try_compile` command also uses flags from
+    variables like :variable:`CMAKE_<LANG>_FLAGS`, unknown or unsupported
+    flags in those variables may result in a false negative for this check.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to use this module to check support
+for the C compiler flag ``-fno-optimize-strlen``, which disables
+optimizations related to the ``strlen()`` C function in GCC and Clang
+compilers.  The result of the check is stored in the internal cache
+variable ``HAVE_FNO_OPTIMIZE_STRLEN``, and the flag is conditionally enabled
+using the :command:`target_compile_options` command.  The
+:genex:`$<COMPILE_LANGUAGE:...> <COMPILE_LANGUAGE:languages>` generator
+expression ensures that the flag is added only to ``C`` source files.
+
+.. code-block:: cmake
+
+  include(CheckCCompilerFlag)
+  check_c_compiler_flag(-fno-optimize-strlen HAVE_FNO_OPTIMIZE_STRLEN)
+
+  if(HAVE_FNO_OPTIMIZE_STRLEN)
+    target_compile_options(
+      example
+      PRIVATE $<$<COMPILE_LANGUAGE:C>:-fno-optimize-strlen>
+    )
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckCompilerFlag` module for a more general command to check
+  whether a compiler flag is supported.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 8b12343..8367206 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -5,50 +5,95 @@
 CheckCSourceCompiles
 --------------------
 
-Check once if C source code can be built.
+This module provides a command to check whether a C source can be built.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCSourceCompiles)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_c_source_compiles
 
+  Checks once whether the given C source code can be built:
+
   .. code-block:: cmake
 
-    check_c_source_compiles(<code> <resultVar>
-                            [FAIL_REGEX <regex1> [<regex2>...]])
+    check_c_source_compiles(<code> <variable> [FAIL_REGEX <regexes>...])
 
-  Check once that the source supplied in ``<code>`` can be built. The result is
-  stored in the internal cache variable specified by ``<resultVar>``, with
-  boolean ``true`` for success and boolean ``false`` for failure.
+  This command checks once that the source supplied in ``<code>`` can be
+  compiled (and linked into an executable).  The result of the check is
+  stored in the internal cache variable specified by ``<variable>``.
 
-  If ``FAIL_REGEX`` is provided, then failure is determined by checking
-  if anything in the compiler output matches any of the specified regular
-  expressions.
+  The arguments are:
 
-  Internally, :command:`try_compile` is used to compile the source. If
-  :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-  the source is compiled and linked as an executable program. If set to
-  ``STATIC_LIBRARY``, the source is compiled but not linked. In any case, all
-  functions must be declared as usual.
+  ``<code>``
+    C source code to check.  This must be an entire program, as written in
+    a file containing the body block.  All symbols used in the source code
+    are expected to be declared as usual in their corresponding headers.
 
-  See also :command:`check_source_compiles` for a more general command syntax.
+  ``<variable>``
+    Variable name of an internal cache variable to store the result of the
+    check, with boolean true for success and boolean false for failure.
 
-  See also :command:`check_source_runs` to run compiled source.
+  ``FAIL_REGEX <regexes>...``
+    If one or more regular expression patterns are provided, then failure is
+    determined by checking if anything in the compiler output matches any of
+    the specified regular expressions.
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_c_source_compiles()``:
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+Checking whether C source code containing SSE2 intrinsic can be compiled
+and linked:
+
+.. code-block:: cmake
+
+  include(CheckCSourceCompiles)
+
+  check_c_source_compiles("
+    #include <emmintrin.h>
+    int main(void)
+    {
+      __m128d a = _mm_setzero_pd();
+      (void)a;
+      return 0;
+    }
+  " PROJECT_HAVE_SSE2_INTRINSICS)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceCompiles` module for a more general command to
+  check whether source can be built.
+* The :module:`CheckSourceRuns` module to check whether source can be built
+  and run.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index 8fcf22b..f1188a3 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -5,43 +5,79 @@
 CheckCSourceRuns
 ----------------
 
-Check once if given C source compiles and links into an executable and can
-subsequently be run.
+This module provides a command to check whether a C source can be built and
+run.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCSourceRuns)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_c_source_runs
 
+  Checks once whether the given C source code compiles and links into an
+  executable that can subsequently be run:
+
   .. code-block:: cmake
 
-    check_c_source_runs(<code> <resultVar>)
+    check_c_source_runs(<code> <variable>)
 
-  Check once that the source supplied in ``<code>`` can be built, linked as an
-  executable, and then run. The ``<code>`` must contain at least a ``main()``
-  function.
+  The C source supplied in ``<code>`` must contain at least a ``main()``
+  function.  The result of the check is stored in the internal cache variable
+  specified by ``<variable>``.  If the code builds and runs with exit code
+  ``0``, success is indicated by a boolean true value.  Failure to build or
+  run is indicated by a boolean false value, such as an empty string or an
+  error message.
 
-  The result is stored in the internal cache variable specified by
-  ``<resultVar>``. If the code builds and runs with exit code ``0``, success is
-  indicated by boolean ``true``. Failure to build or run is indicated by boolean
-  ``false``, such as an empty string or an error message.
+  .. rubric:: Variables Affecting the Check
 
-  See also :command:`check_source_runs` for a more general command syntax.
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_c_source_runs()``:
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+Examples
+^^^^^^^^
 
+The following example demonstrates how to use this module to check whether
+the C source code is supported and operational at runtime.  The result of
+the check is stored in the internal cache variable ``HAVE_NORETURN``.
+
+.. code-block:: cmake
+
+  include(CheckCSourceRuns)
+
+  check_c_source_runs("
+    #include <stdlib.h>
+    #include <stdnoreturn.h>
+    noreturn void f(){ exit(0); }
+    int main(void) { f(); return 1; }
+  " HAVE_NORETURN)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceRuns` module for a more general command syntax.
+* The :module:`CheckSourceCompiles` module to check whether a source code
+  can be built.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index f1933f3..a39ee53 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -5,47 +5,95 @@
 CheckCXXCompilerFlag
 ------------------------
 
-Check once whether the CXX compiler supports a given flag.
+This module provides a command to check whether the C++ compiler supports a
+given flag.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCXXCompilerFlag)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_cxx_compiler_flag
 
+  Checks once whether the C++ compiler supports a given flag:
+
   .. code-block:: cmake
 
-    check_cxx_compiler_flag(<flag> <resultVar>)
+    check_cxx_compiler_flag(<flag> <variable>)
 
-Check once that the ``<flag>`` is accepted by the compiler without a diagnostic.
-The result is stored in the internal cache variable specified by
-``<resultVar>``, with boolean ``true`` for success and boolean ``false`` for
-failure.
+  This command checks once that the ``<flag>`` is accepted by the ``CXX``
+  compiler without producing a diagnostic message.  Multiple flags can be
+  specified in one argument as a string using a :ref:`semicolon-separated
+  list <CMake Language Lists>`.
 
-``true`` indicates only that the compiler did not issue a diagnostic message
-when given the flag. Whether the flag has any effect is beyond the scope of
-this module.
+  The result of the check is stored in the internal cache variable specified
+  by ``<variable>``, with boolean true for success and boolean false for
+  failure.
 
-Internally, :command:`try_compile` is used to perform the check. If
-:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-the check compiles and links an executable program. If set to
-``STATIC_LIBRARY``, the check is compiled but not linked.
+  A successful result only indicates that the compiler did not report an
+  error when given the flag.  Whether the flag has any effect, or the
+  intended one, is outside the scope of this module.
 
-See also :command:`check_compiler_flag` for a more general command syntax.
+  .. note::
 
-The compile and link commands can be influenced by setting any of the
-following variables prior to calling ``check_cxx_compiler_flag()``. Unknown flags
-in these variables can case a false negative result.
+    Since the underlying :command:`try_compile` command also uses flags from
+    variables like :variable:`CMAKE_<LANG>_FLAGS`, unknown or unsupported
+    flags in those variables may result in a false negative for this check.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to use this module to check
+the C++ compiler flag ``-fsycl``.  The result of the check is stored in the
+internal cache variable ``HAVE_FSYCL_FLAG``, and the flag is conditionally
+enabled using the :command:`target_compile_options` command.  The
+:genex:`$<COMPILE_LANGUAGE:...> <COMPILE_LANGUAGE:languages>` generator
+expression ensures that the flag is added only to ``CXX`` source files.
+
+.. code-block:: cmake
+
+  include(CheckCXXCompilerFlag)
+  check_cxx_compiler_flag(-fsycl HAVE_FSYCL_FLAG)
+
+  if(HAVE_FSYCL_FLAG)
+    target_compile_options(
+      example
+      PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-fsycl>
+    )
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckCompilerFlag` module for a more general command to check
+  whether a compiler flag is supported.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index c0402e9..2da6ef2 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -5,50 +5,95 @@
 CheckCXXSourceCompiles
 ----------------------
 
-Check once if C++ source code can be built.
+This module provides a command to check whether a C++ source can be built.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCXXSourceCompiles)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_cxx_source_compiles
 
+  Checks once whether the given C++ source code can be built:
+
   .. code-block:: cmake
 
-    check_cxx_source_compiles(<code> <resultVar>
-                              [FAIL_REGEX <regex1> [<regex2>...]])
+    check_cxx_source_compiles(<code> <variable> [FAIL_REGEX <regexes>...])
 
-  Check once that the source supplied in ``<code>`` can be built. The result is
-  stored in the internal cache variable specified by ``<resultVar>``, with
-  boolean ``true`` for success and boolean ``false`` for failure.
+  This command checks once that the source supplied in ``<code>`` can be
+  compiled (and linked into an executable).  The result of the check is
+  stored in the internal cache variable specified by ``<variable>``.
 
-  If ``FAIL_REGEX`` is provided, then failure is determined by checking
-  if anything in the compiler output matches any of the specified regular
-  expressions.
+  The arguments are:
 
-  Internally, :command:`try_compile` is used to compile the source. If
-  :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-  the source is compiled and linked as an executable program. If set to
-  ``STATIC_LIBRARY``, the source is compiled but not linked. In any case, all
-  functions must be declared as usual.
+  ``<code>``
+    C++ source code to check.  This must be an entire program, as written
+    in a file containing the body block.  All symbols used in the source code
+    are expected to be declared as usual in their corresponding headers.
 
-  See also :command:`check_source_compiles` for a more general command syntax.
+  ``<variable>``
+    Variable name of an internal cache variable to store the result of the
+    check, with boolean true for success and boolean false for failure.
 
-  See also :command:`check_source_runs` to run compiled source.
+  ``FAIL_REGEX <regexes>...``
+    If one or more regular expression patterns are provided, then failure is
+    determined by checking if anything in the compiler output matches any of
+    the specified regular expressions.
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_cxx_source_compiles()``:
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to check whether the C++ compiler
+supports a specific language feature.  In this case, the check verifies if
+the compiler supports ``C++11`` lambda expressions.  The result is stored
+in the internal cache variable ``HAVE_CXX11_LAMBDAS``:
+
+.. code-block:: cmake
+
+  include(CheckCXXSourceCompiles)
+
+  check_cxx_source_compiles("
+    int main()
+    {
+      auto lambda = []() { return 42; };
+      return lambda();
+    }
+  " HAVE_CXX11_LAMBDAS)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceCompiles` module for a more general command to
+  check whether source can be built.
+* The :module:`CheckSourceRuns` module to check whether source can be built
+  and run.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index b131a6f..47559f3 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -5,43 +5,88 @@
 CheckCXXSourceRuns
 ------------------
 
-Check once if given C++ source compiles and links into an executable and can
-subsequently be run.
+This module provides a command to check whether a C++ source can be built
+and run.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCXXSourceRuns)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_cxx_source_runs
 
+  Checks once whether the given C++ source code compiles and links into an
+  executable that can subsequently be run:
+
   .. code-block:: cmake
 
-    check_cxx_source_runs(<code> <resultVar>)
+    check_cxx_source_runs(<code> <variable>)
 
-  Check once that the source supplied in ``<code>`` can be built, linked as an
-  executable, and then run. The ``<code>`` must contain at least a ``main()``
-  function.
+  The C++ source supplied in ``<code>`` must contain at least a ``main()``
+  function.  The result of the check is stored in the internal cache variable
+  specified by ``<variable>``.  If the code builds and runs with exit code
+  ``0``, success is indicated by a boolean true value.  Failure to build or
+  run is indicated by a boolean false value, such as an empty string or an
+  error message.
 
-  The result is stored in the internal cache variable specified by
-  ``<resultVar>``. If the code builds and runs with exit code ``0``, success is
-  indicated by boolean ``true``. Failure to build or run is indicated by boolean
-  ``false``, such as an empty string or an error message.
+  .. rubric:: Variables Affecting the Check
 
-  See also :command:`check_source_runs` for a more general command syntax.
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_cxx_source_runs()``:
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+Examples
+^^^^^^^^
 
+The following example demonstrates how to check whether the C++ standard
+library is functional and ``std::vector`` works at runtime.  If the source
+compiles, links, and runs successfully, internal cache variable
+``HAVE_WORKING_STD_VECTOR`` will be set to boolean true value.  Code is
+supplied using :ref:`Bracket Argument` for easier embedded quotes handling:
+
+.. code-block:: cmake
+  :force:
+
+  include(CheckCXXSourceRuns)
+
+  check_cxx_source_runs([[
+    #include <iostream>
+    #include <vector>
+
+    int main()
+    {
+      std::vector<int> v = {1, 2, 3};
+      if (v.size() != 3) return 1;
+      std::cout << "Vector works correctly." << std::endl;
+      return 0;
+    }
+  ]] HAVE_WORKING_STD_VECTOR)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceRuns` module for a more general command syntax.
+* The :module:`CheckSourceCompiles` module to check whether a source code
+  can be built.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index ada708a..a53413e 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -5,57 +5,82 @@
 CheckCXXSymbolExists
 --------------------
 
-Check if a symbol exists as a function, variable, or macro in ``C++``.
+This module provides a command to check whether a C++ symbol exists.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCXXSymbolExists)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_cxx_symbol_exists
 
+  Checks once whether a symbol exists as a function, variable, or preprocessor
+  macro in C++:
+
   .. code-block:: cmake
 
-    check_cxx_symbol_exists(<symbol> <files> <variable>)
+    check_cxx_symbol_exists(<symbol> <headers> <variable>)
 
-  Check that the ``<symbol>`` is available after including given header
-  ``<files>`` and store the result in a ``<variable>``.  Specify the list of
-  files in one argument as a semicolon-separated list.
-  ``check_cxx_symbol_exists()`` can be used to check for symbols as seen by
-  the C++ compiler, as opposed to :command:`check_symbol_exists`, which always
-  uses the ``C`` compiler.
+  This command checks whether the ``<symbol>`` is available after including
+  the specified header file(s) ``<headers>``, and stores the result in the
+  internal cache variable ``<variable>``.  Multiple header files can be
+  specified in one argument as a string using a
+  :ref:`semicolon-separated list <CMake Language Lists>`.
 
-  If the header files define the symbol as a macro it is considered
-  available and assumed to work.  If the header files declare the symbol
-  as a function or variable then the symbol must also be available for
-  linking.  If the symbol is a type, enum value, or C++ template it will
-  not be recognized: consider using the :module:`CheckTypeSize`
-  or :module:`CheckSourceCompiles` module instead.
+  If the header files define the symbol as a macro, it is considered
+  available and assumed to work.  If the symbol is declared as a function
+  or variable, the check also ensures that it links successfully
+  (i.e., the symbol must exist in a linked library or object file).
 
-.. note::
+  Symbols that are types, enum values, or C++ templates are not
+  recognized.  For those, consider using the :module:`CheckTypeSize` or
+  :module:`CheckSourceCompiles` module instead.
 
-  This command is unreliable when ``<symbol>`` is (potentially) an overloaded
-  function. Since there is no reliable way to predict whether a given function
-  in the system environment may be defined as an overloaded function or may be
-  an overloaded function on other systems or will become so in the future, it
-  is generally advised to use the :module:`CheckSourceCompiles` module for
-  checking any function symbol (unless somehow you surely know the checked
-  function is not overloaded on other systems or will not be so in the
-  future).
+  This command is intended to check symbols as they appear in C++.  For C
+  symbols, use the :module:`CheckSymbolExists` module instead.
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+  .. note::
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+    This command is unreliable for symbols that are (potentially) overloaded
+    functions.  Since there is no reliable way to predict whether
+    a given function in the system environment may be defined as an
+    overloaded function or may be an overloaded function on other systems
+    or will become so in the future, it is generally advised to use the
+    :module:`CheckSourceCompiles` module for checking any function symbol
+    (unless it is certain the checked function is not overloaded on other
+    systems or will not be so in the future).
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-For example:
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to check for the presence of a
+preprocessor macro ``SEEK_SET`` and the C++ function ``std::fopen()`` from
+the ``<cstdio>`` header using this module:
 
 .. code-block:: cmake
 
@@ -63,8 +88,14 @@
 
   # Check for macro SEEK_SET
   check_cxx_symbol_exists(SEEK_SET "cstdio" HAVE_SEEK_SET)
+
   # Check for function std::fopen
   check_cxx_symbol_exists(std::fopen "cstdio" HAVE_STD_FOPEN)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSymbolExists` module to check whether a C symbol exists.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckCompilerFlag.cmake b/Modules/CheckCompilerFlag.cmake
index 2854fa8..969e6f6 100644
--- a/Modules/CheckCompilerFlag.cmake
+++ b/Modules/CheckCompilerFlag.cmake
@@ -7,46 +7,114 @@
 
 .. versionadded:: 3.19
 
-Check once whether the ``<lang>`` compiler supports a given flag.
+This module provides a command to check whether the compiler supports a given
+flag.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckCompilerFlag)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_compiler_flag
 
+  Checks once whether the compiler supports a given flag:
+
   .. code-block:: cmake
 
-    check_compiler_flag(<lang> <flag> <resultVar>)
+    check_compiler_flag(<lang> <flag> <variable>)
 
-Check once that the ``<flag>`` is accepted by the ``<lang>`` compiler without
-a diagnostic. The result is stored in the internal cache variable specified by
-``<resultVar>``, with boolean ``true`` for success and boolean ``false`` for
-failure.
+  This command checks once that the ``<flag>`` is accepted by the ``<lang>``
+  compiler without producing a diagnostic message.  The result of the check
+  is stored in the internal cache variable specified by ``<variable>``.
 
-``true`` indicates only that the compiler did not issue a diagnostic message
-when given the flag. Whether the flag has any effect is beyond the scope of
-this module.
+  The arguments are:
 
-Internally, :command:`try_compile` is used to perform the check. If
-:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-the check compiles and links an executable program. If set to
-``STATIC_LIBRARY``, the check is compiled but not linked.
+  ``<lang>``
+    The language of the compiler used for the check.  Supported languages
+    are: ``C``, ``CXX``, ``CUDA``, ``Fortran``, ``HIP``, ``ISPC``, ``OBJC``,
+    and ``OBJCXX``, and ``Swift``.
 
-The compile and link commands can be influenced by setting any of the
-following variables prior to calling ``check_compiler_flag()``. Unknown flags
-in these variables can case a false negative result.
+    .. versionadded:: 3.21
+      Support for ``HIP`` language.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+    .. versionadded:: 3.26
+      Support for ``Swift`` language.
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  ``<flag>``
+    Compiler flag(s) to check.  Multiple flags can be specified in one
+    argument as a string using a :ref:`semicolon-separated list
+    <CMake Language Lists>`.
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  ``<variable>``
+    Variable name of an internal cache variable to store the result of the
+    check, with boolean true for success and boolean false for failure.
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  A successful result only indicates that the compiler did not report an
+  error when given the flag.  Whether the flag has any effect, or the
+  intended one, is outside the scope of this module.
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. note::
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+    Since the underlying :command:`try_compile` command also uses flags from
+    variables like :variable:`CMAKE_<LANG>_FLAGS`, unknown or unsupported
+    flags in those variables may result in a false negative for this check.
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. rubric:: Variables Affecting the Check
 
+  The following variables may be set before calling this command to modify
+  the way the check is run:
+
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to use this module to check support
+for the C compiler flag ``-fno-optimize-strlen``, which disables
+optimizations related to the ``strlen()`` C function in GCC and Clang
+compilers.  The result of the check is stored in the internal cache
+variable ``HAVE_FNO_OPTIMIZE_STRLEN``, and the flag is conditionally enabled
+using the :command:`target_compile_options` command.  The
+:genex:`$<COMPILE_LANGUAGE:...> <COMPILE_LANGUAGE:languages>` generator
+expression ensures that the flag is added only to ``C`` source files.
+
+.. code-block:: cmake
+
+  include(CheckCompilerFlag)
+  check_compiler_flag(C -fno-optimize-strlen HAVE_FNO_OPTIMIZE_STRLEN)
+
+  if(HAVE_FNO_OPTIMIZE_STRLEN)
+    target_compile_options(
+      example
+      PRIVATE $<$<COMPILE_LANGUAGE:C>:-fno-optimize-strlen>
+    )
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckLinkerFlag` module to check whether a linker flag is
+  supported by the compiler.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index c04f26c..e943414 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -7,48 +7,96 @@
 
 .. versionadded:: 3.3
 
-Check once whether the Fortran compiler supports a given flag.
+This module provides a command to check whether the Fortran compiler supports
+a given flag.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckFortranCompilerFlag)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_fortran_compiler_flag
 
+  Checks once whether the Fortran compiler supports a given flag:
+
   .. code-block:: cmake
 
-    check_fortran_compiler_flag(<flag> <resultVar>)
+    check_fortran_compiler_flag(<flag> <variable>)
 
-Check once that the ``<flag>`` is accepted by the compiler without a diagnostic.
-The result is stored in the internal cache variable specified by
-``<resultVar>``, with boolean ``true`` for success and boolean ``false`` for
-failure.
+  This command checks once that the ``<flag>`` is accepted by the Fortran
+  compiler without producing a diagnostic message.  Multiple flags can be
+  specified in one argument as a string using a :ref:`semicolon-separated list
+  <CMake Language Lists>`.
 
-``true`` indicates only that the compiler did not issue a diagnostic message
-when given the flag. Whether the flag has any effect is beyond the scope of
-this module.
+  The result of the check is stored in the internal cache variable specified
+  by ``<variable>``, with boolean true for success and boolean false for
+  failure.
 
-Internally, :command:`try_compile` is used to perform the check. If
-:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-the check compiles and links an executable program. If set to
-``STATIC_LIBRARY``, the check is compiled but not linked.
+  A successful result only indicates that the compiler did not report an
+  error when given the flag.  Whether the flag has any effect, or the
+  intended one, is outside the scope of this module.
 
-See also :command:`check_compiler_flag` for a more general command syntax.
+  .. note::
 
-The compile and link commands can be influenced by setting any of the
-following variables prior to calling ``check_fortran_compiler_flag()``. Unknown
-flags in these variables can case a false negative result.
+    Since the underlying :command:`try_compile` command also uses flags from
+    variables like :variable:`CMAKE_<LANG>_FLAGS`, unknown or unsupported
+    flags in those variables may result in a false negative for this check.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to use this module to check
+the Fortran compiler flag ``-fallow-argument-mismatch``.  The result of the
+check is stored in the internal cache variable ``HAVE_FORTRAN_FLAG``, and
+the flag is conditionally enabled using the :command:`target_compile_options`
+command.  The :genex:`$<COMPILE_LANGUAGE:...> <COMPILE_LANGUAGE:languages>`
+generator expression ensures that the flag is added only to ``Fortran``
+source files.
+
+.. code-block:: cmake
+
+  include(CheckFortranCompilerFlag)
+  check_fortran_compiler_flag(-fallow-argument-mismatch HAVE_FORTRAN_FLAG)
+
+  if(HAVE_FORTRAN_FLAG)
+    target_compile_options(
+      example
+      PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:-fallow-argument-mismatch>
+    )
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckCompilerFlag` module for a more general command to check
+  whether a compiler flag is supported.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index 1c73604..536a50d 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -5,35 +5,86 @@
 CheckFortranFunctionExists
 --------------------------
 
-Check if a Fortran function exists.
+This module provides a command to check whether a Fortran function exists.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckFortranFunctionExists)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_fortran_function_exists
 
+  Checks once whether a Fortran function exists:
+
   .. code-block:: cmake
 
-    check_fortran_function_exists(<function> <result>)
-
-  where
+    check_fortran_function_exists(<function> <variable>)
 
   ``<function>``
-    the name of the Fortran function
-  ``<result>``
-    variable to store the result; will be created as an internal cache variable.
+    The name of the Fortran function.
 
-.. note::
+  ``<variable>``
+    The name of the variable in which to store the check result.  This
+    variable will be created as an internal cache variable.
 
-  This command does not detect functions in Fortran modules. In general it is
-  recommended to use :module:`CheckSourceCompiles` instead to determine if a
-  Fortran function or subroutine is available.
+  .. note::
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+    This command does not detect functions provided by Fortran modules.  In
+    general, it is recommended to use :module:`CheckSourceCompiles` instead
+    to determine whether a Fortran function or subroutine is available.
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+Examples
+^^^^^^^^
+
+Example: Isolated Check With Linked Libraries
+"""""""""""""""""""""""""""""""""""""""""""""
+
+In the following example, this module is used in combination with the
+:module:`CMakePushCheckState` module to temporarily modify the required
+linked libraries (via ``CMAKE_REQUIRED_LIBRARIES``) and verify whether the
+Fortran function ``dgesv`` is available for linking.  The result is stored
+in the internal cache variable ``PROJECT_HAVE_DGESV``:
+
+.. code-block:: cmake
+
+  include(CheckFortranFunctionExists)
+  include(CMakePushCheckState)
+
+  find_package(LAPACK)
+
+  if(TARGET LAPACK::LAPACK)
+    cmake_push_check_state(RESET)
+
+    set(CMAKE_REQUIRED_LIBRARIES LAPACK::LAPACK)
+    check_fortran_function_exists(dgesv PROJECT_HAVE_DGESV)
+
+    cmake_pop_check_state()
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckFunctionExists` module to check whether a C function
+  exists.
+* The :module:`CheckSourceCompiles` module to check whether source code
+  can be compiled.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index 39176e2..ea02cd5 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -7,56 +7,107 @@
 
 .. versionadded:: 3.1
 
-Check once if Fortran source code can be built.
+This module provides a command to check whether a Fortran source can be
+built.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckFortranSourceCompiles)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_fortran_source_compiles
 
+  Checks once whether the given Fortran source code can be built:
+
   .. code-block:: cmake
 
-    check_fortran_source_compiles(<code> <resultVar>
-        [FAIL_REGEX <regex>...]
-        [SRC_EXT <extension>]
+    check_fortran_source_compiles(
+      <code>
+      <variable>
+      [FAIL_REGEX <regexes>...]
+      [SRC_EXT <extension>]
     )
 
-  Check once that the source supplied in ``<code>`` can be built. The result is
-  stored in the internal cache variable specified by ``<resultVar>``, with
-  boolean ``true`` for success and boolean ``false`` for failure.
+  This command checks once that the source supplied in ``<code>`` can be
+  compiled (and linked into an executable).  The result of the check is
+  stored in the internal cache variable specified by ``<variable>``.
 
-  If ``FAIL_REGEX`` is provided, then failure is determined by checking
-  if anything in the compiler output matches any of the specified regular
-  expressions.
+  The arguments are:
 
-  By default, the test source file will be given a ``.F`` file extension. The
-  ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead--
-  ``.F90`` is a typical choice.
+  ``<code>``
+    Fortran source code to check.  This must be an entire program, as
+    written in a file containing the body block.  All symbols used in the
+    source code are expected to be declared as usual in their corresponding
+    headers.
 
-  See also :command:`check_source_compiles` for a more general command syntax.
+  ``<variable>``
+    Variable name of an internal cache variable to store the result of the
+    check, with boolean true for success and boolean false for failure.
 
-  See also :command:`check_source_runs` to run compiled source.
+  ``FAIL_REGEX <regexes>...``
+    If this option is provided with one or more regular expressions, then
+    failure is determined by checking if anything in the compiler output
+    matches any of the specified regular expressions.
 
-  Internally, :command:`try_compile` is used to compile the source. If
-  :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-  the source is compiled and linked as an executable program. If set to
-  ``STATIC_LIBRARY``, the source is compiled but not linked. In any case, all
-  functions must be declared as usual.
+  ``SRC_EXT <extension>``
+    .. versionadded:: 3.7
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_fortran_source_compiles()``:
+    By default, the test source file used for the check will be given a
+    ``.F`` file extension.  This option can be used to override this with
+    ``.<extension>`` instead - ``.F90`` is a typical choice.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+Checking whether the Fortran compiler supports the ``pure`` procedure
+attribute:
+
+.. code-block:: cmake
+
+  include(CheckFortranSourceCompiles)
+
+  check_fortran_source_compiles("
+    pure subroutine foo()
+    end subroutine
+    program test
+      call foo()
+    end
+  " HAVE_PURE SRC_EXT "F90")
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceCompiles` module for a more general command to
+  check whether source can be built.
+* The :module:`CheckSourceRuns` module to check whether source can be built
+  and run.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index 62c6ac5..3801a1e 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -7,54 +7,86 @@
 
 .. versionadded:: 3.14
 
-Check once if given Fortran source compiles and links into an executable and can
-subsequently be run.
+This module provides a command to check whether a Fortran source can be built
+and run.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckFortranSourceRuns)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_fortran_source_runs
 
-  .. code-block:: cmake
-
-    check_fortran_source_runs(<code> <resultVar>
-        [SRC_EXT <extension>])
-
-  Check once that the source supplied in ``<code>`` can be built, linked as an
-  executable, and then run. The ``<code>`` must contain a Fortran ``program``.
-
-  The result is stored in the internal cache variable specified by
-  ``<resultVar>``. If the code builds and runs with exit code ``0``, success is
-  indicated by boolean ``true``. Failure to build or run is indicated by boolean
-  ``false``, such as an empty string or an error message.
+  Checks once whether the given Fortran source compiles and links into an
+  executable that can subsequently be run.
 
   .. code-block:: cmake
 
-    check_fortran_source_runs("program test
+    check_fortran_source_runs(<code> <variable> [SRC_EXT <extension>])
+
+  The Fortran source supplied in ``<code>`` must contain a Fortran ``program``
+  unit.  The result of the check is stored in the internal cache variable
+  specified by ``<variable>``.  If the code builds and runs with exit code
+  ``0``, success is indicated by a boolean true value.  Failure to build or
+  run is indicated by a boolean false value, such as an empty string or an
+  error message.
+
+  The options are:
+
+  ``SRC_EXT <extension>``
+    By default, the internal test source file used for the check will be
+    given a ``.F90`` file extension.  This option can be used to change the
+    extension to ``.<extension>`` instead.
+
+  .. rubric:: Variables Affecting the Check
+
+  The following variables may be set before calling this command to modify
+  the way the check is run:
+
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+Examples
+^^^^^^^^
+
+The following example shows how to use this module to check whether a Fortran
+source code runs and store the result of the check in an internal cache
+variable ``HAVE_COARRAY``:
+
+.. code-block:: cmake
+
+  include(CheckFortranSourceRuns)
+
+  check_fortran_source_runs([[
+    program test
     real :: x[*]
     call co_sum(x)
-    end program"
-    HAVE_COARRAY)
+    end program
+  ]] HAVE_COARRAY)
 
-  By default, the test source file will be given a ``.F90`` file extension. The
-  ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead.
+See Also
+^^^^^^^^
 
-  See also :command:`check_source_runs` for a more general command syntax.
-
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_fortran_source_runs()``:
-
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
-
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
-
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
-
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
-
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
-
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
-
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
-
+* The :module:`CheckSourceRuns` module for a more general command syntax.
+* The :module:`CheckSourceCompiles` module to check whether a source code
+  can be built.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index 4c73ea6..5d13f2b 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -5,47 +5,121 @@
 CheckFunctionExists
 -------------------
 
-Check once if a C function can be linked from system libraries.
+This module provides a command to check whether a C function exists.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckFunctionExists)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_function_exists
 
+  Checks once whether a C function can be linked from system libraries:
+
   .. code-block:: cmake
 
     check_function_exists(<function> <variable>)
 
-  Checks that the ``<function>`` is provided by libraries on the system and store
-  the result in internal cache variable ``<variable>``.
+  This command checks whether the ``<function>`` is provided by libraries
+  on the system, and stores the result in an internal cache variable
+  ``<variable>``.
 
-The following variables may be set before calling this macro to modify the
-way the check is run:
+  .. note::
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+    Prefer using :module:`CheckSymbolExists` or :module:`CheckSourceCompiles`
+    instead of this command, for the following reasons:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+    * ``check_function_exists()`` can't detect functions that are inlined
+      in headers or defined as preprocessor macros.
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+    * ``check_function_exists()`` can't detect anything in the 32-bit
+      versions of the Win32 API, because of a mismatch in calling conventions.
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+    * ``check_function_exists()`` only verifies linking, it does not verify
+      that the function is declared in system headers.
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. note::
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-  Prefer using :module:`CheckSymbolExists` or :module:`CheckSourceCompiles`
-  instead of this module, for the following reasons:
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-  * ``check_function_exists()`` can't detect functions that are inlined
-    in headers or specified as a macro.
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-  * ``check_function_exists()`` can't detect anything in the 32-bit
-    versions of the Win32 API, because of a mismatch in calling conventions.
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-  * ``check_function_exists()`` only verifies linking, it does not verify
-    that the function is declared in system headers.
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+Examples
+^^^^^^^^
+
+Example: Basic Usage
+""""""""""""""""""""
+
+In the following example, a check is performed to determine whether the
+linker sees the C function ``fopen()``, and the result is stored in the
+``HAVE_FOPEN`` internal cache variable:
+
+.. code-block:: cmake
+
+  include(CheckFunctionExists)
+
+  check_function_exists(fopen HAVE_FOPEN)
+
+Example: Missing Declaration
+""""""""""""""""""""""""""""
+
+As noted above, the :module:`CheckSymbolExists` module is preferred for
+checking C functions, since it also verifies whether the function is
+declared or defined as a macro.  In the following example, this module is
+used to check an edge case where a function may not be declared in system
+headers.  For instance, on macOS, the ``fdatasync()`` function may be
+available in the C library, but its declaration is not provided in the
+``unistd.h`` system header.
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(CheckFunctionExists)
+  include(CheckSymbolExists)
+
+  check_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
+
+  # Check if fdatasync() is available in the C library.
+  if(NOT HAVE_FDATASYNC)
+    check_function_exists(fdatasync HAVE_FDATASYNC_WITHOUT_DECL)
+  endif()
+
+In such a case, the project can provide its own declaration if missing:
+
+.. code-block:: c
+  :caption: ``example.c``
+
+  #ifdef HAVE_FDATASYNC_WITHOUT_DECL
+    extern int fdatasync(int);
+  #endif
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSymbolExists` module to check whether a C symbol exists.
+* The :module:`CheckSourceCompiles` module to check whether a source code
+  can be compiled.
+* The :module:`CheckFortranFunctionExists` module to check whether a
+  Fortran function exists.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index 9c4f61e..ced2a81 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -7,25 +7,56 @@
 
 .. versionadded:: 3.9
 
-Check whether the compiler supports an interprocedural optimization (IPO/LTO).
-Use this before enabling the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target
-property.
+This module provides a command to check whether the compiler supports
+interprocedural optimization (IPO/LTO).
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckIPOSupported)
+
+Interprocedural optimization is a compiler technique that performs
+optimizations across translation units (i.e., across source files), allowing
+the compiler to analyze and optimize the entire program as a whole rather
+than file-by-file.  This can improve performance by enabling more aggressive
+inlining and dead code elimination.  When these optimizations are applied at
+link time, the process is typically referred to as link-time optimization
+(LTO), which is a common form of IPO.
+
+In CMake, interprocedural optimization can be enabled on a per-target basis
+using the :prop_tgt:`INTERPROCEDURAL_OPTIMIZATION` target property, or
+for all targets in the current scope using the
+:variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION` variable.
+
+Use this module before enabling the interprocedural optimization on targets
+to ensure the compiler supports IPO/LTO.
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_ipo_supported
 
+  Checks whether the compiler supports interprocedural optimization (IPO/LTO):
+
   .. code-block:: cmake
 
-    check_ipo_supported([RESULT <result>] [OUTPUT <output>]
-                        [LANGUAGES <lang>...])
+    check_ipo_supported(
+      [RESULT <result-var>]
+      [OUTPUT <output-var>]
+      [LANGUAGES <lang>...]
+    )
 
   Options are:
 
-  ``RESULT <result>``
-    Set ``<result>`` variable to ``YES`` if IPO is supported by the
+  ``RESULT <result-var>``
+    Set ``<result-var>`` variable to ``YES`` if IPO is supported by the
     compiler and ``NO`` otherwise.  If this option is not given then
     the command will issue a fatal error if IPO is not supported.
-  ``OUTPUT <output>``
-    Set ``<output>`` variable with details about any error.
+  ``OUTPUT <output-var>``
+    Set ``<output-var>`` variable with details about any error.
   ``LANGUAGES <lang>...``
     Specify languages whose compilers to check.
 
@@ -44,37 +75,49 @@
     If this option is not given, the default languages are picked from
     the current :prop_gbl:`ENABLED_LANGUAGES` global property.
 
-.. note::
+  .. note::
 
-  To use ``check_ipo_supported()``, policy :policy:`CMP0069` must be set to
-  ``NEW``; otherwise, a fatal error will occur.
+    To use ``check_ipo_supported()``, policy :policy:`CMP0069` must be set to
+    ``NEW``; otherwise, a fatal error will occur.
 
-.. versionadded:: 3.13
-  Support for Visual Studio generators.
+  .. versionadded:: 3.13
+    Support for :ref:`Visual Studio Generators`.
 
-.. versionadded:: 3.24
-  The check uses the caller's :variable:`CMAKE_<LANG>_FLAGS`
-  and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` values.
-  See policy :policy:`CMP0138`.
+  .. versionadded:: 3.24
+    The check uses the caller's :variable:`CMAKE_<LANG>_FLAGS`
+    and :variable:`CMAKE_<LANG>_FLAGS_<CONFIG>` values.
+    See policy :policy:`CMP0138`.
 
 Examples
 ^^^^^^^^
 
+Checking whether the compiler supports IPO and emitting a fatal error if it is
+not supported:
+
 .. code-block:: cmake
 
+  include(CheckIPOSupported)
   check_ipo_supported() # fatal error if IPO is not supported
   set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
 
+The following example demonstrates how to use this module to enable IPO for
+the target only when supported by the compiler and to issue a warning if it
+is not.  Additionally, projects may want to provide a configuration option
+to control when IPO is enabled.  For example:
+
 .. code-block:: cmake
 
-  # Optional IPO. Do not use IPO if it's not supported by compiler.
-  check_ipo_supported(RESULT result OUTPUT output)
-  if(result)
-    set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
-  else()
-    message(WARNING "IPO is not supported: ${output}")
-  endif()
+  option(FOO_ENABLE_IPO "Enable IPO/LTO")
 
+  if(FOO_ENABLE_IPO)
+    include(CheckIPOSupported)
+    check_ipo_supported(RESULT result OUTPUT output)
+    if(result)
+      set_property(TARGET foo PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+    else()
+      message(WARNING "IPO is not supported: ${output}")
+    endif()
+  endif()
 #]=======================================================================]
 
 # X_RESULT - name of the final result variable
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index f070ba5..dab4f68 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -5,39 +5,105 @@
 CheckIncludeFile
 ----------------
 
-Provides a macro to check if a header file can be included in ``C``.
+This module provides a command to check C header file.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckIncludeFile)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_include_file
 
+  Checks once whether a header file can be included in C code:
+
   .. code-block:: cmake
 
     check_include_file(<include> <variable> [<flags>])
 
-  Check if the given ``<include>`` file may be included in a ``C``
-  source file and store the result in an internal cache entry named
-  ``<variable>``.  The optional third argument may be used to add
-  compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
+  This command checks once whether the given ``<include>`` header file
+  exists and can be included in a C source file.  The result of the check
+  is stored in an internal cache variable named ``<variable>``.  The
+  optional third argument may be used to add additional compilation flags
+  to the check (or use the ``CMAKE_REQUIRED_FLAGS`` variable below).
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-See the :module:`CheckIncludeFiles` module to check for multiple headers
-at once.  See the :module:`CheckIncludeFileCXX` module to check for headers
-using the ``CXX`` language.
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. versionadded:: 3.12
+    The ``CMAKE_REQUIRED_LIBRARIES`` variable, if policy :policy:`CMP0075` is
+    set to ``NEW``.
+
+Examples
+^^^^^^^^
+
+Example: Checking C Header
+""""""""""""""""""""""""""
+
+Checking whether the C header ``<unistd.h>`` exists and storing the check
+result in the ``HAVE_UNISTD_H`` cache variable:
+
+.. code-block:: cmake
+
+  include(CheckIncludeFile)
+
+  check_include_file(unistd.h HAVE_UNISTD_H)
+
+Example: Isolated Check
+"""""""""""""""""""""""
+
+In the following example, this module is used in combination with the
+:module:`CMakePushCheckState` module to temporarily modify the required
+compile definitions (via ``CMAKE_REQUIRED_DEFINITIONS``) and verify whether
+the C header ``ucontext.h`` is available.  The result is stored
+in the internal cache variable ``HAVE_UCONTEXT_H``.
+
+For example, on macOS, the ``ucontext`` API is deprecated, and headers may
+be hidden unless certain feature macros are defined.  In particular,
+defining ``_XOPEN_SOURCE`` (without a value) can expose the necessary
+symbols without enabling broader POSIX or SUS (Single Unix Specification)
+features (values 500 or greater).
+
+.. code-block:: cmake
+
+  include(CheckIncludeFile)
+  include(CMakePushCheckState)
+
+  cmake_push_check_state(RESET)
+    if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE)
+    endif()
+
+    check_include_files(ucontext.h HAVE_UCONTEXT_H)
+  cmake_pop_check_state()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIncludeFileCXX` module to check for single C++ header.
+* The :module:`CheckIncludeFiles` module to check for one or more C or
+  C++ headers at once.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index ec02b36..54b7f55 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -5,38 +5,74 @@
 CheckIncludeFileCXX
 -------------------
 
-Provides a macro to check if a header file can be included in ``CXX``.
+This module provides a command to check a C++ header file.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckIncludeFileCXX)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_include_file_cxx
 
+  Checks once whether a header file can be included in C++ code:
+
   .. code-block:: cmake
 
     check_include_file_cxx(<include> <variable> [<flags>])
 
-  Check if the given ``<include>`` file may be included in a ``CXX``
-  source file and store the result in an internal cache entry named
-  ``<variable>``.  The optional third argument may be used to add
-  compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
+  This command checks once whether the given ``<include>`` header file
+  exists and can be included in a ``CXX`` source file.  The result of the
+  check is stored in an internal cache variable named ``<variable>``.  The
+  optional third argument may be used to add additional compilation flags
+  to the check (or use the ``CMAKE_REQUIRED_FLAGS`` variable below).
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFiles`
-to check for one or more ``C`` headers.
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. versionadded:: 3.12
+    The ``CMAKE_REQUIRED_LIBRARIES`` variable, if policy :policy:`CMP0075` is
+    set to ``NEW``.
+
+Examples
+^^^^^^^^
+
+Checking whether the ``C++23`` header ``<stdfloat>`` exists and storing the
+check result in the ``HAVE_STDFLOAT_HEADER`` cache variable:
+
+.. code-block:: cmake
+
+  include(CheckIncludeFileCXX)
+
+  check_include_file_cxx(stdfloat HAVE_STDFLOAT_HEADER)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIncludeFile` module to check for single C header.
+* The :module:`CheckIncludeFiles` module to check for one or more C or
+  C++ headers at once.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 6dfb41d..7debbe6 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -5,44 +5,98 @@
 CheckIncludeFiles
 -----------------
 
-Provides a macro to check if a list of one or more header files can
-be included together.
+This module provides a command to check one or more C/C++ header files.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckIncludeFiles)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_include_files
 
+  Checks once whether one or more header files can be included together in
+  source code:
+
   .. code-block:: cmake
 
-    check_include_files("<includes>" <variable> [LANGUAGE <language>])
+    check_include_files(<includes> <variable> [LANGUAGE <language>])
 
-  Check if the given ``<includes>`` list may be included together
-  in a source file and store the result in an internal cache
-  entry named ``<variable>``.  Specify the ``<includes>`` argument
-  as a :ref:`;-list <CMake Language Lists>` of header file names.
+  This command checks once whether the given ``<includes>`` list of header
+  files exist and can be included together in a C or C++ source file.  The
+  result of the check is stored in an internal cache variable named
+  ``<variable>``.  Specify the ``<includes>`` argument as a
+  :ref:`semicolon-separated list <CMake Language Lists>` of header file
+  names.
 
   If ``LANGUAGE`` is set, the specified compiler will be used to perform the
-  check. Acceptable values are ``C`` and ``CXX``. If not set, the C compiler
-  will be used if enabled. If the C compiler is not enabled, the C++
-  compiler will be used if enabled.
+  check.  Acceptable values are ``C`` and ``CXX``.  If not set, the C
+  compiler will be used if enabled.  If the C compiler is not enabled, the
+  C++ compiler will be used if enabled.
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX`
-to check for a single header file in ``C`` or ``CXX`` languages.
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. versionadded:: 3.12
+    The ``CMAKE_REQUIRED_LIBRARIES`` variable, if policy :policy:`CMP0075` is
+    set to ``NEW``.
+
+Examples
+^^^^^^^^
+
+Checking one or more C headers and storing the check result in cache
+variables:
+
+.. code-block:: cmake
+
+  include(CheckIncludeFiles)
+
+  check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
+
+  if(HAVE_SYS_SOCKET_H)
+    # The <net/if.h> header on Darwin and BSD-like systems is not self-contained
+    # and also requires <sys/socket.h>
+    check_include_files("sys/socket.h;net/if.h" HAVE_NET_IF_H)
+  else()
+    check_include_files(net/if.h HAVE_NET_IF_H)
+  endif()
+
+The ``LANGUAGE`` option can be used to specify which compiler to use.  For
+example, checking multiple ``C++`` headers, when both ``C`` and ``CXX``
+languages are enabled in the project:
+
+.. code-block:: cmake
+
+  include(CheckIncludeFiles)
+
+  check_include_files("header_1.hpp;header_2.hpp" HAVE_HEADERS LANGUAGE CXX)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckIncludeFile` module to check for a single C header.
+* The :module:`CheckIncludeFileCXX` module to check for a single C++ header.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake
index 5ca5f68..1fe9bc4 100644
--- a/Modules/CheckLanguage.cmake
+++ b/Modules/CheckLanguage.cmake
@@ -5,17 +5,33 @@
 CheckLanguage
 -------------
 
-Check whether a language can be enabled by the :command:`enable_language`
-or :command:`project` commands:
+This module provides a command to check whether a language can be enabled
+using the :command:`enable_language` or :command:`project` commands.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckLanguage)
+
+This module is useful when a project does not always require a specific
+language but may need to enable it for certain parts.
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_language
 
+  Checks whether a language can be enabled in a CMake project:
+
   .. code-block:: cmake
 
     check_language(<lang>)
 
-  Try enabling language ``<lang>`` in a test project and record results
-  in the cache:
+  This command attempts to enable the language ``<lang>`` in a test project and
+  records the results in the following cache variables:
 
   :variable:`CMAKE_<LANG>_COMPILER`
     If the language can be enabled, this variable is set to the compiler
@@ -44,13 +60,18 @@
   :variable:`CMAKE_<LANG>_PLATFORM <CMAKE_HIP_PLATFORM>`
     This variable is set to the detected GPU platform when ``<lang>`` is ``HIP``.
 
-    If the variable is already set its value is always preserved. Only compatible values
-    will be considered for :variable:`CMAKE_<LANG>_COMPILER`.
+    If this variable is already set, its value is always preserved.  Only
+    compatible values will be considered for :variable:`CMAKE_<LANG>_COMPILER`.
 
-For example:
+Examples
+^^^^^^^^
+
+The following example checks for the availability of the ``Fortran`` language
+and enables it if possible:
 
 .. code-block:: cmake
 
+  include(CheckLanguage)
   check_language(Fortran)
   if(CMAKE_Fortran_COMPILER)
     enable_language(Fortran)
@@ -70,31 +91,34 @@
     message(CHECK_START "${_desc}")
     file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang})
 
-    set(extra_compiler_variables)
+    set(_input_variables "set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")\n")
+    get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+    list(REMOVE_ITEM _languages "NONE")
+    if(NOT _languages STREQUAL "")
+      string(APPEND _input_variables "set(_CMAKE_CHECK_ENABLED_LANGUAGES \"${_languages}\")\n")
+      foreach(l IN LISTS _languages)
+        string(APPEND _input_variables
+          "set(CMAKE_${l}_COMPILER \"${CMAKE_${l}_COMPILER}\")\n"
+          "set(CMAKE_${l}_COMPILER_ID \"${CMAKE_${l}_COMPILER_ID}\")\n"
+          "set(CMAKE_${l}_COMPILER_LOADED ${CMAKE_${l}_COMPILER_LOADED})\n"
+          "set(CMAKE_${l}_COMPILER_VERSION \"${CMAKE_${l}_COMPILER_VERSION}\")\n"
+        )
+      endforeach()
+    endif()
+
+    set(_output_variables "set(CMAKE_${lang}_COMPILER \\\"\${CMAKE_${lang}_COMPILER}\\\")\n")
     if("${lang}" MATCHES "^(CUDA|HIP)$" AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
-      set(extra_compiler_variables "set(CMAKE_${lang}_HOST_COMPILER \\\"\${CMAKE_${lang}_HOST_COMPILER}\\\")")
+      string(APPEND _output_variables "set(CMAKE_${lang}_HOST_COMPILER \\\"\${CMAKE_${lang}_HOST_COMPILER}\\\")\n")
     endif()
-
     if("${lang}" STREQUAL "HIP")
-      list(APPEND extra_compiler_variables "set(CMAKE_${lang}_PLATFORM \\\"\${CMAKE_${lang}_PLATFORM}\\\")")
+      string(APPEND _output_variables "set(CMAKE_${lang}_PLATFORM \\\"\${CMAKE_${lang}_PLATFORM}\\\")\n")
     endif()
 
-    list(TRANSFORM extra_compiler_variables PREPEND "\"")
-    list(TRANSFORM extra_compiler_variables APPEND "\\n\"")
-    list(JOIN extra_compiler_variables "\n  " extra_compiler_variables)
-
-    set(_cl_content
-      "cmake_minimum_required(VERSION ${CMAKE_VERSION})
-set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
-project(Check${lang} ${lang})
-file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
-  \"set(CMAKE_${lang}_COMPILER \\\"\${CMAKE_${lang}_COMPILER}\\\")\\n\"
-  ${extra_compiler_variables}
-  )"
-    )
-
     file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/CMakeLists.txt"
-      "${_cl_content}")
+      "cmake_minimum_required(VERSION ${CMAKE_VERSION})
+${_input_variables}
+project(Check${lang} LANGUAGES ${lang})
+file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" \"${_output_variables}\")")
     if(CMAKE_GENERATOR_INSTANCE)
       set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE:INTERNAL=${CMAKE_GENERATOR_INSTANCE}")
     else()
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index e739955..bd75bd1 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -5,47 +5,84 @@
 CheckLibraryExists
 ------------------
 
-Check once if the function exists in system or specified library.
+This module provides a command to check whether a C library exists.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckLibraryExists)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_library_exists
 
+  Checks once whether a specified library exists and a given C function is
+  available:
+
   .. code-block:: cmake
 
     check_library_exists(<library> <function> <location> <variable>)
 
-  Check that the library ``<library>`` exists in the given location
-  ``<location>`` and has the specified ``<function>``. The result is stored in
-  an internal cache variable ``<variable>``. If ``<location>`` is empty string,
-  default directories are searched.
+  This command attempts to link a test executable that uses the specified
+  C ``<function>`` to verify that it is provided by either a system or
+  user-provided ``<library>``.
 
-Prefer using :module:`CheckSymbolExists` or :module:`CheckSourceCompiles`
-instead of this module for more robust detection if a function is available in
-a library.
+  The arguments are:
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+  ``<library>``
+    The name of the library, a full path to a library file, or an
+    :ref:`Imported Target <Imported Targets>`.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  ``<function>``
+    The name of a function that should be available in the system or
+    user-provided library ``<library>``.
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  ``<location>``
+    The directory containing the library file.  It is added to the link
+    search path during the check.  If this is an empty string, only the
+    default library search paths are used.
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  ``<variable>``
+    The name of the variable in which to store the check result.  This
+    variable will be created as an internal cache variable.
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. note::
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+    This command is intended for performing basic sanity checks to verify
+    that a library provides the expected functionality, or that the correct
+    library is being located.  However, it only verifies that a function
+    symbol can be linked successfully - it does not ensure that the function
+    is declared in library headers, nor can it detect functions that are
+    inlined or defined as preprocessor macros.  For more robust detection
+    of function availability, prefer using :module:`CheckSymbolExists` or
+    :module:`CheckSourceCompiles`.
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. rubric:: Variables Affecting the Check
+
+  The following variables may be set before calling this command to modify
+  the way the check is run:
+
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
 
 Examples
 ^^^^^^^^
 
-This module can be useful for performing so-called sanity checks to verify that
-the specified library provides the expected functionality and is indeed the
-correct one being located.
-
-For example, to check if the ``curl`` library exists in the default paths and
-has the ``curl_easy_perform`` function:
+Checking if the ``curl`` library exists in the default paths and has the
+``curl_easy_perform()`` function:
 
 .. code-block:: cmake
 
@@ -60,8 +97,8 @@
   include(CheckLibraryExists)
   check_library_exists(curl curl_easy_perform "/opt/curl/lib" HAVE_LIBRARY_CURL)
 
-Also :ref:`IMPORTED library <add_library imported libraries>` (for example,
-from the ``find_package()`` call) can be used:
+Also :ref:`Imported Targets` (for example, from the ``find_package()`` call)
+can be used:
 
 .. code-block:: cmake
 
@@ -73,6 +110,11 @@
     include(CheckLibraryExists)
     check_library_exists(CURL::libcurl curl_easy_perform "" HAVE_LIBRARY_CURL)
   endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSymbolExists` module to check whether a C symbol exists.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckLinkerFlag.cmake b/Modules/CheckLinkerFlag.cmake
index ca37ab5..b17a96c 100644
--- a/Modules/CheckLinkerFlag.cmake
+++ b/Modules/CheckLinkerFlag.cmake
@@ -7,34 +7,143 @@
 
 .. versionadded:: 3.18
 
-Check whether the compiler supports a given link flag.
+This module provides a command to check whether a given link flag is
+supported by the compiler.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckLinkerFlag)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_linker_flag
 
+  Checks once whether the compiler supports a given link flag:
+
   .. code-block:: cmake
 
-    check_linker_flag(<lang> <flag> <var>)
+    check_linker_flag(<lang> <flag> <variable>)
 
-Check that the link ``<flag>`` is accepted by the ``<lang>`` compiler without
-a diagnostic.  Stores the result in an internal cache entry named ``<var>``.
+  This command checks once whether the linker flag ``<flag>`` is accepted
+  by the ``<lang>`` compiler without producing a diagnostic message.
 
-This command temporarily sets the ``CMAKE_REQUIRED_LINK_OPTIONS`` variable
-and calls the :command:`check_source_compiles` command from the
-:module:`CheckSourceCompiles` module.  See that module's documentation
-for a listing of variables that can otherwise modify the build.
+  The arguments are:
 
-The underlying implementation relies on the :prop_tgt:`LINK_OPTIONS` property
-to check the specified flag. The ``LINKER:`` prefix, as described in the
-:command:`target_link_options` command, can be used as well.
+  ``<lang>``
+    The language of the compiler used for the check.  Supported languages are
+    ``C``, ``CXX``, ``CUDA``, ``Fortran``, ``HIP``, ``OBJC``, ``OBJCXX``,
+    and ``Swift``.
 
-A positive result from this check indicates only that the compiler did not
-issue a diagnostic message when given the link flag.  Whether the flag has any
-effect or even a specific one is beyond the scope of this module.
+    .. versionadded:: 3.19
+      Support for ``CUDA`` language.
 
-.. note::
-  Since the :command:`try_compile` command forwards flags from variables
-  like :variable:`CMAKE_<LANG>_FLAGS`, unknown flags in such variables may
-  cause a false negative for this check.
+    .. versionadded:: 3.21
+      Support for ``HIP`` language.
+
+    .. versionadded:: 3.26
+      Support for ``Swift`` language.
+
+  ``<flag>``
+    Linker flag(s) to check.  Multiple flags can be specified in one
+    argument as a string using a :ref:`semicolon-separated list
+    <CMake Language Lists>`.
+
+    The underlying implementation uses the :prop_tgt:`LINK_OPTIONS` target
+    property to test the specified flag.  The ``LINKER:`` (and ``SHELL:``)
+    prefixes may be used, as described in the
+    `Handling Compiler Driver Differences`_ section.
+
+  ``<variable>``
+    The name of the variable to store the check result.  This variable will
+    be created as an internal cache variable.
+
+  This command temporarily sets the ``CMAKE_REQUIRED_LINK_OPTIONS`` variable
+  and calls the :command:`check_source_compiles` command from the
+  :module:`CheckSourceCompiles` module.
+
+  A successful result only indicates that the compiler did not report an
+  error when given the link flag.  Whether the flag has any effect, or the
+  intended one, is outside the scope of this module.
+
+  .. note::
+
+    Since the underlying :command:`try_compile` command also uses flags from
+    variables like :variable:`CMAKE_<LANG>_FLAGS`, unknown or unsupported
+    flags in those variables may result in a false negative for this check.
+
+  .. rubric:: Variables Affecting the Check
+
+  The following variables may be set before calling this command to modify
+  the way the check is run:
+
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+.. include:: /command/include/LINK_OPTIONS_LINKER.rst
+
+Examples
+^^^^^^^^
+
+Example: Checking Linker Flag
+"""""""""""""""""""""""""""""
+
+The following example shows how to use this module to check the ``-z relro``
+linker flag, which is supported on many Unix-like systems to enable read-only
+relocations for improved binary security.  If the flag is supported by the
+linker, it is conditionally added to the executable target using the
+:command:`target_link_options`.  The ``LINKER:`` prefix is used to pass the
+flag to the linker in a portable and compiler-independent way.
+
+.. code-block:: cmake
+
+  include(CheckLinkerFlag)
+
+  check_linker_flag(C "LINKER:-z,relro" HAVE_Z_RELRO)
+
+  add_executable(example main.c)
+
+  if(HAVE_Z_RELRO)
+    target_link_options(example PRIVATE "LINKER:-z,relro")
+  endif()
+
+Example: Checking Multiple Flags
+""""""""""""""""""""""""""""""""
+
+In the following example, multiple linker flags are checked simultaneously:
+
+.. code-block:: cmake
+
+  include(CheckLinkerFlag)
+
+  check_linker_flag(C "LINKER:-z,relro;LINKER:-z,now" HAVE_FLAGS)
+
+  add_executable(example main.c)
+
+  if(HAVE_FLAGS)
+    target_link_options(example PRIVATE LINKER:-z,relro LINKER:-z,now)
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :variable:`CMAKE_LINKER_TYPE` variable to specify the linker, which
+  will be used also by this module.
+* The :module:`CheckCompilerFlag` module to check whether a compiler flag
+  is supported.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckOBJCCompilerFlag.cmake b/Modules/CheckOBJCCompilerFlag.cmake
index 9d00d04..1f4c6ed 100644
--- a/Modules/CheckOBJCCompilerFlag.cmake
+++ b/Modules/CheckOBJCCompilerFlag.cmake
@@ -7,48 +7,95 @@
 
 .. versionadded:: 3.16
 
-Check once whether the Objective-C compiler supports a given flag.
+This module provides a command to check whether the Objective-C compiler
+supports a given flag.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckOBJCCompilerFlag)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_objc_compiler_flag
 
+  Checks once whether the Objective-C compiler supports a given flag:
+
   .. code-block:: cmake
 
-    check_objc_compiler_flag(<flag> <resultVar>)
+    check_objc_compiler_flag(<flag> <variable>)
 
-Check once that the ``<flag>`` is accepted by the compiler without a diagnostic.
-The result is stored in the internal cache variable specified by
-``<resultVar>``, with boolean ``true`` for success and boolean ``false`` for
-failure.
+  This command checks once that the ``<flag>`` is accepted by the ``OBJC``
+  compiler without producing a diagnostic message.  Multiple flags can be
+  specified in one argument as a string using a
+  :ref:`semicolon-separated list <CMake Language Lists>`.
 
-``true`` indicates only that the compiler did not issue a diagnostic message
-when given the flag. Whether the flag has any effect is beyond the scope of
-this module.
+  The result of the check is stored in the internal cache variable specified
+  by ``<variable>``, with boolean true for success and boolean false for
+  failure.
 
-Internally, :command:`try_compile` is used to perform the check. If
-:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-the check compiles and links an executable program. If set to
-``STATIC_LIBRARY``, the check is compiled but not linked.
+  A successful result only indicates that the compiler did not report an
+  error when given the flag.  Whether the flag has any effect, or the
+  intended one, is outside the scope of this module.
 
-See also :command:`check_compiler_flag` for a more general command syntax.
+  .. note::
 
-The compile and link commands can be influenced by setting any of the
-following variables prior to calling ``check_objc_compiler_flag()``. Unknown
-flags in these variables can case a false negative result.
+    Since the underlying :command:`try_compile` command also uses flags from
+    variables like :variable:`CMAKE_<LANG>_FLAGS`, unknown or unsupported
+    flags in those variables may result in a false negative for this check.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to use this module to check the
+Objective-C compiler flag ``-fobjc-arc``.  The result of the check is
+stored in the internal cache variable ``HAVE_OBJC_ARC``, and the flag is
+conditionally enabled using the :command:`target_compile_options` command.
+The :genex:`$<COMPILE_LANGUAGE:...> <COMPILE_LANGUAGE:languages>` generator
+expression ensures that the flag is added only to ``OBJC`` source files.
+
+.. code-block:: cmake
+
+  include(CheckOBJCCompilerFlag)
+  check_objc_compiler_flag(-fobjc-arc HAVE_OBJC_ARC)
+
+  if(HAVE_OBJC_ARC)
+    target_compile_options(
+      example
+      PRIVATE $<$<COMPILE_LANGUAGE:OBJC>:-fobjc-arc>
+    )
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckCompilerFlag` module for a more general command to check
+  whether a compiler flag is supported.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckOBJCSourceCompiles.cmake b/Modules/CheckOBJCSourceCompiles.cmake
index bea3de9..94d37f3 100644
--- a/Modules/CheckOBJCSourceCompiles.cmake
+++ b/Modules/CheckOBJCSourceCompiles.cmake
@@ -7,50 +7,96 @@
 
 .. versionadded:: 3.16
 
-Check once if Objective-C source can be built.
+This module provides a command to check whether an Objective-C source can
+be built.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckOBJCSourceCompiles)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_objc_source_compiles
 
+  Checks once whether the given Objective-C source code can be built:
+
   .. code-block:: cmake
 
-    check_objc_source_compiles(<code> <resultVar>
-                               [FAIL_REGEX <regex1> [<regex2>...]])
+    check_objc_source_compiles(<code> <variable> [FAIL_REGEX <regexes>...])
 
-  Check once that the source supplied in ``<code>`` can be built. The result is
-  stored in the internal cache variable specified by ``<resultVar>``, with
-  boolean ``true`` for success and boolean ``false`` for failure.
+  This command checks once that the source supplied in ``<code>`` can be
+  compiled (and linked into an executable).  The result of the check is
+  stored in the internal cache variable specified by ``<variable>``.
 
-  If ``FAIL_REGEX`` is provided, then failure is determined by checking
-  if anything in the compiler output matches any of the specified regular
-  expressions.
+  The arguments are:
 
-  Internally, :command:`try_compile` is used to compile the source. If
-  :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-  the source is compiled and linked as an executable program. If set to
-  ``STATIC_LIBRARY``, the source is compiled but not linked. In any case, all
-  functions must be declared as usual.
+  ``<code>``
+    Source code to check.  This must be an entire program, as written in a
+    file containing the body block.  All symbols used in the source code
+    are expected to be declared as usual in their corresponding headers.
 
-  See also :command:`check_source_compiles` for a more general command syntax.
+  ``<variable>``
+    Variable name of an internal cache variable to store the result of the
+    check, with boolean true for success and boolean false for failure.
 
-  See also :command:`check_source_runs` to run compiled source.
+  ``FAIL_REGEX <regexes>...``
+    If this option is provided with one or more regular expressions, then
+    failure is determined by checking if anything in the compiler output
+    matches any of the specified regular expressions.
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_objc_source_compiles()``
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+In the following example, this module is used to check whether the provided
+Objective-C source code compiles and links.  Result of the check is stored in
+the internal cache variable ``HAVE_WORKING_CODE``.
+
+.. code-block:: cmake
+
+  include(CheckOBJCSourceCompiles)
+
+  check_objc_source_compiles("
+    #import <Foundation/Foundation.h>
+    int main()
+    {
+      NSObject *foo;
+      return 0;
+    }
+  " HAVE_WORKING_CODE)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceCompiles` module for a more general command to
+  check whether source can be built.
+* The :module:`CheckSourceRuns` module to check whether source can be built
+  and run.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckOBJCSourceRuns.cmake b/Modules/CheckOBJCSourceRuns.cmake
index 1c33837..773c64a 100644
--- a/Modules/CheckOBJCSourceRuns.cmake
+++ b/Modules/CheckOBJCSourceRuns.cmake
@@ -7,43 +7,81 @@
 
 .. versionadded:: 3.16
 
-Check once if given Objective-C source compiles and links into an executable and
-can subsequently be run.
+This module provides a command to check whether an Objective-C source can
+be built and run.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckOBJCSourceRuns)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_objc_source_runs
 
+  Checks once whether the given Objective-C source code compiles and links
+  into an executable that can subsequently be run:
+
   .. code-block:: cmake
 
-    check_objc_source_runs(<code> <resultVar>)
+    check_objc_source_runs(<code> <variable>)
 
-  Check once that the source supplied in ``<code>`` can be built, linked as an
-  executable, and then run. The ``<code>`` must contain at least a ``main()``
-  function.
+  The Objective-C source supplied in ``<code>`` must contain at least a
+  ``main()`` function.  The result of the check is stored in the internal
+  cache variable specified by ``<variable>``.  If the code builds and runs
+  with exit code ``0``, success is indicated by a boolean true value.
+  Failure to build or run is indicated by a boolean false value, such as an
+  empty string or an error message.
 
-  The result is stored in the internal cache variable specified by
-  ``<resultVar>``. If the code builds and runs with exit code ``0``, success is
-  indicated by boolean ``true``. Failure to build or run is indicated by boolean
-  ``false``, such as an empty string or an error message.
+  .. rubric:: Variables Affecting the Check
 
-  See also :command:`check_source_runs` for a more general command syntax.
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_objc_source_runs()``
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+Examples
+^^^^^^^^
 
+In the following example, this module is used to check whether the provided
+Objective-C source code builds and runs.  Result of the check is stored in
+an internal cache variable ``HAVE_WORKING_CODE``.
+
+.. code-block:: cmake
+
+  include(CheckOBJCSourceRuns)
+
+  check_objc_source_runs("
+    #import <Foundation/Foundation.h>
+    int main()
+    {
+      NSObject *foo;
+      return 0;
+    }
+  " HAVE_WORKING_CODE)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceRuns` module for a more general command syntax.
+* The :module:`CheckSourceCompiles` module to check whether a source code
+  can be built.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckOBJCXXCompilerFlag.cmake b/Modules/CheckOBJCXXCompilerFlag.cmake
index a853475..d8ffe49 100644
--- a/Modules/CheckOBJCXXCompilerFlag.cmake
+++ b/Modules/CheckOBJCXXCompilerFlag.cmake
@@ -7,48 +7,95 @@
 
 .. versionadded:: 3.16
 
-Check once whether the Objective-C++ compiler supports a given flag.
+This module provides a command to check whether the Objective-C++ compiler
+supports a given flag.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckOBJCXXCompilerFlag)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_objcxx_compiler_flag
 
+  Checks once whether the Objective-C++ compiler supports a given flag:
+
   .. code-block:: cmake
 
-    check_objcxx_compiler_flag(<flag> <resultVar>)
+    check_objcxx_compiler_flag(<flag> <variable>)
 
-Check once that the ``<flag>`` is accepted by the compiler without a diagnostic.
-The result is stored in the internal cache variable specified by
-``<resultVar>``, with boolean ``true`` for success and boolean ``false`` for
-failure.
+  This command checks once that the ``<flag>`` is accepted by the ``OBJCXX``
+  compiler without producing a diagnostic message.  Multiple flags can be
+  specified in one argument as a string using a
+  :ref:`semicolon-separated list <CMake Language Lists>`.
 
-``true`` indicates only that the compiler did not issue a diagnostic message
-when given the flag. Whether the flag has any effect is beyond the scope of
-this module.
+  The result of the check is stored in the internal cache variable specified
+  by ``<variable>``, with boolean true for success and boolean false for
+  failure.
 
-Internally, :command:`try_compile` is used to perform the check. If
-:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-the check compiles and links an executable program. If set to
-``STATIC_LIBRARY``, the check is compiled but not linked.
+  A successful result only indicates that the compiler did not report an
+  error when given the flag.  Whether the flag has any effect, or the
+  intended one, is outside the scope of this module.
 
-See also :command:`check_compiler_flag` for a more general command syntax.
+  .. note::
 
-The compile and link commands can be influenced by setting any of the
-following variables prior to calling ``check_objcxx_compiler_flag()``. Unknown
-flags in these variables can case a false negative result.
+    Since the underlying :command:`try_compile` command also uses flags from
+    variables like :variable:`CMAKE_<LANG>_FLAGS`, unknown or unsupported
+    flags in those variables may result in a false negative for this check.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to use this module to check the
+Objective-C++ compiler flag ``-fobjc-arc``.  The result of the check is
+stored in the internal cache variable ``HAVE_OBJC_ARC``, and the flag is
+conditionally enabled using the :command:`target_compile_options` command.
+The :genex:`$<COMPILE_LANGUAGE:...> <COMPILE_LANGUAGE:languages>` generator
+expression ensures that the flag is added only to ``OBJCXX`` source files.
+
+.. code-block:: cmake
+
+  include(CheckOBJCXXCompilerFlag)
+  check_objcxx_compiler_flag(-fobjc-arc HAVE_OBJC_ARC)
+
+  if(HAVE_OBJC_ARC)
+  target_compile_options(
+      example
+      PRIVATE $<$<COMPILE_LANGUAGE:OBJCXX>:-fobjc-arc>
+    )
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckCompilerFlag` module for a more general command to check
+  whether a compiler flag is supported.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckOBJCXXSourceCompiles.cmake b/Modules/CheckOBJCXXSourceCompiles.cmake
index dd1a209..7d76f7b 100644
--- a/Modules/CheckOBJCXXSourceCompiles.cmake
+++ b/Modules/CheckOBJCXXSourceCompiles.cmake
@@ -7,50 +7,99 @@
 
 .. versionadded:: 3.16
 
-Check once if Objective-C++ source can be built.
+This module provides a command to check whether an Objective-C++ source can
+be built.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckOBJCXXSourceCompiles)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_objcxx_source_compiles
 
+  Checks once whether the given Objective-C++ source code can be built:
+
   .. code-block:: cmake
 
-    check_objcxx_source_compiles(<code> <resultVar>
-                                 [FAIL_REGEX <regex1> [<regex2>...]])
+    check_objcxx_source_compiles(<code> <variable> [FAIL_REGEX <regexes>...])
 
-  Check once that the source supplied in ``<code>`` can be built. The result is
-  stored in the internal cache variable specified by ``<resultVar>``, with
-  boolean ``true`` for success and boolean ``false`` for failure.
+  This command checks once that the source supplied in ``<code>`` can be
+  compiled (and linked into an executable).  The result of the check is
+  stored in the internal cache variable specified by ``<variable>``.
 
-  If ``FAIL_REGEX`` is provided, then failure is determined by checking
-  if anything in the compiler output matches any of the specified regular
-  expressions.
+  The arguments are:
 
-  Internally, :command:`try_compile` is used to compile the source. If
-  :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-  the source is compiled and linked as an executable program. If set to
-  ``STATIC_LIBRARY``, the source is compiled but not linked. In any case, all
-  functions must be declared as usual.
+  ``<code>``
+    Objective-C++ source code to check.  This must be an entire program, as
+    written in a file containing the body block.  All symbols used in the
+    source code are expected to be declared as usual in their corresponding
+    headers.
 
-  See also :command:`check_source_compiles` for a more general command syntax.
+  ``<variable>``
+    Variable name of an internal cache variable to store the result of the
+    check, with boolean true for success and boolean false for failure.
 
-  See also :command:`check_source_runs` to run compiled source.
+  ``FAIL_REGEX <regexes>...``
+    If this option is provided with one or more regular expressions, then
+    failure is determined by checking if anything in the compiler output
+    matches any of the specified regular expressions.
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_objcxx_source_compiles()``
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+In the following example, this module is used to check whether the provided
+Objective-C++ source code can be compiled and linked.  Result of the check
+is stored in the internal cache variable ``HAVE_WORKING_CODE``.
+
+.. code-block:: cmake
+
+  include(CheckOBJCXXSourceCompiles)
+
+  check_objcxx_source_compiles("
+    #include <vector>
+    #import <Foundation/Foundation.h>
+    int main()
+    {
+      std::vector<int> v;
+      NSObject *foo;
+      return 0;
+    }
+  " HAVE_WORKING_CODE)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceCompiles` module for a more general command to
+  check whether source can be built.
+* The :module:`CheckSourceRuns` module to check whether source can be built
+  and run.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckOBJCXXSourceRuns.cmake b/Modules/CheckOBJCXXSourceRuns.cmake
index 93ac155..209a73b 100644
--- a/Modules/CheckOBJCXXSourceRuns.cmake
+++ b/Modules/CheckOBJCXXSourceRuns.cmake
@@ -7,43 +7,83 @@
 
 .. versionadded:: 3.16
 
-Check once if given Objective-C++ source compiles and links into an executable
-and can subsequently be run.
+This module provides a command to check whether an Objective-C++ source can
+be built and run.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckOBJCXXSourceRuns)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_objcxx_source_runs
 
+  Checks once whether the given Objective-C++ source code compiles and links
+  into an executable that can subsequently be run:
+
   .. code-block:: cmake
 
-    check_objcxx_source_runs(<code> <resultVar>)
+    check_objcxx_source_runs(<code> <variable>)
 
-  Check once that the source supplied in ``<code>`` can be built, linked as an
-  executable, and then run. The ``<code>`` must contain at least a ``main()``
-  function.
+  The Objective-C++ source supplied in ``<code>`` must contain at least a
+  ``main()`` function.  The result of the check is stored in the internal
+  cache variable specified by ``<variable>``.  If the code builds and runs
+  with exit code ``0``, success is indicated by a boolean true value.
+  Failure to build or run is indicated by a boolean false value, such as an
+  empty string or an error message.
 
-  The result is stored in the internal cache variable specified by
-  ``<resultVar>``. If the code builds and runs with exit code ``0``, success is
-  indicated by boolean ``true``. Failure to build or run is indicated by boolean
-  ``false``, such as an empty string or an error message.
+  .. rubric:: Variables Affecting the Check
 
-  See also :command:`check_source_runs` for a more general command syntax.
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_objcxx_source_runs()``
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+Examples
+^^^^^^^^
 
+In the following example, this module is used to check whether the provided
+Objective-C++ source code builds and runs.  Result of the check is stored in
+an internal cache variable ``HAVE_WORKING_CODE``.
+
+.. code-block:: cmake
+
+  include(CheckOBJCXXSourceRuns)
+
+  check_objcxx_source_runs("
+    #include <vector>
+    #import <Foundation/Foundation.h>
+    int main()
+    {
+      std::vector<int> v;
+      NSObject *foo;
+      return 0;
+    }
+  " HAVE_WORKING_CODE)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceRuns` module for a more general command syntax.
+* The :module:`CheckSourceCompiles` module to check whether a source code
+  can be built.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
index 9922aec..592612c 100644
--- a/Modules/CheckPIESupported.cmake
+++ b/Modules/CheckPIESupported.cmake
@@ -7,10 +7,16 @@
 
 .. versionadded:: 3.14
 
-Check whether the linker supports Position Independent Code (PIE) or No
-Position Independent Code (NO_PIE) for executables.
-Use this to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
-property for executables will be honored at link time.
+This module provides the ``check_pie_supported()`` function to check whether the
+linker supports Position Independent Code (PIE) or No Position Independent Code
+(NO_PIE) for executables.
+
+When setting the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property,
+PIC-related compile and link options are added when building library objects,
+and PIE-related compile options are added when building objects of executable
+targets, regardless of this module.  Use this module to ensure that the
+``POSITION_INDEPENDENT_CODE`` target property for executables is also honored at
+link time.
 
 .. command:: check_pie_supported
 
@@ -36,14 +42,16 @@
 
       ``OBJC``, ``OBJCXX``, ``CUDA``, and ``HIP`` are supported.
 
-It makes no sense to use this module when :policy:`CMP0083` is set to ``OLD``,
-so the command will return an error in this case.  See policy :policy:`CMP0083`
-for details.
+  .. note::
+
+    To use ``check_pie_supported()``, policy :policy:`CMP0083` must be set to
+    ``NEW``; otherwise, a fatal error will occur.
 
 Variables
 ^^^^^^^^^
 
-For each language checked, two boolean cache variables are defined.
+For each language checked, the ``check_pie_supported()`` function defines two
+boolean cache variables:
 
  ``CMAKE_<lang>_LINK_PIE_SUPPORTED``
    Set to true if ``PIE`` is supported by the linker and false otherwise.
@@ -53,21 +61,44 @@
 Examples
 ^^^^^^^^
 
+To enable PIE on an executable target at link time as well, include this module
+and call ``check_pie_supported()`` before setting the
+``POSITION_INDEPENDENT_CODE`` target property.  This will determine whether the
+linker for each checked language supports PIE-related link options.  For
+example:
+
 .. code-block:: cmake
 
+  add_executable(foo ...)
+
+  include(CheckPIESupported)
   check_pie_supported()
   set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
 
+Since not all linkers require or support PIE-related link options (for example,
+``MSVC``), retrieving any error messages might be useful for logging purposes:
+
 .. code-block:: cmake
 
-  # Retrieve any error message.
+  add_executable(foo ...)
+
+  include(CheckPIESupported)
   check_pie_supported(OUTPUT_VARIABLE output LANGUAGES C)
   set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
   if(NOT CMAKE_C_LINK_PIE_SUPPORTED)
-    message(WARNING "PIE is not supported at link time: ${output}.\n"
+    message(WARNING "PIE is not supported at link time:\n${output}"
                     "PIE link options will not be passed to linker.")
   endif()
 
+Setting the ``POSITION_INDEPENDENT_CODE`` target property on an executable
+without this module will set PIE-related compile options but not PIE-related
+link options, which might not be sufficient in certain cases:
+
+.. code-block:: cmake
+
+  add_executable(foo ...)
+  set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+
 #]=======================================================================]
 
 
@@ -117,6 +148,9 @@
   set(CMAKE_REQUIRED_QUIET TRUE)
   set (outputs)
 
+  # Isolate the checks below from the project's PIC selection.
+  unset(CMAKE_POSITION_INDEPENDENT_CODE)
+
   foreach(lang IN LISTS CHECK_PIE_LANGUAGES)
     if(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER)
       if(NOT DEFINED CMAKE_${lang}_LINK_PIE_SUPPORTED)
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index 8854613..b1acaab 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -5,10 +5,24 @@
 CheckPrototypeDefinition
 ------------------------
 
-Check if a ``C`` function has the expected prototype.
+This module provides a command to check if a C function has the expected
+prototype.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckPrototypeDefinition)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_prototype_definition
 
+  Checks if a C function has the expected prototype:
+
   .. code-block:: cmake
 
     check_prototype_definition(<function> <prototype> <return> <headers> <variable>)
@@ -41,22 +55,24 @@
     <prototype> { return <return>; }
     int main(...) { ...<function>()... }
 
-The following variables may be set before calling this function to modify
-the way the check is run:
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
 
 Examples
 ^^^^^^^^
diff --git a/Modules/CheckSourceCompiles.cmake b/Modules/CheckSourceCompiles.cmake
index 97e3252..96246da 100644
--- a/Modules/CheckSourceCompiles.cmake
+++ b/Modules/CheckSourceCompiles.cmake
@@ -8,78 +8,194 @@
 
 .. versionadded:: 3.19
 
-Check once if source code can be built for a given language.
+This module provides a command that checks whether a source code can be
+built for a given language.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckSourceCompiles)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_source_compiles
 
-  .. code-block:: cmake
-
-    check_source_compiles(<lang> <code> <resultVar>
-                          [FAIL_REGEX <regex1> [<regex2>...]]
-                          [SRC_EXT <extension>])
-
-  Check once that the source supplied in ``<code>`` can be built for code
-  language ``<lang>``. The result is stored in the internal cache variable
-  specified by ``<resultVar>``, with boolean ``true`` for success and
-  boolean ``false`` for failure.
-
-  If ``FAIL_REGEX`` is provided, then failure is determined by checking
-  if anything in the compiler output matches any of the specified regular
-  expressions.
-
-  By default, the test source file will be given a file extension that matches
-  the requested language. The ``SRC_EXT`` option can be used to override this
-  with ``.<extension>`` instead.
-
-  The C example checks if the compiler supports the ``noreturn`` attribute:
+  Checks once whether the given source code can be built for the given
+  language:
 
   .. code-block:: cmake
 
+    check_source_compiles(
+      <lang>
+      <code>
+      <variable>
+      [FAIL_REGEX <regexes>...]
+      [SRC_EXT <extension>]
+    )
+
+  This command checks once that the source supplied in ``<code>`` can be
+  compiled (and linked into an executable) for code language ``<lang>``.
+  The result of the check is stored in the internal cache variable specified
+  by ``<variable>``.
+
+  The arguments are:
+
+  ``<lang>``
+    Language of the source code to check.  Supported languages are:
+    ``C``, ``CXX``, ``CUDA``, ``Fortran``, ``HIP``, ``ISPC``, ``OBJC``,
+    ``OBJCXX``, and ``Swift``.
+
+    .. versionadded:: 3.21
+      Support for ``HIP`` language.
+
+    .. versionadded:: 3.26
+      Support for ``Swift`` language.
+
+  ``<code>``
+    The source code to check.  This must be an entire program, as written
+    in a file containing the body block.  All symbols used in the source code
+    are expected to be declared as usual in their corresponding headers.
+
+  ``<variable>``
+    Variable name of an internal cache variable to store the result of the
+    check, with boolean true for success and boolean false for failure.
+
+  ``FAIL_REGEX <regexes>...``
+    If one or more regular expression patterns are provided, then failure is
+    determined by checking if anything in the compiler output matches any of
+    the specified regular expressions.
+
+  ``SRC_EXT <extension>``
+    By default, the internal test source file used for the check will be
+    given a file extension that matches the requested language (e.g., ``.c``
+    for C, ``.cxx`` for C++, ``.F90`` for Fortran, etc.).  This option can
+    be used to override this with the ``.<extension>`` instead.
+
+  .. rubric:: Variables Affecting the Check
+
+  The following variables may be set before calling this command to modify
+  the way the check is run:
+
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  .. include:: /module/include/CMAKE_TRY_COMPILE_TARGET_TYPE.rst
+
+Examples
+^^^^^^^^
+
+Example: Basic Usage
+""""""""""""""""""""
+
+The following example demonstrates how to check whether the C++ compiler
+supports a specific language feature using this module.  In this case, the
+check verifies if the compiler supports ``C++11`` lambda expressions.  The
+result is stored in the internal cache variable ``HAVE_CXX11_LAMBDAS``:
+
+.. code-block:: cmake
+
+  include(CheckSourceCompiles)
+
+  check_source_compiles(CXX "
+    int main()
+    {
+      auto lambda = []() { return 42; };
+      return lambda();
+    }
+  " HAVE_CXX11_LAMBDAS)
+
+Example: Checking Code With Bracket Argument
+""""""""""""""""""""""""""""""""""""""""""""
+
+The following example shows how to check whether the C compiler supports the
+``noreturn`` attribute.  Code is supplied using the :ref:`Bracket Argument`
+for easier embedded quotes handling:
+
+.. code-block:: cmake
+  :force:
+
+  include(CheckSourceCompiles)
+
+  check_source_compiles(C [[
+    #if !__has_c_attribute(noreturn)
+    #  error "No noreturn attribute"
+    #endif
+    int main(void) { return 0; }
+  ]] HAVE_NORETURN)
+
+Example: Performing a Check Without Linking
+"""""""""""""""""""""""""""""""""""""""""""
+
+In the following example, this module is used to perform a compile-only
+check of Fortran source code, whether the compiler supports the ``pure``
+procedure attribute:
+
+.. code-block:: cmake
+
+  include(CheckSourceCompiles)
+
+  block()
     set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
 
-    check_source_compiles(C
-    "#if !__has_c_attribute(noreturn)
-    #error \"No noreturn attribute\"
-    #endif"
-    HAVE_NORETURN)
+    check_source_compiles(
+      Fortran
+      "pure subroutine foo()
+      end subroutine"
+      HAVE_PURE
+    )
+  endblock()
 
-  The Fortran example checks if the compiler supports the ``pure`` procedure
-  attribute:
+Example: Isolated Check
+"""""""""""""""""""""""
 
-  .. code-block:: cmake
+In the following example, this module is used in combination with the
+:module:`CMakePushCheckState` module to modify required libraries when
+checking whether the PostgreSQL ``PGVerbosity`` enum contains
+``PQERRORS_SQLSTATE`` (available as of PostgreSQL version 12):
 
-    set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
+.. code-block:: cmake
 
-    check_source_compiles(Fortran
-    "pure subroutine foo()
-    end subroutine"
-    HAVE_PURE)
+  include(CheckSourceCompiles)
+  include(CMakePushCheckState)
 
-  Internally, :command:`try_compile` is used to compile the source. If
-  :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``EXECUTABLE`` (default),
-  the source is compiled and linked as an executable program. If set to
-  ``STATIC_LIBRARY``, the source is compiled but not linked. In any case, all
-  functions must be declared as usual.
+  find_package(PostgreSQL)
 
-  See also :command:`check_source_runs` to run compiled source.
+  if(TARGET PostgreSQL::PostgreSQL)
+    cmake_push_check_state(RESET)
+      set(CMAKE_REQUIRED_LIBRARIES PostgreSQL::PostgreSQL)
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_source_compiles()``:
+      check_source_compiles(C "
+        #include <libpq-fe.h>
+        int main(void)
+        {
+          PGVerbosity e = PQERRORS_SQLSTATE;
+          (void)e;
+          return 0;
+        }
+      " HAVE_PQERRORS_SQLSTATE)
+    cmake_pop_check_state()
+  endif()
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+See Also
+^^^^^^^^
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
-
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
-
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
-
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
-
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
-
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
-
+* The :module:`CheckSourceRuns` module to check whether the source code can
+  be built and also run.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckSourceRuns.cmake b/Modules/CheckSourceRuns.cmake
index 7a18a4a..0874a1f 100644
--- a/Modules/CheckSourceRuns.cmake
+++ b/Modules/CheckSourceRuns.cmake
@@ -8,64 +8,186 @@
 
 .. versionadded:: 3.19
 
-Check if given source compiles and links into an executable and can
-subsequently be run.
+This module provides a command to check whether a source code can be built
+and run.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckSourceRuns)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_source_runs
 
-  .. code-block:: cmake
-
-    check_source_runs(<lang> <code> <resultVar>
-                      [SRC_EXT <extension>])
-
-  Check once that the ``<lang>`` source supplied in ``<code>`` can be built,
-  linked as an executable, and then run. The ``<code>`` must contain at least
-  a ``main()`` function, or in Fortran a ``program``.
-
-  The result is stored in the internal cache variable specified by
-  ``<resultVar>``. If the code builds and runs with exit code ``0``, success is
-  indicated by boolean ``true``. Failure to build or run is indicated by boolean
-  ``false``, such as an empty string or an error message.
-
-  By default, the test source file will be given a file extension that matches
-  the requested language. The ``SRC_EXT`` option can be used to override this
-  with ``.<extension>`` instead.
-
-  The ``<code>`` must contain a valid main program. For example:
+  Checks once whether the given source code compiles and links into an
+  executable that can subsequently be run:
 
   .. code-block:: cmake
 
-    check_source_runs(C
-    "#include <stdlib.h>
+    check_source_runs(<lang> <code> <variable> [SRC_EXT <extension>])
+
+  This command checks once that the ``<lang>`` source code supplied in
+  ``<code>`` can be built, linked as an executable, and then run.  The
+  result of the check is stored in the internal cache variable specified by
+  ``<variable>``.
+
+  The arguments are:
+
+  ``<lang>``
+    The programming language of the source ``<code>`` to check.  Supported
+    languages are: ``C``, ``CXX``, ``CUDA``, ``Fortran``, ``HIP``, ``OBJC``,
+    and ``OBJCXX``.
+
+    .. versionadded:: 3.21
+      Support for ``HIP`` language.
+
+  ``<code>``
+    The source code to be tested.  It must contain a valid source program.
+    For example, it must contain at least a ``main()`` function (in C/C++),
+    or a ``program`` unit (in Fortran).
+
+  ``<variable>``
+    Name of the internal cache variable with the result of the check.  If
+    the code builds and runs with exit code ``0``, success is indicated by
+    a boolean true value.  Failure to build or run is indicated by a boolean
+    false value, such as an empty string or an error message.
+
+  ``SRC_EXT <extension>``
+    By default, the internal test source file used for the check will be
+    given a file extension that matches the requested language (e.g., ``.c``
+    for C, ``.cxx`` for C++, ``.F90`` for Fortran, etc.).  This option can
+    be used to override this with the ``.<extension>`` instead.
+
+  .. rubric:: Variables Affecting the Check
+
+  The following variables may be set before calling this command to modify
+  the way the check is run:
+
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+Examples
+^^^^^^^^
+
+Example: Basic Usage
+""""""""""""""""""""
+
+The following example demonstrates how to use this module to check whether
+the C source code is supported and operational at runtime.  The result of
+the check is stored in the internal cache variable ``HAVE_NORETURN``.
+
+.. code-block:: cmake
+
+  include(CheckSourceRuns)
+
+  check_source_runs(C "
+    #include <stdlib.h>
     #include <stdnoreturn.h>
     noreturn void f(){ exit(0); }
-    int main(void) { f(); return 1; }"
-    HAVE_NORETURN)
+    int main(void) { f(); return 1; }
+  " HAVE_NORETURN)
 
-    check_source_runs(Fortran
-    "program test
+Example: Checking Fortran Code
+""""""""""""""""""""""""""""""
+
+Checking if Fortran source code runs successfully:
+
+.. code-block:: cmake
+
+  include(CheckSourceRuns)
+
+  check_source_runs(Fortran "
+    program test
     real :: x[*]
     call co_sum(x)
-    end program"
-    HAVE_COARRAY)
+    end program
+  " HAVE_COARRAY)
 
-  The compile and link commands can be influenced by setting any of the
-  following variables prior to calling ``check_source_runs()``
+Example: Checking C++ Code With Bracket Argument
+""""""""""""""""""""""""""""""""""""""""""""""""
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+The following example demonstrates how to check whether the C++ standard
+library is functional and ``std::vector`` works at runtime.  If the source
+compiles, links, and runs successfully, internal cache variable
+``HAVE_WORKING_STD_VECTOR`` will be set to boolean true value.  Code is
+supplied using :ref:`Bracket Argument` for easier embedded quotes handling:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+.. code-block:: cmake
+  :force:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  include(CheckSourceRuns)
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  check_source_runs(CXX [[
+    #include <iostream>
+    #include <vector>
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+    int main()
+    {
+      std::vector<int> v = {1, 2, 3};
+      if (v.size() != 3) return 1;
+      std::cout << "Vector works correctly." << std::endl;
+      return 0;
+    }
+  ]] HAVE_WORKING_STD_VECTOR)
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+Example: Isolated Check
+"""""""""""""""""""""""
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+In the following example, this module is used in combination with the
+:module:`CMakePushCheckState` module to modify required compile definitions
+and libraries when checking whether the C function ``sched_getcpu()`` is
+supported and operational at runtime.  For example, on some systems, the
+``sched_getcpu()`` function may be available at compile time but not actually
+implemented by the kernel.  In such cases, it returns ``-1`` and sets
+``errno`` to ``ENOSYS``.  This check verifies that ``sched_getcpu()`` runs
+successfully and stores a boolean result in the internal cache variable
+``HAVE_SCHED_GETCPU``.
 
+.. code-block:: cmake
+
+  include(CheckSourceRuns)
+  include(CMakePushCheckState)
+
+  cmake_push_check_state(RESET)
+    set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+
+    if(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
+      set(CMAKE_REQUIRED_LIBRARIES gnu)
+    endif()
+
+    check_source_runs(C "
+      #include <sched.h>
+      int main(void)
+      {
+        if (sched_getcpu() == -1) {
+          return 1;
+        }
+        return 0;
+      }
+    " HAVE_SCHED_GETCPU)
+  cmake_pop_check_state()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSourceCompiles` module to check whether a source code
+  can be built.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index f1d39bd..0b87ee0 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -5,19 +5,39 @@
 CheckStructHasMember
 --------------------
 
-Check if the given struct or class has the specified member variable
+This module provides a command to check whether a struct or class has a
+specified member variable.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckStructHasMember)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_struct_has_member
 
+  Checks once if the given struct or class has the specified member variable:
+
   .. code-block:: cmake
 
-    check_struct_has_member(<struct> <member> <headers> <variable>
-                            [LANGUAGE <language>])
+    check_struct_has_member(
+      <struct>
+      <member>
+      <headers>
+      <variable>
+      [LANGUAGE <language>]
+    )
 
-  Check that the struct or class ``<struct>`` has the specified ``<member>``
-  after including the given header(s) ``<headers>`` where the prototype should
-  be declared. Specify the list of header files in one argument as a
-  semicolon-separated list. The result is stored in an internal cache variable
+  This command checks once whether the struct or class ``<struct>`` contains
+  the specified ``<member>`` after including the given header(s) ``<headers>``
+  where the prototype should be declared.  Multiple header files can be
+  specified in one argument as a string using a :ref:`semicolon-separated list
+  <CMake Language Lists>`.  The result is stored in an internal cache variable
   ``<variable>``.
 
   The options are:
@@ -27,32 +47,88 @@
     Acceptable values are ``C`` and ``CXX``.
     If not specified, it defaults to ``C``.
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
 
-Example
-^^^^^^^
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+Examples
+^^^^^^^^
+
+Example: Checking C Struct Member
+"""""""""""""""""""""""""""""""""
+
+In the following example, this module checks if the C struct ``timeval`` has
+a member variable ``tv_sec`` after including the ``<sys/select.h>`` header.
+The result of the check is stored in the internal cache variable
+``HAVE_TIMEVAL_TV_SEC``.
 
 .. code-block:: cmake
 
   include(CheckStructHasMember)
 
-  check_struct_has_member("struct timeval" tv_sec sys/select.h
-                          HAVE_TIMEVAL_TV_SEC LANGUAGE C)
+  check_struct_has_member(
+    "struct timeval"
+    tv_sec
+    sys/select.h
+    HAVE_TIMEVAL_TV_SEC
+  )
+
+Example: Checking C++ Struct Member
+"""""""""""""""""""""""""""""""""""
+
+In the following example, this module checks if the C++ struct ``std::tm``
+has a member variable ``tm_gmtoff`` after including the ``<ctime>`` header.
+The result of the check is stored in the internal cache variable
+``HAVE_TM_GMTOFF``.
+
+.. code-block:: cmake
+
+  include(CheckStructHasMember)
+
+  check_struct_has_member(
+    std::tm
+    tm_gmtoff
+    ctime
+    HAVE_TM_GMTOFF
+    LANGUAGE CXX
+  )
+
+Example: Isolated Check With Compile Definitions
+""""""""""""""""""""""""""""""""""""""""""""""""
+
+In the following example, the check is performed with temporarily modified
+compile definitions using the :module:`CMakePushCheckState` module:
+
+.. code-block:: cmake
+
+  include(CheckStructHasMember)
+  include(CMakePushCheckState)
+
+  cmake_push_check_state(RESET)
+    set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+
+    check_struct_has_member(
+      "struct utsname"
+      domainname
+      sys/utsname.h
+      HAVE_UTSNAME_DOMAINNAME
+    )
+  cmake_pop_check_state()
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 6d9301c..46d1ab3 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -5,47 +5,73 @@
 CheckSymbolExists
 -----------------
 
-Provides a macro to check if a symbol exists as a function, variable,
-or macro in ``C``.
+This module provides a command to check whether a C symbol exists.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckSymbolExists)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_symbol_exists
 
+  Checks once whether a symbol exists as a function, variable, or preprocessor
+  macro in C:
+
   .. code-block:: cmake
 
-    check_symbol_exists(<symbol> <files> <variable>)
+    check_symbol_exists(<symbol> <headers> <variable>)
 
-  Check that the ``<symbol>`` is available after including given header
-  ``<files>`` and store the result in a ``<variable>``.  Specify the list
-  of files in one argument as a semicolon-separated list.
-  ``<variable>`` will be created as an internal cache variable.
+  This command checks whether the ``<symbol>`` is available after including
+  the specified header file(s) ``<headers>``, and stores the result in the
+  internal cache variable ``<variable>``.  Multiple header files can be
+  specified in one argument as a string using a
+  :ref:`semicolon-separated list <CMake Language Lists>`.
 
-If the header files define the symbol as a macro it is considered
-available and assumed to work.  If the header files declare the symbol
-as a function or variable then the symbol must also be available for
-linking (so intrinsics may not be detected).
-If the symbol is a type, enum value, or intrinsic it will not be recognized
-(consider using :module:`CheckTypeSize` or :module:`CheckSourceCompiles`).
-If the check needs to be done in C++, consider using
-:module:`CheckCXXSymbolExists` instead.
+  If the header files define the symbol as a macro, it is considered
+  available and assumed to work.  If the symbol is declared as a function
+  or variable, the check also ensures that it links successfully
+  (i.e., the symbol must exist in a linked library or object file).
+  Compiler intrinsics may not be detected, as they are not always linkable
+  or explicitly declared in headers.
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+  Symbols that are types, enum values, or compiler intrinsics are not
+  recognized.  For those, consider using the :module:`CheckTypeSize` or
+  :module:`CheckSourceCompiles` module instead.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  This command is intended to check symbols as they appear in C.  For C++
+  symbols, use the :module:`CheckCXXSymbolExists` module instead.
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
-For example:
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how to check for the presence of a
+preprocessor macro ``SEEK_SET`` and the C function ``fopen()`` from
+the ``<stdio.h>`` header using this module:
 
 .. code-block:: cmake
 
@@ -53,8 +79,15 @@
 
   # Check for macro SEEK_SET
   check_symbol_exists(SEEK_SET "stdio.h" HAVE_SEEK_SET)
+
   # Check for function fopen
   check_symbol_exists(fopen "stdio.h" HAVE_FOPEN)
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckCXXSymbolExists` module to check whether a C++ symbol
+  exists.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index c733aae..9643d87 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -5,85 +5,110 @@
 CheckTypeSize
 -------------
 
-Check sizeof a type
+This module provides a command to check the size of a C/C++ type or expression.
 
-.. command:: check_type_size
-
-  .. code-block:: cmake
-
-    check_type_size(<type> <variable> [BUILTIN_TYPES_ONLY]
-                                      [LANGUAGE <language>])
-
-  Check if the type exists and determine its size.  Results are reported
-  in the following variables:
-
-  ``HAVE_<variable>``
-    Holds a true or false value indicating whether the type exists.
-
-  ``<variable>``
-    Holds one of the following values:
-
-    ``<size>``
-       Type has non-zero size ``<size>``.
-
-    ``0``
-       Type has architecture-dependent size.  This may occur when
-       :variable:`CMAKE_OSX_ARCHITECTURES` has multiple architectures.
-       In this case ``<variable>_CODE`` contains C preprocessor tests
-       mapping from each architecture macro to the corresponding type size.
-       The list of architecture macros is stored in ``<variable>_KEYS``,
-       and the value for each key is stored in ``<variable>-<key>``.
-
-    "" (empty string)
-       Type does not exist.
-
-  ``<variable>_CODE``
-    Holds C preprocessor code to define the macro ``<variable>`` to the size
-    of the type, or to leave the macro undefined if the type does not exist.
-
-  The options are:
-
-  ``BUILTIN_TYPES_ONLY``
-
-    Support only compiler-builtin types.  If *not* given, the macro checks
-    for headers ``<sys/types.h>``, ``<stdint.h>``, and ``<stddef.h>``, and
-    saves results in ``HAVE_SYS_TYPES_H``, ``HAVE_STDINT_H``, and
-    ``HAVE_STDDEF_H``.  The type size check automatically includes the
-    available headers, thus supporting checks of types defined in the headers.
-
-  ``LANGUAGE <language>``
-    Use the ``<language>`` compiler to perform the check.
-    Acceptable values are ``C`` and ``CXX``.
-    If not specified, it defaults to ``C``.
-
-Despite the name of the macro you may use it to check the size of more
-complex expressions, too.  To check e.g.  for the size of a struct
-member you can do something like this:
+Load this module in a CMake project with:
 
 .. code-block:: cmake
 
-  check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
+  include(CheckTypeSize)
 
+Commands
+^^^^^^^^
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+This module provides the following command:
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+.. command:: check_type_size
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  Checks once whether the C/C++ type or expression exists and determines its
+  size:
 
-.. include:: /module/CMAKE_REQUIRED_INCLUDES.txt
+  .. code-block:: cmake
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+    check_type_size(<type> <variable> [BUILTIN_TYPES_ONLY] [LANGUAGE <language>])
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  The arguments are:
 
-.. include:: /module/CMAKE_REQUIRED_LINK_DIRECTORIES.txt
+  ``<type>``
+    The type or expression being checked.
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  ``<variable>``
+    The name of the variable and a prefix used for storing the check results.
 
-``CMAKE_EXTRA_INCLUDE_FILES``
-  list of extra headers to include.
+  ``BUILTIN_TYPES_ONLY``
+    If given, only compiler-builtin types will be supported in the check.
+    If *not* given, the command checks for common headers ``<sys/types.h>``,
+    ``<stdint.h>``, and ``<stddef.h>``, and saves results in
+    ``HAVE_SYS_TYPES_H``, ``HAVE_STDINT_H``, and ``HAVE_STDDEF_H`` internal
+    cache variables.  The type size check automatically includes the available
+    headers, thus supporting checks of types defined in the headers.
+
+  ``LANGUAGE <language>``
+    Uses the ``<language>`` compiler to perform the check.
+    Acceptable values are ``C`` and ``CXX``.
+    If not specified, it defaults to ``C``.
+
+  .. rubric:: Result Variables
+
+  Results are reported in the following variables:
+
+  ``HAVE_<variable>``
+    Internal cache variable that holds a boolean true or false value
+    indicating whether the type or expression ``<type>`` exists.
+
+  ``<variable>``
+    Internal cache variable that holds one of the following values:
+
+    ``<size>``
+      If the type or expression exists, it will have a non-zero size
+      ``<size>`` in bytes.
+
+    ``0``
+      When type has architecture-dependent size;  This may occur when
+      :variable:`CMAKE_OSX_ARCHITECTURES` has multiple architectures.
+      In this case ``<variable>_CODE`` contains preprocessor tests
+      mapping from each architecture macro to the corresponding type size.
+      The list of architecture macros is stored in ``<variable>_KEYS``,
+      and the value for each key is stored in ``<variable>-<key>``.
+
+    "" (empty string)
+      When type or expression does not exist.
+
+  ``<variable>_CODE``
+    CMake variable that holds preprocessor code to define the macro
+    ``<variable>`` to the size of the type, or to leave the macro undefined
+    if the type does not exist.
+
+  Despite the name of this command, it may also be used to determine the size
+  of more complex expressions.  For example, to check the size of a struct
+  member:
+
+  .. code-block:: cmake
+
+    check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
+
+  .. rubric:: Variables Affecting the Check
+
+  The following variables may be set before calling this command to modify
+  the way the check is run:
+
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_INCLUDES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+  ``CMAKE_EXTRA_INCLUDE_FILES``
+    A :ref:`semicolon-separated list <CMake Language Lists>` of extra header
+    files to include when performing the check.
 
 Examples
 ^^^^^^^^
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index 25d871e..62a26fa 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -5,32 +5,103 @@
 CheckVariableExists
 -------------------
 
-Check if the variable exists.
+This module provides a command to check whether a C variable exists.
+
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(CheckVariableExists)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: check_variable_exists
 
+  Checks once if a C variable exists:
+
   .. code-block:: cmake
 
     check_variable_exists(<var> <variable>)
 
-  Check if the variable ``<var>`` exists and store the result in an internal
-  cache variable ``<variable>``.
+  This command attempts to compile and link a test C program that references
+  the specified C variable ``<var>``.  A boolean result of whether
+  the check was successful is stored in an internal cache variable
+  ``<variable>``.
 
-  This macro is only for ``C`` variables.
+  .. note::
 
-The following variables may be set before calling this macro to modify
-the way the check is run:
+    Prefer using :module:`CheckSymbolExists` or :module:`CheckSourceCompiles`
+    instead of this command for more robust detection.  This command performs
+    a link-only check and doesn't detect whether a variable is also declared
+    in system or library headers.  Neither can it detect variables that might
+    be defined as preprocessor macros.
 
-.. include:: /module/CMAKE_REQUIRED_FLAGS.txt
+  .. rubric:: Variables Affecting the Check
 
-.. include:: /module/CMAKE_REQUIRED_DEFINITIONS.txt
+  The following variables may be set before calling this command to modify
+  the way the check is run:
 
-.. include:: /module/CMAKE_REQUIRED_LINK_OPTIONS.txt
+  .. include:: /module/include/CMAKE_REQUIRED_FLAGS.rst
 
-.. include:: /module/CMAKE_REQUIRED_LIBRARIES.txt
+  .. include:: /module/include/CMAKE_REQUIRED_DEFINITIONS.rst
 
-.. include:: /module/CMAKE_REQUIRED_QUIET.txt
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_OPTIONS.rst
 
+  .. include:: /module/include/CMAKE_REQUIRED_LIBRARIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_LINK_DIRECTORIES.rst
+
+  .. include:: /module/include/CMAKE_REQUIRED_QUIET.rst
+
+Examples
+^^^^^^^^
+
+Example: Basic Usage
+""""""""""""""""""""
+
+In the following example, a check is performed whether the linker sees the
+C variable ``tzname`` and stores the check result in the
+``PROJECT_HAVE_TZNAME`` internal cache variable:
+
+.. code-block:: cmake
+
+  include(CheckVariableExists)
+
+  check_variable_exists(tzname PROJECT_HAVE_TZNAME)
+
+Example: Isolated Check With Linked Libraries
+"""""""""""""""""""""""""""""""""""""""""""""
+
+In the following example, this module is used in combination with the
+:module:`CMakePushCheckState` module to link additional required library
+using the ``CMAKE_REQUIRED_LIBRARIES`` variable.  For example, in a find
+module, to check whether the Net-SNMP library has the
+``usmHMAC192SHA256AuthProtocol`` array:
+
+.. code-block:: cmake
+
+  include(CheckVariableExists)
+  include(CMakePushCheckState)
+
+  find_library(SNMP_LIBRARY NAMES netsnmp)
+
+  if(SNMP_LIBRARY)
+    cmake_push_check_state(RESET)
+
+    set(CMAKE_REQUIRED_LIBRARIES ${SNMP_LIBRARY})
+
+    check_variable_exists(usmHMAC192SHA256AuthProtocol SNMP_HAVE_SHA256)
+
+    cmake_pop_check_state()
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`CheckSymbolExists` module to check whether a C symbol exists.
 #]=======================================================================]
 
 include_guard(GLOBAL)
diff --git a/Modules/Compiler/ADSP.cmake b/Modules/Compiler/ADSP.cmake
index 6af58d1..a9cae9f 100644
--- a/Modules/Compiler/ADSP.cmake
+++ b/Modules/Compiler/ADSP.cmake
@@ -18,10 +18,10 @@
     "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
 
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
-    "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} -build-lib -o <TARGET> <CMAKE_${lang}_LINK_FLAGS> <OBJECTS>")
+    "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} -build-lib -o <TARGET> <OBJECTS>")
 
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
   unset(_CMAKE_${lang}_ADSP_FLAGS)
 
diff --git a/Modules/Compiler/ARMCC.cmake b/Modules/Compiler/ARMCC.cmake
index ba64c28..702ea07 100644
--- a/Modules/Compiler/ARMCC.cmake
+++ b/Modules/Compiler/ARMCC.cmake
@@ -32,7 +32,7 @@
 
   set(CMAKE_${lang}_LINK_MODE LINKER)
 
-  set(CMAKE_${lang}_LINK_EXECUTABLE      "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --list <TARGET_BASE>.map")
+  set(CMAKE_${lang}_LINK_EXECUTABLE      "<CMAKE_LINKER> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --list <TARGET_BASE>.map")
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
 
   set(CMAKE_DEPFILE_FLAGS_${lang} "--depend=<DEP_FILE> --depend_single_line --no_depend_system_headers")
diff --git a/Modules/Compiler/ARMClang.cmake b/Modules/Compiler/ARMClang.cmake
index f85da96..89a523b 100644
--- a/Modules/Compiler/ARMClang.cmake
+++ b/Modules/Compiler/ARMClang.cmake
@@ -132,7 +132,7 @@
   else()
     set(__CMAKE_ARMClang_USING_armlink_WRAPPER "-Xlinker")
   endif()
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> ${__CMAKE_ARMClang_USING_armlink_WRAPPER}")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> ${__CMAKE_ARMClang_USING_armlink_WRAPPER}")
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
   set(CMAKE_${lang}_ARCHIVE_CREATE         "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
   set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "${__CMAKE_ARMClang_USING_armlink_WRAPPER} --via=")
diff --git a/Modules/Compiler/Apple-Swift.cmake b/Modules/Compiler/Apple-Swift.cmake
new file mode 100644
index 0000000..190165a
--- /dev/null
+++ b/Modules/Compiler/Apple-Swift.cmake
@@ -0,0 +1,3 @@
+if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0)
+  set(CMAKE_Swift_COMPILE_OPTIONS_WARNING_AS_ERROR -warnings-as-errors)
+endif()
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 2df31de..24b7157 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -78,6 +78,18 @@
   endif()
 
   set(CMAKE_C_STANDARD_LATEST 17)
+
+  if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 18.0)
+    # This version of clang-cl does not have a -std:c23 flag.
+    # Pass the standard through to the underlying clang directly.
+    # Note that cmVisualStudio10TargetGenerator::ComputeClOptions
+    # has a special case to map this back to -std:clatest in .vcxproj
+    # files that also have CXX sources.
+    set(CMAKE_C23_STANDARD_COMPILE_OPTION "-clang:-std=c23")
+    set(CMAKE_C23_EXTENSION_COMPILE_OPTION "-clang:-std=c23")
+
+    set(CMAKE_C_STANDARD_LATEST 23)
+  endif()
 endif()
 
 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 2.1)
diff --git a/Modules/Compiler/Clang-CUDA.cmake b/Modules/Compiler/Clang-CUDA.cmake
index c95615b..e563a28 100644
--- a/Modules/Compiler/Clang-CUDA.cmake
+++ b/Modules/Compiler/Clang-CUDA.cmake
@@ -29,8 +29,8 @@
 set(CMAKE_CUDA_DEVICE_LINK_MODE DRIVER)
 
 # RulePlaceholderExpander expands crosscompile variables like sysroot and target only for CMAKE_<LANG>_COMPILER. Override the default.
-set(CMAKE_CUDA_LINK_EXECUTABLE "<CMAKE_CUDA_COMPILER> <FLAGS> <CMAKE_CUDA_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
-set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_COMPILER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+set(CMAKE_CUDA_LINK_EXECUTABLE "<CMAKE_CUDA_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_COMPILER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
 
 set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "STATIC")
 set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static")
diff --git a/Modules/Compiler/Clang-HIP.cmake b/Modules/Compiler/Clang-HIP.cmake
index 92925f1..6da57ec 100644
--- a/Modules/Compiler/Clang-HIP.cmake
+++ b/Modules/Compiler/Clang-HIP.cmake
@@ -9,7 +9,7 @@
 if(NOT "x${CMAKE_HIP_SIMULATE_ID}" STREQUAL "xMSVC")
   set(CMAKE_HIP_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 
-  string(APPEND CMAKE_HIP_FLAGS_DEBUG_INIT " -O")
+  string(APPEND CMAKE_HIP_FLAGS_DEBUG_INIT " -g")
 endif()
 
 set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "SHARED")
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index 8bdc982..880a76e 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -113,7 +113,6 @@
   __cmake_craype_setupenv()
 
   # Flags for the Cray wrappers
-  set(CMAKE_STATIC_LIBRARY_LINK_${lang}_FLAGS "-static")
   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
   set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-dynamic")
 
diff --git a/Modules/Compiler/Diab-ASM.cmake b/Modules/Compiler/Diab-ASM.cmake
new file mode 100644
index 0000000..ccc8cb6
--- /dev/null
+++ b/Modules/Compiler/Diab-ASM.cmake
@@ -0,0 +1,3 @@
+include(Compiler/Diab)
+
+__compiler_diab(ASM)
diff --git a/Modules/Compiler/Diab-C.cmake b/Modules/Compiler/Diab-C.cmake
new file mode 100644
index 0000000..0fd5345
--- /dev/null
+++ b/Modules/Compiler/Diab-C.cmake
@@ -0,0 +1,9 @@
+include(Compiler/Diab)
+
+__compiler_diab(C)
+
+# c89/90 is both -Xdialect-c89
+set(CMAKE_C89_STANDARD_COMPILE_OPTION "-Xdialect-c89")
+set(CMAKE_C90_STANDARD_COMPILE_OPTION "-Xdialect-c89")
+set(CMAKE_C99_STANDARD_COMPILE_OPTION "-Xdialect-c99")
+set(CMAKE_C11_STANDARD_COMPILE_OPTION "-Xdialect-c11")
diff --git a/Modules/Compiler/Diab-CXX.cmake b/Modules/Compiler/Diab-CXX.cmake
new file mode 100644
index 0000000..a8a17c5
--- /dev/null
+++ b/Modules/Compiler/Diab-CXX.cmake
@@ -0,0 +1,12 @@
+include(Compiler/Diab)
+
+__compiler_diab(CXX)
+
+# Diab C++98 is named as -Xdialect-c++03
+set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-Xdialect-c++03")
+set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-Xdialect-c++11")
+set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-Xdialect-c++14")
+set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-Xdialect-c++17")
+set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-Xdialect-c++20")
+
+__compiler_check_default_language_standard(CXX 4.0 98 5.0 11)
diff --git a/Modules/Compiler/Diab-DetermineCompiler.cmake b/Modules/Compiler/Diab-DetermineCompiler.cmake
new file mode 100644
index 0000000..86518f5
--- /dev/null
+++ b/Modules/Compiler/Diab-DetermineCompiler.cmake
@@ -0,0 +1,10 @@
+# Diab Toolchain. Works only for versions 5.9.x or higher.
+set(_compiler_id_pp_test "defined(__DCC__) && defined(_DIAB_TOOL)")
+
+set(_compiler_id_version_compute "
+  # define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__VERSION_MAJOR_NUMBER__)
+  # define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__VERSION_MINOR_NUMBER__)
+  # define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__VERSION_ARCH_FEATURE_NUMBER__)
+  # define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__VERSION_BUG_FIX_NUMBER__)
+"
+)
diff --git a/Modules/Compiler/Diab-FindBinUtils.cmake b/Modules/Compiler/Diab-FindBinUtils.cmake
new file mode 100644
index 0000000..7ca00cb
--- /dev/null
+++ b/Modules/Compiler/Diab-FindBinUtils.cmake
@@ -0,0 +1,15 @@
+# Find the archiver for the compiler architecture, which is always in the same
+# directory as the compiler.
+if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
+  message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
+endif()
+
+get_filename_component(__diab_path "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
+
+find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR
+  NAMES dar
+  HINTS ${__diab_path}
+  NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH
+  DOC "Diab Archiver"
+)
+mark_as_advanced(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR)
diff --git a/Modules/Compiler/Diab.cmake b/Modules/Compiler/Diab.cmake
new file mode 100644
index 0000000..a8cfbfd
--- /dev/null
+++ b/Modules/Compiler/Diab.cmake
@@ -0,0 +1,33 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file LICENSE.rst or https://cmake.org/licensing for details.
+
+# This module is shared by multiple languages; use include blocker.
+if(__COMPILER_Diab)
+  return()
+endif()
+set(__COMPILER_Diab 1)
+
+include(Compiler/CMakeCommonCompilerMacros)
+
+macro(__compiler_diab lang)
+  set(CMAKE_${lang}_VERBOSE_FLAG "-#")
+  set(CMAKE_${lang}_OUTPUT_EXTENSION ".o")
+
+  string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+  string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -g")
+  string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -O -Xsize-opt")
+  string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -XO")
+  string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -XO -g3")
+
+  set(__DIAB_AR "${CMAKE_${lang}_COMPILER_AR}")
+  set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "\"${__DIAB_AR}\"  -r <TARGET> <LINK_FLAGS> <OBJECTS>")
+  set(CMAKE_${lang}_ARCHIVE_CREATE "\"${__DIAB_AR}\" -r <TARGET> <LINK_FLAGS> <OBJECTS>")
+
+  set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
+  set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
+  set(CMAKE_${lang}_COMPILE_OPTIONS_IPO -XO -Xwhole-program-optim)
+endmacro()
+
+set(CMAKE_EXECUTABLE_SUFFIX "")
+set(CMAKE_LIBRARY_PATH_TERMINATOR "")
+set(CMAKE_LIBRARY_PATH_FLAG "")
diff --git a/Modules/Compiler/GNU-ASM.cmake b/Modules/Compiler/GNU-ASM.cmake
index a935416..1acd0b0 100644
--- a/Modules/Compiler/GNU-ASM.cmake
+++ b/Modules/Compiler/GNU-ASM.cmake
@@ -8,6 +8,6 @@
 if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH STREQUAL "GNU assembler")
   set(CMAKE_DEPFILE_FLAGS_ASM${ASM_DIALECT} "--MD <DEP_FILE>")
   set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
-    "<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_LINKER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
   set(CMAKE_ASM_DEFINE_FLAG "--defsym ")
 endif()
diff --git a/Modules/Compiler/GNU-OBJCXX.cmake b/Modules/Compiler/GNU-OBJCXX.cmake
index e3006f2..cf28009 100644
--- a/Modules/Compiler/GNU-OBJCXX.cmake
+++ b/Modules/Compiler/GNU-OBJCXX.cmake
@@ -14,7 +14,3 @@
 if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 4.2)
   set(CMAKE_OBJCXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 endif()
-
-if(NOT CMAKE_OBJCXX_LINK_FLAGS)
-  set(CMAKE_OBCXX_LINK_FLAGS "-lstdc++")
-endif()
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 01420ba..97e1adb 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -39,7 +39,7 @@
   __compiler_iar_common(${lang})
 
   string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " --silent")
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
 
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS>")
   set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> <TARGET> --create <LINK_FLAGS> <OBJECTS>")
@@ -52,7 +52,7 @@
   __compiler_iar_common(${lang})
 
   string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -S")
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <OBJECTS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
 
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> <TARGET> <LINK_FLAGS> <OBJECTS>")
   set(CMAKE_${lang}_ARCHIVE_CREATE "<CMAKE_AR> <TARGET> <LINK_FLAGS> <OBJECTS>")
diff --git a/Modules/Compiler/NVHPC-C.cmake b/Modules/Compiler/NVHPC-C.cmake
index 3838ebd..51a62b6 100644
--- a/Modules/Compiler/NVHPC-C.cmake
+++ b/Modules/Compiler/NVHPC-C.cmake
@@ -3,6 +3,7 @@
 
 # Needed so that we support `LANGUAGE` property correctly
 set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c)
+set(CMAKE_C_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
 
 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
   set(CMAKE_C17_STANDARD_COMPILE_OPTION  -std=c17)
diff --git a/Modules/Compiler/NVHPC-CXX.cmake b/Modules/Compiler/NVHPC-CXX.cmake
index e849cbd..56daffb 100644
--- a/Modules/Compiler/NVHPC-CXX.cmake
+++ b/Modules/Compiler/NVHPC-CXX.cmake
@@ -3,6 +3,8 @@
 
 # Needed so that we support `LANGUAGE` property correctly
 set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++)
+set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
+set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
 
 if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 20.11)
   set(CMAKE_CXX20_STANDARD_COMPILE_OPTION  -std=c++20)
diff --git a/Modules/Compiler/NVIDIA-HIP.cmake b/Modules/Compiler/NVIDIA-HIP.cmake
index c888bc7..56394c5 100644
--- a/Modules/Compiler/NVIDIA-HIP.cmake
+++ b/Modules/Compiler/NVIDIA-HIP.cmake
@@ -10,5 +10,5 @@
 set(CMAKE_HIP_LINK_EXECUTABLE
   "<CMAKE_HIP_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
 set(CMAKE_HIP_CREATE_SHARED_LIBRARY
-  "<CMAKE_HIP_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_HIP_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+  "<CMAKE_HIP_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_HIP_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
 set(CMAKE_HIP_CREATE_SHARED_MODULE "${CMAKE_HIP_CREATE_SHARED_LIBRARY}")
diff --git a/Modules/Compiler/OpenWatcom.cmake b/Modules/Compiler/OpenWatcom.cmake
index e048bc8..987dff9 100644
--- a/Modules/Compiler/OpenWatcom.cmake
+++ b/Modules/Compiler/OpenWatcom.cmake
@@ -75,12 +75,16 @@
   "<CMAKE_LINKER> ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> option implib=<TARGET_IMPLIB> file {<OBJECTS>} <LINK_LIBRARIES>")
 # C++ create a shared library
 set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY})
+set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "")
+set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "")
 
 # C create a shared module
 set(CMAKE_C_CREATE_SHARED_MODULE
   "<CMAKE_LINKER> ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> file {<OBJECTS>} <LINK_LIBRARIES>")
 # C++ create a shared module
 set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_MODULE})
+set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "")
+set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "")
 
 # C create a static library
 set(CMAKE_C_CREATE_STATIC_LIBRARY
diff --git a/Modules/Compiler/OrangeC.cmake b/Modules/Compiler/OrangeC.cmake
index 71ed04c..69628b8 100644
--- a/Modules/Compiler/OrangeC.cmake
+++ b/Modules/Compiler/OrangeC.cmake
@@ -22,9 +22,9 @@
 
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
     "<CMAKE_${lang}_COMPILER> -! -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
-    "<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> -! <FLAGS> -o <TARGET> --out-implib <TARGET_IMPLIB> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
 
   set(CMAKE_LIBRARY_PATH_FLAG "-L")
diff --git a/Modules/Compiler/QCC-CXX.cmake b/Modules/Compiler/QCC-CXX.cmake
index 406e582..19a04af 100644
--- a/Modules/Compiler/QCC-CXX.cmake
+++ b/Modules/Compiler/QCC-CXX.cmake
@@ -16,7 +16,7 @@
 set(CMAKE_CXX_COMPILE_OBJECT
   "<CMAKE_CXX_COMPILER> ${_cmake_qcc_cxx_lang_compile_flag} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
 set(CMAKE_CXX_LINK_EXECUTABLE
-  "<CMAKE_CXX_COMPILER> ${_cmake_qcc_cxx_lang_link_flag} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+  "<CMAKE_CXX_COMPILER> ${_cmake_qcc_cxx_lang_link_flag} <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 unset(_cmake_qcc_cxx_lang_compile_flag)
 unset(_cmake_qcc_cxx_lang_link_flag)
 
diff --git a/Modules/Compiler/Renesas-ASM.cmake b/Modules/Compiler/Renesas-ASM.cmake
new file mode 100644
index 0000000..34ce638
--- /dev/null
+++ b/Modules/Compiler/Renesas-ASM.cmake
@@ -0,0 +1,13 @@
+
+include(Compiler/Renesas)
+__compiler_renesas(ASM)
+
+if(CMAKE_ASM_COMPILER_ARCHITECTURE_ID STREQUAL "RX")
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS src;SRC;s;S)
+elseif(CMAKE_ASM_COMPILER_ARCHITECTURE_ID STREQUAL "RL78")
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm;ASM;s;S)
+elseif(CMAKE_ASM_COMPILER_ARCHITECTURE_ID STREQUAL "RH850")
+  set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS asm;ASM;s;S)
+else()
+    message(FATAL_ERROR "Architecture for Renesas compiler: ${CMAKE_ASM_COMPILER_ARCHITECTURE_ID} is not supported.")
+endif()
diff --git a/Modules/Compiler/Renesas-C-FeatureTests.cmake b/Modules/Compiler/Renesas-C-FeatureTests.cmake
new file mode 100644
index 0000000..d2b27c6
--- /dev/null
+++ b/Modules/Compiler/Renesas-C-FeatureTests.cmake
@@ -0,0 +1,14 @@
+
+set(_cmake_oldestSupported "((__RENESAS_VERSION__ >> 24 & 0xFF)) >= 1")
+
+
+set(Renesas_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
+set(Renesas_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
+
+set(_cmake_feature_test_c_std_99 "${Renesas_C99}")
+set(_cmake_feature_test_c_restrict "${Renesas_C99}")
+set(_cmake_feature_test_c_variadic_macros "${Renesas_C99}")
+
+set(Renesas_C90 "${_cmake_oldestSupported}")
+set(_cmake_feature_test_c_std_90 "${Renesas_C90}")
+set(_cmake_feature_test_c_function_prototypes "${Renesas_C90}")
diff --git a/Modules/Compiler/Renesas-C.cmake b/Modules/Compiler/Renesas-C.cmake
new file mode 100644
index 0000000..34aaebc
--- /dev/null
+++ b/Modules/Compiler/Renesas-C.cmake
@@ -0,0 +1,10 @@
+
+include(Compiler/Renesas)
+__compiler_renesas(C)
+
+set(CMAKE_C90_STANDARD_COMPILE_OPTION "-lang=c")
+set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-lang=c")
+set(CMAKE_C99_STANDARD_COMPILE_OPTION "-lang=c99")
+set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-lang=c99")
+
+__compiler_check_default_language_standard(C 1.0 90)
diff --git a/Modules/Compiler/Renesas-CXX.cmake b/Modules/Compiler/Renesas-CXX.cmake
new file mode 100644
index 0000000..6b14374
--- /dev/null
+++ b/Modules/Compiler/Renesas-CXX.cmake
@@ -0,0 +1,3 @@
+
+include(Compiler/Renesas)
+__compiler_renesas(CXX)
diff --git a/Modules/Compiler/Renesas-DetermineCompiler.cmake b/Modules/Compiler/Renesas-DetermineCompiler.cmake
new file mode 100644
index 0000000..5da8f28
--- /dev/null
+++ b/Modules/Compiler/Renesas-DetermineCompiler.cmake
@@ -0,0 +1,7 @@
+set(_compiler_id_pp_test "defined(__RENESAS__)")
+
+set(_compiler_id_version_compute "
+/* __RENESAS_VERSION__ = 0xVVRRPP00 */
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__RENESAS_VERSION__ >> 24 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__RENESAS_VERSION__ >> 16 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__RENESAS_VERSION__ >> 8  & 0xFF)")
diff --git a/Modules/Compiler/Renesas.cmake b/Modules/Compiler/Renesas.cmake
new file mode 100644
index 0000000..7d57514
--- /dev/null
+++ b/Modules/Compiler/Renesas.cmake
@@ -0,0 +1,140 @@
+
+include_guard()
+
+include(Compiler/CMakeCommonCompilerMacros)
+
+macro(__compiler_renesas lang)
+
+  if(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID STREQUAL "RX")
+# CC-RX
+    # Pass directly include and define flag to the assembler.
+    if ("${lang}" STREQUAL "ASM")
+      set(_ASM_PREFIX "-asmopt=")
+    endif()
+    set(CMAKE_INCLUDE_FLAG_${lang} "${_ASM_PREFIX}-include=")
+    set(CMAKE_${lang}_DEFINE_FLAG "${_ASM_PREFIX}-define=")
+
+    set(CMAKE_LINK_LIBRARY_FLAG "-lnkopt=-library=")
+    set(CMAKE_${lang}_RESPONSE_FILE_FLAG "-subcommand=")
+    set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-lnkopt=" "")
+
+    set(_RENESAS_DEBUG_FLAG "-debug")
+    if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 3.02)
+      string(APPEND _RENESAS_DEBUG_FLAG " -g_line")
+    endif()
+
+    string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+    string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -optimize=0 ${_RENESAS_DEBUG_FLAG}")
+    string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG=1")
+    string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " ${_RENESAS_DEBUG_FLAG} ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG=1")
+    string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -size ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG=1")
+
+    set(_PREP_OUT "-output=prep=<PREPROCESSED_SOURCE>")
+    set(_ASM_OUT "-output=src=<ASSEMBLY_SOURCE>")
+    set(_OBJ_OUT "-output=obj=<OBJECT>")
+    set(_EXE_OUT "-output=abs=<TARGET>")
+    if ("${lang}" STREQUAL "ASM")
+      # Assembler dependency.
+      set(_DEP_OUT "${_ASM_PREFIX}-MM ${_ASM_PREFIX}-MT=<OBJECT> ${_ASM_PREFIX}-MF=<DEP_FILE>")
+    else()
+      # Compiler dependency.
+      set(_DEP_OUT "-MM -MT=<OBJECT> -output=dep=<DEP_FILE>")
+    endif()
+
+  elseif(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID STREQUAL "RL78")
+# CC-RL
+    # Pass directly include and define flag to the assembler.
+    if ("${lang}" STREQUAL "ASM")
+      set(_ASM_PREFIX "-asmopt=")
+      set(CMAKE_INCLUDE_FLAG_${lang} "${_ASM_PREFIX}-include=")
+      set(CMAKE_${lang}_DEFINE_FLAG "${_ASM_PREFIX}-define=")
+    endif()
+
+    set(CMAKE_LINK_LIBRARY_FLAG "-lnkopt=-library=")
+    set(CMAKE_${lang}_RESPONSE_FILE_FLAG "-subcommand=")
+    set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-lnkopt=" "")
+
+    set(_RENESAS_DEBUG_FLAG "-g")
+    if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 1.02)
+      string(APPEND _RENESAS_DEBUG_FLAG " -g_line")
+    endif()
+
+    string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+    string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -Onothing ${_RENESAS_DEBUG_FLAG}")
+    string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG")
+    string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " ${_RENESAS_DEBUG_FLAG} ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG")
+    string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Osize ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG")
+
+    set(_PREP_OUT "-P -o <PREPROCESSED_SOURCE>")
+    set(_ASM_OUT "-S -o <ASSEMBLY_SOURCE>")
+    set(_OBJ_OUT "-c -o <OBJECT>")
+    set(_EXE_OUT "-o <TARGET>")
+    set(_DEP_OUT "-M -MT=<OBJECT> -o <DEP_FILE>")
+    # Assembler dependency. -c is required to avoid to process to link
+    if ("${lang}" STREQUAL "ASM")
+      set(_DEP_OUT "-c ${_ASM_PREFIX}-MM ${_ASM_PREFIX}-MT=<OBJECT> ${_ASM_PREFIX}-MF=<DEP_FILE>")
+    endif()
+
+  elseif(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID STREQUAL "RH850")
+# CC-RH
+    set(CMAKE_LINK_LIBRARY_FLAG "-Xlk_option=-library=")
+    set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlk_option=" "")
+    # Pass directly include and define flag to the assembler.
+    if ("${lang}" STREQUAL "ASM")
+      set(_ASM_PREFIX "-Xasm_option=")
+      set(CMAKE_INCLUDE_FLAG_${lang} "${_ASM_PREFIX}-I")
+      set(CMAKE_${lang}_DEFINE_FLAG "${_ASM_PREFIX}-D")
+    endif()
+
+    set(_RENESAS_DEBUG_FLAG "-g")
+    if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 1.05)
+      string(APPEND _RENESAS_DEBUG_FLAG " -g_line")
+    endif()
+
+    string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+    string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -Onothing ${_RENESAS_DEBUG_FLAG}")
+    string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG")
+    string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " ${_RENESAS_DEBUG_FLAG} ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG")
+    string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Osize ${CMAKE_${lang}_DEFINE_FLAG}NDEBUG")
+
+    set(_PREP_OUT "-P -o<PREPROCESSED_SOURCE>")
+    set(_ASM_OUT "-S -o<ASSEMBLY_SOURCE>")
+    set(_OBJ_OUT "-c -o<OBJECT>")
+    set(_EXE_OUT "-o<TARGET>")
+    set(_DEP_OUT "-M -o<DEP_FILE>")
+    # Assembler dependency. -c is required to avoid to process to link
+    if ("${lang}" STREQUAL "ASM")
+      set(_DEP_OUT "-c ${_ASM_PREFIX}-MM ${_ASM_PREFIX}-MT=<OBJECT> ${_ASM_PREFIX}-MF=<DEP_FILE>")
+    endif()
+
+# Otherwise, not supported architecture.
+  else()
+    message(FATAL_ERROR "Architecture for Renesas compiler: ${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID} is not supported.")
+  endif()
+
+# Common
+  set(CMAKE_EXECUTABLE_SUFFIX ".abs")
+  set(CMAKE_EXECUTABLE_SUFFIX_${lang} ".abs")
+  set(CMAKE_STATIC_LIBRARY_PREFIX "")
+  set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
+  set(CMAKE_${lang}_DEPENDS_USE_COMPILER TRUE)
+  set(CMAKE_${lang}_DEPFILE_FORMAT custom)
+  # This is supported only when link process is called from driver.
+  set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "${CMAKE_${lang}_RESPONSE_FILE_FLAG}")
+
+# Compile commands
+  set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> ${_PREP_OUT}")
+  set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> ${_ASM_OUT}")
+  set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> ${_OBJ_OUT}")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${_EXE_OUT}")
+  set(CMAKE_${lang}_DEPENDS_EXTRA_COMMANDS "<CMAKE_${lang}_COMPILER> <SOURCE> <DEFINES> <INCLUDES> <FLAGS> ${_DEP_OUT}")
+
+# Link/Archive commands. Use rlink as the linker and archiver.
+  get_filename_component(_RENESAS_CC_PATH ${CMAKE_${lang}_COMPILER} DIRECTORY NO_CACHE)
+  set(_RLINK "\"${_RENESAS_CC_PATH}/rlink\"")
+  set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "${_RLINK} -nologo -form=library -output=<TARGET> <LINK_FLAGS> <OBJECTS>")
+  set(CMAKE_${lang}_ARCHIVE_CREATE "${_RLINK} -nologo -form=library -output=<TARGET> <LINK_FLAGS> <OBJECTS>")
+  set(CMAKE_${lang}_ARCHIVE_APPEND "${_RLINK} -nologo -form=library -output=<TARGET> -library=<TARGET> <LINK_FLAGS> <OBJECTS>")
+  set(CMAKE_${lang}_ARCHIVE_FINISH "")
+
+endmacro()
diff --git a/Modules/Compiler/TI.cmake b/Modules/Compiler/TI.cmake
index 9462dcd..f0c3e94 100644
--- a/Modules/Compiler/TI.cmake
+++ b/Modules/Compiler/TI.cmake
@@ -36,7 +36,7 @@
   set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> qa <TARGET> <OBJECTS>")
   set(CMAKE_${lang}_ARCHIVE_FINISH "")
 
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> --run_linker --output_file=<TARGET> --map_file=<TARGET_NAME>.map <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
 endmacro()
 
 set(CMAKE_LIBRARY_PATH_FLAG "--search_path=")
diff --git a/Modules/Compiler/TIClang.cmake b/Modules/Compiler/TIClang.cmake
index d069e94..3e21018 100644
--- a/Modules/Compiler/TIClang.cmake
+++ b/Modules/Compiler/TIClang.cmake
@@ -15,7 +15,7 @@
 
   set(CMAKE_${lang}_COMPILE_OBJECT  "<CMAKE_${lang}_COMPILER> -c <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
 
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> -Xlinker --output_file=<TARGET> -Xlinker --map_file=<TARGET_NAME>.map -Xlinker --rom_model <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> <FLAGS> -Xlinker --output_file=<TARGET> -Xlinker --map_file=<TARGET_NAME>.map -Xlinker --rom_model <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES>")
 
   set(CMAKE_${lang}_ARCHIVE_CREATE  "<CMAKE_AR> cr <TARGET> <OBJECTS>")
   set(CMAKE_${lang}_ARCHIVE_APPEND  "<CMAKE_AR> r <TARGET> <OBJECTS>")
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
index 39443cf..ded2a6d 100644
--- a/Modules/DeployQt4.cmake
+++ b/Modules/DeployQt4.cmake
@@ -5,102 +5,149 @@
 DeployQt4
 ---------
 
-Functions to help assemble a standalone Qt4 executable.
+.. note::
 
-A collection of CMake utility functions useful for deploying Qt4
-executables.
+  This module is for Qt version 4.  New code should follow the
+  :manual:`cmake-qt(7)` instead of using this module.
 
-The following functions are provided by this module:
+This module provides a collection of CMake utility commands useful for
+assembling and deploying standalone Qt4 executables.
 
-::
-
-   write_qt4_conf
-   resolve_qt4_paths
-   fixup_qt4_executable
-   install_qt4_plugin_path
-   install_qt4_plugin
-   install_qt4_executable
-
-Requires CMake 2.6 or greater because it uses function and
-PARENT_SCOPE.  Also depends on BundleUtilities.cmake.
+Load this module in a CMake project with:
 
 .. code-block:: cmake
 
-  write_qt4_conf(<qt_conf_dir> <qt_conf_contents>)
+  include(DeployQt4)
 
-Writes a qt.conf file with the <qt_conf_contents> into <qt_conf_dir>.
+Commands
+^^^^^^^^
 
-.. code-block:: cmake
+This module provides the following commands:
 
-  resolve_qt4_paths(<paths_var> [<executable_path>])
+* :command:`write_qt4_conf`
+* :command:`resolve_qt4_paths`
+* :command:`fixup_qt4_executable`
+* :command:`install_qt4_plugin_path`
+* :command:`install_qt4_plugin`
+* :command:`install_qt4_executable`
 
-Loop through <paths_var> list and if any don't exist resolve them
-relative to the <executable_path> (if supplied) or the
-CMAKE_INSTALL_PREFIX.
+.. command:: write_qt4_conf
 
-.. code-block:: cmake
+  Creates a Qt configuration file:
 
-  fixup_qt4_executable(<executable>
-    [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
+  .. code-block:: cmake
 
-Copies Qt plugins, writes a Qt configuration file (if needed) and
-fixes up a Qt4 executable using BundleUtilities so it is standalone
-and can be drag-and-drop copied to another machine as long as all of
-the system libraries are compatible.
+    write_qt4_conf(<qt-conf-dir> <qt-conf-contents>)
 
-<executable> should point to the executable to be fixed-up.
+  This command writes a ``qt.conf`` file with the ``<qt-conf-contents>`` into
+  the ``<qt-conf-dir>`` directory.
 
-<qtplugins> should contain a list of the names or paths of any Qt
-plugins to be installed.
+.. command:: resolve_qt4_paths
 
-<libs> will be passed to BundleUtilities and should be a list of any
-already installed plugins, libraries or executables to also be
-fixed-up.
+  Resolves relative paths to absolute:
 
-<dirs> will be passed to BundleUtilities and should contain and
-directories to be searched to find library dependencies.
+  .. code-block:: cmake
 
-<plugins_dir> allows an custom plugins directory to be used.
+    resolve_qt4_paths(<paths-var> [<executable-path>])
 
-<request_qt_conf> will force a qt.conf file to be written even if not
-needed.
+  This command loops through the ``<paths-var>`` list and if any path doesn't
+  exist, it resolves them relative to the ``<executable-path>`` (if supplied)
+  or the :variable:`CMAKE_INSTALL_PREFIX`.
 
-.. code-block:: cmake
+.. command:: fixup_qt4_executable
 
-  install_qt4_plugin_path(plugin executable copy installed_plugin_path_var
-                          <plugins_dir> <component> <configurations>)
+  Fixes up a Qt4 executable:
 
-Install (or copy) a resolved <plugin> to the default plugins directory
-(or <plugins_dir>) relative to <executable> and store the result in
-<installed_plugin_path_var>.
+  .. code-block:: cmake
 
-If <copy> is set to TRUE then the plugins will be copied rather than
-installed.  This is to allow this module to be used at CMake time
-rather than install time.
+    fixup_qt4_executable(
+      <executable>
+      [<qtplugins> <libs> <dirs> <plugins-dir> <request-qt-conf>]
+    )
 
-If <component> is set then anything installed will use this COMPONENT.
+  This command copies Qt plugins, writes a Qt configuration file (if needed)
+  and fixes up a Qt4 executable using the :module:`BundleUtilities` module
+  so it is standalone and can be drag-and-drop copied to another machine as
+  long as all of the system libraries are compatible.
 
-.. code-block:: cmake
+  ``<executable>`` should point to the executable to be fixed-up.
 
-  install_qt4_plugin(plugin executable copy installed_plugin_path_var
-                     <plugins_dir> <component>)
+  ``<qtplugins>`` should contain a list of the names or paths of any Qt plugins
+  to be installed.
 
-Install (or copy) an unresolved <plugin> to the default plugins
-directory (or <plugins_dir>) relative to <executable> and store the
-result in <installed_plugin_path_var>.  See documentation of
-INSTALL_QT4_PLUGIN_PATH.
+  ``<libs>`` will be passed to the :module:`BundleUtilities` module and should
+  be a list of any already installed plugins, libraries or executables to also
+  be fixed-up.
 
-.. code-block:: cmake
+  ``<dirs>`` will be passed to the :module:`BundleUtilities` module and should
+  contain directories to be searched to find library dependencies.
 
-  install_qt4_executable(<executable>
-    [<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
+  ``<plugins-dir>`` allows a custom plugins directory to be used.
 
-Installs Qt plugins, writes a Qt configuration file (if needed) and
-fixes up a Qt4 executable using BundleUtilities so it is standalone
-and can be drag-and-drop copied to another machine as long as all of
-the system libraries are compatible.  The executable will be fixed-up
-at install time.  <component> is the COMPONENT used for bundle fixup
-and plugin installation.  See documentation of FIXUP_QT4_BUNDLE.
+  ``<request-qt-conf>`` will force a ``qt.conf`` file to be written even if not
+  needed.
+
+.. command:: install_qt4_plugin_path
+
+  Installs a resolved Qt4 plugin:
+
+  .. code-block:: cmake
+
+    install_qt4_plugin_path(
+      <plugin>
+      <executable>
+      <copy>
+      <installed-plugin-path-var>
+      [<plugins-dir> <component> <configurations>]
+    )
+
+  This command installs (or copies) a resolved ``<plugin>`` to the default
+  plugins directory (or ``<plugins-dir>``) relative to ``<executable>`` and
+  stores the result in a variable ``<installed-plugin-path-var>``.
+
+  If ``<copy>`` is set to ``TRUE`` then the plugins will be copied rather than
+  installed.  This is to allow this module to be used at CMake time rather than
+  install time.
+
+  If ``<component>`` is set then anything installed will use this COMPONENT.
+
+.. command:: install_qt4_plugin
+
+  Installs an unresolved Qt4 plugin:
+
+  .. code-block:: cmake
+
+    install_qt4_plugin(
+      <plugin>
+      <executable>
+      <copy>
+      <installed-plugin-path-var>
+      [<plugins-dir> <component>]
+    )
+
+  This command installs (or copies) an unresolved ``<plugin>`` to the default
+  plugins directory (or ``<plugins-dir>``) relative to ``<executable>`` and
+  stores the result in a variable ``<installed-plugin-path-var>``.  For other
+  arguments, see also :command:`install_qt4_plugin_path`.
+
+.. command:: install_qt4_executable
+
+  Installs Qt plugins, writes a Qt configuration file (if needed) and fixes
+  up a Qt4 executable:
+
+  .. code-block:: cmake
+
+    install_qt4_executable(
+      <executable>
+      [<qtplugins> <libs> <dirs> <plugins-dir> <request-qt-conf> <component>]
+    )
+
+  This command uses the :module:`BundleUtilities` module so executable is
+  standalone and can be drag-and-drop copied to another machine as long as
+  all of the system libraries are compatible.  The executable will be fixed-up
+  at install time.  The ``<component>`` is the COMPONENT used for bundle fixup
+  and plugin installation.  For other arguments, see also
+  :command:`fixup_qt4_executable`.
 #]=======================================================================]
 
 # The functions defined in this file depend on the fixup_bundle function
@@ -393,7 +440,7 @@
   install(CODE
 "include(\"${CMAKE_CURRENT_FUNCTION_LIST_DIR}/DeployQt4.cmake\")
 set(BU_CHMOD_BUNDLE_ITEMS TRUE)
-FIXUP_QT4_EXECUTABLE(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
+fixup_qt4_executable(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
           ${component}
   )
 endfunction()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 37bd39c..61e2ea5 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -301,6 +301,10 @@
 .. versionadded:: 3.1
   Added support for `tbz2`, `.tar.xz`, `.txz`, and `.7z` extensions.
 
+.. versionadded:: 4.1
+  All archive types that :option:`cmake -E tar <cmake-E tar>` can extract
+  are supported regardless of file extension.
+
 Git
 ~~~
 
diff --git a/Modules/ExternalProject/shared_internal_commands.cmake b/Modules/ExternalProject/shared_internal_commands.cmake
index ac5d2bd..cb7b772 100644
--- a/Modules/ExternalProject/shared_internal_commands.cmake
+++ b/Modules/ExternalProject/shared_internal_commands.cmake
@@ -701,23 +701,8 @@
   directory
   options
 )
-  set(args "")
-
-  if(filename MATCHES
-    "(\\.|=)(7z|tar\\.bz2|tar\\.gz|tar\\.xz|tbz2|tgz|txz|zip)$")
-    set(args xfz)
-  endif()
-
-  if(filename MATCHES "(\\.|=)tar$")
-    set(args xf)
-  endif()
-
-  if(args STREQUAL "")
-    message(FATAL_ERROR
-      "Do not know how to extract '${filename}' -- known types are: "
-      ".7z, .tar, .tar.bz2, .tar.gz, .tar.xz, .tbz2, .tgz, .txz and .zip"
-    )
-  endif()
+  # cmake -E tar auto detects the type of archive being extracted
+  set(args "xf")
 
   configure_file(
     "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/extractfile.cmake.in"
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index 0b7670f..1198abe 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -5,17 +5,18 @@
 FindALSA
 --------
 
-Find Advanced Linux Sound Architecture (ALSA)
-
-Find the alsa libraries (``asound``)
+Finds the Advanced Linux Sound Architecture (ALSA) library (``asound``).
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.12
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if
-ALSA has been found.
+``ALSA::ALSA``
+  .. versionadded:: 3.12
+
+  Target encapsulating the ALSA library usage requirements.  This target is
+  available only if ALSA is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
@@ -23,24 +24,34 @@
 This module defines the following variables:
 
 ``ALSA_FOUND``
-  True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
+  Boolean indicating whether the ALSA library is found.
 
 ``ALSA_LIBRARIES``
-  List of libraries when using ALSA.
+  List of libraries needed for linking to use ALSA library.
 
 ``ALSA_INCLUDE_DIRS``
-  Where to find the ALSA headers.
+  Include directories containing headers needed to use ALSA library.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``ALSA_INCLUDE_DIR``
-  the ALSA include directory
+  The ALSA include directory.
 
 ``ALSA_LIBRARY``
-  the absolute path of the asound library
+  The absolute path of the asound library.
+
+Examples
+^^^^^^^^
+
+Finding the ALSA library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(ALSA)
+  target_link_libraries(project_target PRIVATE ALSA::ALSA)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindASPELL.cmake b/Modules/FindASPELL.cmake
index 10d61ac..2c5cb93 100644
--- a/Modules/FindASPELL.cmake
+++ b/Modules/FindASPELL.cmake
@@ -5,28 +5,298 @@
 FindASPELL
 ----------
 
-Try to find ASPELL
+Finds the GNU Aspell spell checker library.
 
-Once done this will define
+Components
+^^^^^^^^^^
 
-::
+This module supports the following components:
 
-  ASPELL_FOUND - system has ASPELL
-  ASPELL_EXECUTABLE - the ASPELL executable
-  ASPELL_INCLUDE_DIR - the ASPELL include directory
-  ASPELL_LIBRARIES - The libraries needed to use ASPELL
-  ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
+``ASPELL``
+  .. versionadded:: 4.1
+
+  Finds the Aspell library and its include paths.
+
+``Executable``
+  .. versionadded:: 4.1
+
+  Finds the Aspell command-line interactive spell checker executable.
+
+Components can be specified using the standard CMake syntax:
+
+.. code-block:: cmake
+
+  find_package(ASPELL [COMPONENTS <components>...])
+
+If no ``COMPONENTS`` are specified, the module searches for both the ``ASPELL``
+and ``Executable`` components by default.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following :ref:`Imported Targets` when
+:prop_gbl:`CMAKE_ROLE` is ``PROJECT``:
+
+``ASPELL::ASPELL``
+  .. versionadded:: 4.1
+
+  Target encapsulating the Aspell library usage requirements.  It is available
+  only when the ``ASPELL`` component is found.
+
+``ASPELL::Executable``
+  .. versionadded:: 4.1
+
+  Target encapsulating the Aspell command-line spell checker executable.  It is
+  available only when the ``Executable`` component is found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``ASPELL_FOUND``
+  Boolean indicating whether the requested Aspell components have been found.
+
+``ASPELL_VERSION``
+  .. versionadded:: 4.1
+
+  Version string of the found Aspell if any.  It may be only determined if the
+  ``Executable`` component is found.  If version isn't determined, version value
+  is not set.
+
+``ASPELL_INCLUDE_DIRS``
+  .. versionadded:: 4.1
+
+  Include directories needed to use Aspell.  They are available when the
+  ``ASPELL`` component is found.
+
+  The Aspell library may also provide a backward-compatible interface for Pspell
+  via the ``pspell.h`` header file.  If such an interface is found, it is also
+  added to the list of include directories.
+
+``ASPELL_LIBRARIES``
+  Libraries needed to link to Aspell.  They are available when the ``ASPELL``
+  component is found.
+
+  .. versionchanged:: 4.1
+    This variable is now set as a regular result variable instead of being a
+    cache variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``ASPELL_INCLUDE_DIR``
+  The directory containing the ``aspell.h`` header file when using the
+  ``Executable`` component.
+
+``ASPELL_LIBRARY``
+  .. versionadded:: 4.1
+
+  The path to the Aspell library when using the ``ASPELL`` component.
+
+``ASPELL_EXECUTABLE``
+  The path to the ``aspell`` command-line spell checker program when using the
+  ``Executable`` component.
+
+Examples
+^^^^^^^^
+
+Finding the Aspell library with CMake 4.1 or later and linking it to a project
+target:
+
+.. code-block:: cmake
+
+  find_package(ASPELL COMPONENTS ASPELL)
+  target_link_libraries(project_target PRIVATE ASPELL::ASPELL)
+
+When writing backward-compatible code that supports CMake 4.0 and earlier, a
+local imported target can be defined directly in the project:
+
+.. code-block:: cmake
+
+  find_package(ASPELL COMPONENTS ASPELL)
+  if(ASPELL_FOUND AND NOT TARGET ASPELL::ASPELL)
+    add_library(ASPELL::ASPELL INTERFACE IMPORTED)
+    set_target_properties(
+      ASPELL::ASPELL
+      PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${ASPELL_LIBRARIES}"
+        INTERFACE_INCLUDE_DIRECTORIES "${ASPELL_INCLUDE_DIR}"
+    )
+  endif()
+  target_link_libraries(project_target PRIVATE ASPELL::ASPELL)
+
+Example, how to execute the ``aspell`` command-line spell checker in a project:
+
+.. code-block:: cmake
+
+  find_package(ASPELL COMPONENTS Executable)
+  execute_process(COMMAND ${ASPELL_EXECUTABLE} --help)
 #]=======================================================================]
 
-find_path(ASPELL_INCLUDE_DIR aspell.h )
+set(_ASPELL_REASON_FAILURE_MESSAGE "")
+set(_ASPELL_REQUIRED_VARS "")
 
-find_program(ASPELL_EXECUTABLE
-  NAMES aspell
-)
+# Set default components, when 'COMPONENTS <components>...' are not specified in
+# the 'find_package(ASPELL ...)' call.
+if(NOT ASPELL_FIND_COMPONENTS)
+  set(ASPELL_FIND_COMPONENTS "ASPELL" "Executable")
+  set(ASPELL_FIND_REQUIRED_ASPELL TRUE)
+  set(ASPELL_FIND_REQUIRED_Executable TRUE)
+endif()
 
-find_library(ASPELL_LIBRARIES NAMES aspell aspell-15 libaspell-15 libaspell)
+if("ASPELL" IN_LIST ASPELL_FIND_COMPONENTS)
+  find_path(
+    ASPELL_INCLUDE_DIR
+    NAMES aspell.h
+    DOC "The directory containing <aspell.h>."
+  )
+  mark_as_advanced(ASPELL_INCLUDE_DIR)
+
+  if(NOT ASPELL_INCLUDE_DIR)
+    string(APPEND _ASPELL_REASON_FAILURE_MESSAGE "aspell.h could not be found. ")
+  endif()
+
+  # Find backward-compatibility interface for Pspell.
+  find_path(
+    ASPELL_PSPELL_INCLUDE_DIR
+    NAMES pspell.h
+    PATH_SUFFIXES pspell
+    DOC "Directory containing <pspell.h> BC interface header"
+  )
+  mark_as_advanced(ASPELL_PSPELL_INCLUDE_DIR)
+
+  # For backward compatibility in projects supporting CMake 4.0 or earlier.
+  # Previously the ASPELL_LIBRARIES was a cache variable storing the
+  # find_library result.
+  if(DEFINED ASPELL_LIBRARIES AND NOT DEFINED ASPELL_LIBRARY)
+    set(ASPELL_LIBRARY ${ASPELL_LIBRARIES})
+  endif()
+
+  find_library(
+    ASPELL_LIBRARY
+    NAMES aspell aspell-15 libaspell-15 libaspell
+    DOC "The path to the Aspell library."
+  )
+  mark_as_advanced(ASPELL_LIBRARY)
+
+  if(NOT ASPELL_LIBRARY)
+    string(APPEND _ASPELL_REASON_FAILURE_MESSAGE "Aspell library not found. ")
+  endif()
+
+  if(ASPELL_INCLUDE_DIR AND ASPELL_LIBRARY)
+    set(ASPELL_ASPELL_FOUND TRUE)
+  else()
+    set(ASPELL_ASPELL_FOUND FALSE)
+  endif()
+
+  if(ASPELL_FIND_REQUIRED_ASPELL)
+    list(APPEND _ASPELL_REQUIRED_VARS ASPELL_LIBRARY ASPELL_INCLUDE_DIR)
+  endif()
+endif()
+
+if("Executable" IN_LIST ASPELL_FIND_COMPONENTS)
+  find_program(
+    ASPELL_EXECUTABLE
+    NAMES aspell
+    DOC "The path to the aspell command-line utility program."
+  )
+  mark_as_advanced(ASPELL_EXECUTABLE)
+
+  if(NOT ASPELL_EXECUTABLE)
+    string(
+      APPEND
+      _ASPELL_REASON_FAILURE_MESSAGE
+      "Aspell command-line executable not found. "
+    )
+    set(ASPELL_Executable_FOUND FALSE)
+  else()
+    set(ASPELL_Executable_FOUND TRUE)
+
+    block(PROPAGATE ASPELL_VERSION)
+      execute_process(
+        COMMAND ${ASPELL_EXECUTABLE} --version
+        OUTPUT_VARIABLE output
+        RESULT_VARIABLE result
+        ERROR_QUIET
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+      )
+      if(result EQUAL 0 AND output MATCHES "([0-9.]+)[)]?$")
+        set(ASPELL_VERSION ${CMAKE_MATCH_1})
+      endif()
+    endblock()
+  endif()
+
+  if(ASPELL_FIND_REQUIRED_Executable)
+    list(APPEND _ASPELL_REQUIRED_VARS ASPELL_EXECUTABLE)
+  endif()
+endif()
 
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(ASPELL DEFAULT_MSG ASPELL_LIBRARIES ASPELL_INCLUDE_DIR ASPELL_EXECUTABLE)
+find_package_handle_standard_args(
+  ASPELL
+  REQUIRED_VARS ${_ASPELL_REQUIRED_VARS}
+  HANDLE_COMPONENTS
+  VERSION_VAR ASPELL_VERSION
+  REASON_FAILURE_MESSAGE "${_ASPELL_REASON_FAILURE_MESSAGE}"
+)
 
-mark_as_advanced(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES ASPELL_EXECUTABLE)
+unset(_ASPELL_REASON_FAILURE_MESSAGE)
+unset(_ASPELL_REQUIRED_VARS)
+
+if(NOT ASPELL_FOUND)
+  return()
+endif()
+
+get_property(_ASPELL_ROLE GLOBAL PROPERTY CMAKE_ROLE)
+
+if("ASPELL" IN_LIST ASPELL_FIND_COMPONENTS AND ASPELL_ASPELL_FOUND)
+  set(ASPELL_INCLUDE_DIRS ${ASPELL_INCLUDE_DIR})
+  if(ASPELL_PSPELL_INCLUDE_DIR)
+    list(APPEND ASPELL_INCLUDE_DIRS ${ASPELL_PSPELL_INCLUDE_DIR})
+    list(REMOVE_DUPLICATES ASPELL_INCLUDE_DIRS)
+  endif()
+  set(ASPELL_LIBRARIES ${ASPELL_LIBRARY})
+
+  if(_ASPELL_ROLE STREQUAL "PROJECT" AND NOT TARGET ASPELL::ASPELL)
+    if(IS_ABSOLUTE "${ASPELL_LIBRARY}")
+      add_library(ASPELL::ASPELL UNKNOWN IMPORTED)
+      set_target_properties(
+        ASPELL::ASPELL
+        PROPERTIES
+          IMPORTED_LOCATION "${ASPELL_LIBRARY}"
+      )
+    else()
+      add_library(ASPELL::ASPELL INTERFACE IMPORTED)
+      set_target_properties(
+        ASPELL::ASPELL
+        PROPERTIES
+          IMPORTED_LIBNAME "${ASPELL_LIBRARY}"
+      )
+    endif()
+
+    set_target_properties(
+      ASPELL::ASPELL
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${ASPELL_INCLUDE_DIRS}"
+    )
+  endif()
+endif()
+
+if(
+  _ASPELL_ROLE STREQUAL "PROJECT"
+  AND "Executable" IN_LIST ASPELL_FIND_COMPONENTS
+  AND ASPELL_Executable_FOUND
+  AND NOT TARGET ASPELL::Executable
+)
+  add_executable(ASPELL::Executable IMPORTED)
+  set_target_properties(
+    ASPELL::Executable
+    PROPERTIES
+      IMPORTED_LOCATION "${ASPELL_EXECUTABLE}"
+  )
+endif()
+
+unset(_ASPELL_ROLE)
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index 4798c34..d3387ea 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -5,20 +5,41 @@
 FindAVIFile
 -----------
 
-Locate `AVIFILE <https://avifile.sourceforge.net/>`_
-library and include paths.
+Finds `AVIFile <https://avifile.sourceforge.net/>`_ library and include paths.
 
-AVIFILE is a set of libraries for
-i386 machines to use various AVI codecs.  Support is limited beyond
-Linux.  Windows provides native AVI support, and so doesn't need this
-library.  This module defines
+AVIFile is a set of libraries for i386 machines to use various AVI codecs.
+Support is limited beyond Linux.  Windows provides native AVI support, and so
+doesn't need this library.
 
-::
+Result Variables
+^^^^^^^^^^^^^^^^
 
-  AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
-  AVIFILE_LIBRARIES, the libraries to link against
-  AVIFILE_DEFINITIONS, definitions to use when compiling
-  AVIFILE_FOUND, If false, don't try to use AVIFILE
+This module defines the following variables:
+
+``AVIFile_FOUND``
+  True if AVIFile is found.  For backward compatibility, the ``AVIFILE_FOUND``
+  variable is also set to the same value.
+``AVIFILE_LIBRARIES``
+  The libraries to link against.
+``AVIFILE_DEFINITIONS``
+  Definitions to use when compiling.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may be also set:
+
+``AVIFILE_INCLUDE_DIR``
+  Directory containing ``avifile.h`` and other AVIFile headers.
+
+Examples
+^^^^^^^^
+
+Finding AVIFile:
+
+.. code-block:: cmake
+
+  find_package(AVIFile)
 #]=======================================================================]
 
 if (UNIX)
@@ -31,7 +52,7 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(AVIFile DEFAULT_MSG AVIFILE_INCLUDE_DIR AVIFILE_AVIPLAY_LIBRARY)
 
-if (AVIFILE_FOUND)
+if (AVIFile_FOUND)
     set(AVIFILE_LIBRARIES ${AVIFILE_AVIPLAY_LIBRARY})
     set(AVIFILE_DEFINITIONS "")
 endif()
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index 1cde7de..f185f10 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -5,33 +5,58 @@
 FindArmadillo
 -------------
 
-Find the Armadillo C++ library.
-Armadillo is a library for linear algebra & scientific computing.
+Finds the Armadillo C++ library.  Armadillo is a library for linear algebra and
+scientific computing.
 
 .. versionadded:: 3.18
-  Support for linking wrapped libraries directly (``ARMA_DONT_USE_WRAPPER``).
+  Support for linking wrapped libraries directly (see the
+  ``ARMA_DONT_USE_WRAPPER`` preprocessor macro that needs to be defined before
+  including the ``<armadillo>`` header).
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following variables:
+
+``Armadillo_FOUND``
+  Set to true if the library is found.  For backward compatibility, the
+  ``ARMADILLO_FOUND`` variable is also set to the same value.
+``ARMADILLO_INCLUDE_DIRS``
+  List of required include directories.
+``ARMADILLO_LIBRARIES``
+  List of libraries to be linked.
+``ARMADILLO_VERSION_STRING``
+  Version as a string (ex: ``1.0.4``).
+``ARMADILLO_VERSION_MAJOR``
+  Major version number.
+``ARMADILLO_VERSION_MINOR``
+  Minor version number.
+``ARMADILLO_VERSION_PATCH``
+  Patch version number.
+``ARMADILLO_VERSION_NAME``
+  Name of the version (ex: ``Antipodean Antileech``).
+
+Examples
+^^^^^^^^
 
 Using Armadillo:
 
 .. code-block:: cmake
 
   find_package(Armadillo REQUIRED)
-  include_directories(${ARMADILLO_INCLUDE_DIRS})
+
+  if(Armadillo_FOUND AND NOT TARGET Armadillo::Armadillo)
+    add_library(Armadillo::Armadillo INTERFACE IMPORTED)
+    set_target_properties(
+      Armadillo::Armadillo
+      PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${ARMADILLO_LIBRARIES}"
+        INTERFACE_INCLUDE_DIRECTORIES "${ARMADILLO_INCLUDE_DIRS}"
+    )
+  endif()
+
   add_executable(foo foo.cc)
-  target_link_libraries(foo ${ARMADILLO_LIBRARIES})
-
-This module sets the following variables:
-
-::
-
-  ARMADILLO_FOUND - set to true if the library is found
-  ARMADILLO_INCLUDE_DIRS - list of required include directories
-  ARMADILLO_LIBRARIES - list of libraries to be linked
-  ARMADILLO_VERSION_MAJOR - major version number
-  ARMADILLO_VERSION_MINOR - minor version number
-  ARMADILLO_VERSION_PATCH - patch version number
-  ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
-  ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
+  target_link_libraries(foo PRIVATE Armadillo::Armadillo)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -83,7 +108,8 @@
 
 include(FindPackageHandleStandardArgs)
 
-# If _ARMA_USE_WRAPPER is set, then we just link to armadillo, but if it's not then we need support libraries instead
+# If _ARMA_USE_WRAPPER is set, then we just link to armadillo, but if it's not
+# then we need support libraries instead.
 set(_ARMA_SUPPORT_LIBRARIES)
 
 if(_ARMA_USE_WRAPPER)
@@ -126,7 +152,7 @@
   REQUIRED_VARS ARMADILLO_INCLUDE_DIR ${_ARMA_REQUIRED_VARS}
   VERSION_VAR ARMADILLO_VERSION_STRING)
 
-if (ARMADILLO_FOUND)
+if (Armadillo_FOUND)
   set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
   set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY} ${_ARMA_SUPPORT_LIBRARIES})
 endif ()
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index cbda5cd..ef76f6a 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -5,120 +5,198 @@
 FindBISON
 ---------
 
-Find ``bison`` executable and provide a macro to generate custom build rules.
+Finds the Bison command-line parser generator and provides a CMake command to
+generate custom build rules for using Bison:
 
-The module defines the following variables:
+.. code-block:: cmake
+
+  find_package(BISON [<version>] ...)
+
+Bison is a parser generator that replaced earlier Yacc (Yet Another
+Compiler-Compiler).  On Unix-like systems, most common implementation is
+GNU Bison.  On Windows, this module looks for Windows-compatible Bison, if
+installed.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
 
 ``BISON_FOUND``
-  True if the program was found.
-
-``BISON_EXECUTABLE``
-  The path to the ``bison`` program.
+  Boolean indicating whether (the requested version of) Bison is found.
 
 ``BISON_VERSION``
-  The version of ``bison``.
+  The version of Bison found.
 
-The minimum required version of ``bison`` can be specified using the
-standard CMake syntax, e.g. :command:`find_package(BISON 2.1.3)`.
+Cache Variables
+^^^^^^^^^^^^^^^
 
-If ``bison`` is found, the module defines the macro:
+The following cache variables may also be set:
+
+``BISON_EXECUTABLE``
+  The path to the ``bison`` command-line program.
+
+Commands
+^^^^^^^^
+
+This module provides the following command if ``bison`` is found:
 
 .. command:: bison_target
 
+  Creates a custom build rule to generate a parser file from a Yacc file using
+  Bison:
+
   .. code-block:: cmake
 
-    bison_target(<Name> <YaccInput> <CodeOutput>
-                 [OPTIONS <options>...]
-                 [COMPILE_FLAGS <string>]
-                 [DEFINES_FILE <file>]
-                 [VERBOSE [<file>]]
-                 [REPORT_FILE <file>]
-                 )
+    bison_target(
+      <name>
+      <input-yacc-file>
+      <output-parser-file>
+      [DEFINES_FILE <header>]
+      [VERBOSE [<file>]]       # The [<file>] argument is deprecated
+      [REPORT_FILE <file>]
+      [OPTIONS <options>...]
+      [COMPILE_FLAGS <string>] # Deprecated
+    )
 
-which will create a custom rule to generate a parser.  ``<YaccInput>`` is
-the path to a yacc file.  ``<CodeOutput>`` is the name of the source file
-generated by bison.  A header file can also be generated, and contains
-the token list.
+  .. versionchanged:: 3.14
+    When policy :policy:`CMP0088` is set to ``NEW``, ``bison`` runs in the
+    :variable:`CMAKE_CURRENT_BINARY_DIR` directory.
 
-.. versionchanged:: 3.14
-  When :policy:`CMP0088` is set to ``NEW``, ``bison`` runs in the
-  :variable:`CMAKE_CURRENT_BINARY_DIR` directory.
+  ``<name>``
+    String used as an identifier for this command invocation.
 
-The options are:
+  ``<input-yacc-file>``
+    The path to an input Yacc source file (``.y``).  If given as a relative
+    path, it will be interpreted relative to the current source directory
+    (:variable:`CMAKE_CURRENT_SOURCE_DIR`).
 
-``OPTIONS <options>...``
-  .. versionadded:: 4.0
+  ``<output-parser-file>``
+    The path of the output parser file to be generated by Bison.  If given as a
+    relative path, it will be interpreted relative to the current Bison working
+    directory.
 
-  A :ref:`semicolon-separated list <CMake Language Lists>` of options added to
-  the ``bison`` command line.
+  ``DEFINES_FILE <header>``
+    .. versionadded:: 3.4
 
-``COMPILE_FLAGS <string>``
-  .. deprecated:: 4.0
+    By default, Bison can generate a header file containing the list of tokens.
+    This option allows specifying a custom ``<header>`` file to be generated by
+    Bison.  If given as a relative path, it will be interpreted relative to the
+    current Bison working directory.
 
-  Space-separated bison options added to the ``bison`` command line.
-  A :ref:`;-list <CMake Language Lists>` will not work.
-  This option is deprecated in favor of ``OPTIONS <options>...``.
+  ``VERBOSE [<file>]``
+    Enables generation of a verbose grammar and parser report.  By default, the
+    report file is created in the current Bison working directory and named
+    ``<output-parser-filename>.output``.
 
-``DEFINES_FILE <file>``
-  .. versionadded:: 3.4
+    ``<file>``
+      .. deprecated:: 3.7
+        Use ``VERBOSE REPORT_FILE <file>``.
 
-  Specify a non-default header ``<file>`` to be generated by ``bison``.
+      Specifies the path to which the report file should be copied.  This
+      argument is retained for backward compatibility and only works when the
+      ``<output-parser-file>`` is specified as an absolute path.
 
-``VERBOSE [<file>]``
-  Tell ``bison`` to write a report file of the grammar and parser.
+  ``REPORT_FILE <file>``
+    .. versionadded:: 3.7
 
-  .. deprecated:: 3.7
-    If ``<file>`` is given, it specifies path the report file is copied to.
-    ``[<file>]`` is left for backward compatibility of this module.
-    Use ``VERBOSE REPORT_FILE <file>``.
+    Used in combination with ``VERBOSE`` to specify a custom path for the report
+    output ``<file>``, overriding the default location.  If given as a relative
+    path, it will be interpreted relative to the current Bison working
+    directory.
 
-``REPORT_FILE <file>``
-  .. versionadded:: 3.7
+  ``OPTIONS <options>...``
+    .. versionadded:: 4.0
 
-  Specify a non-default report ``<file>``, if generated.
+    A :ref:`semicolon-separated list <CMake Language Lists>` of extra options
+    added to the ``bison`` command line.
 
-The macro defines the following variables:
+  ``COMPILE_FLAGS <string>``
+    .. deprecated:: 4.0
+      Superseded by ``OPTIONS <options>...``.
 
-``BISON_<Name>_DEFINED``
-  True if the macro ran successfully.
+    A string of space-separated extra options added to the ``bison`` command
+    line.  A :ref:`semicolon-separated list <CMake Language Lists>` will not
+    work.
 
-``BISON_<Name>_INPUT``
-  The input source file, an alias for ``<YaccInput>``.
+  .. rubric:: Command variables
 
-``BISON_<Name>_OUTPUT_SOURCE``
-  The source file generated by ``bison``.
+  This command also defines the following variables:
 
-``BISON_<Name>_OUTPUT_HEADER``
-  The header file generated by ``bison``.
+  ``BISON_<name>_DEFINED``
+    Boolean indicating whether this command was successfully invoked.
 
-``BISON_<Name>_OUTPUTS``
-  All files generated by ``bison`` including the source, the header and the
-  report.
+  ``BISON_<name>_INPUT``
+    The input source file, an alias for ``<input-yacc-file>``.
 
-``BISON_<Name>_OPTIONS``
-  .. versionadded:: 4.0
+  ``BISON_<name>_OUTPUT_SOURCE``
+    The output parser file generated by ``bison``.
 
-  Options used in the ``bison`` command line.
+  ``BISON_<name>_OUTPUT_HEADER``
+    The header file generated by ``bison``, if any.
 
-``BISON_<Name>_COMPILE_FLAGS``
-  .. deprecated:: 4.0
+  ``BISON_<name>_OUTPUTS``
+    A list of files generated by ``bison``, including the output parser file,
+    header file, and report file.
 
-  Options used in the ``bison`` command line. This variable is deprecated in
-  favor of ``BISON_<Name>_OPTIONS`` variable.
+  ``BISON_<name>_OPTIONS``
+    .. versionadded:: 4.0
+
+    A list of command-line options used for the ``bison`` command.
+
+  ``BISON_<name>_COMPILE_FLAGS``
+    .. deprecated:: 4.0
+      Superseded by ``BISON_<name>_OPTIONS`` variable with the same value.
+
+    A list of command-line options used for the ``bison`` command.
 
 Examples
 ^^^^^^^^
 
+Examples: Finding Bison
+"""""""""""""""""""""""
+
+Finding Bison:
+
 .. code-block:: cmake
 
   find_package(BISON)
-  bison_target(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
-               DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h)
+
+Finding Bison with a minimum required version:
+
+.. code-block:: cmake
+
+  find_package(BISON 2.1.3)
+
+Finding Bison and making it required (if Bison is not found, processing stops
+with an error message):
+
+.. code-block:: cmake
+
+  find_package(BISON 2.1.3 REQUIRED)
+
+Example: Generating Parser
+""""""""""""""""""""""""""
+
+Finding Bison and adding input Yacc source file ``parser.y`` to be processed by
+Bison into ``parser.cpp`` source file with header ``parser.h`` at build phase:
+
+.. code-block:: cmake
+
+  find_package(BISON)
+
+  if(BISON_FOUND)
+    bison_target(MyParser parser.y parser.cpp DEFINES_FILE parser.h)
+  endif()
+
   add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
 
+Examples: Command-line Options
+""""""""""""""""""""""""""""""
+
 Adding additional command-line options to the ``bison`` executable can be passed
-as a list. For example, adding the ``-Wall`` option to report all warnings, and
-``--no-lines`` (``-l``) to not generate ``#line`` directives.
+as a list.  For example, adding the ``-Wall`` option to report all warnings, and
+``--no-lines`` (``-l``) to not generate ``#line`` directives:
 
 .. code-block:: cmake
 
@@ -128,8 +206,9 @@
     bison_target(MyParser parser.y parser.cpp OPTIONS -Wall --no-lines)
   endif()
 
-Generator expressions can be used in ``OPTIONS <options...``. For example, to
-add the ``--debug`` (``-t``) option only for the ``Debug`` build type:
+:manual:`Generator expressions <cmake-generator-expressions(7)>` can be used in
+the ``OPTIONS <options>...`` argument.  For example, to add the ``--debug``
+(``-t``) option only for the ``Debug`` build type:
 
 .. code-block:: cmake
 
@@ -138,6 +217,11 @@
   if(BISON_FOUND)
     bison_target(MyParser parser.y parser.cpp OPTIONS $<$<CONFIG:Debug>:-t>)
   endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`FindFLEX` module to find Flex scanner generator.
 #]=======================================================================]
 
 find_program(BISON_EXECUTABLE NAMES bison win-bison win_bison DOC "path to the bison executable")
@@ -261,7 +345,7 @@
   endmacro()
 
   #============================================================
-  # BISON_TARGET (public macro)
+  # bison_target() public macro
   #============================================================
   #
   macro(BISON_TARGET Name BisonInput BisonOutput)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 53d74bc..2b8a75a 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -54,6 +54,21 @@
     Search for any BLAS/LAPACK.
     Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.
 
+``BLA_THREAD``
+  .. versionadded:: 4.1
+
+  Specify the BLAS/LAPACK threading model:
+
+  ``SEQ``
+    Sequential model
+  ``OMP``
+    OpenMP model
+  ``ANY``
+    Search for any BLAS/LAPACK, if both are available most likely ``OMP`` will
+    be found.
+
+  This is currently only supported by NVIDIA NVPL.
+
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
@@ -169,6 +184,11 @@
 
   A BLAS/LAPACK demuxing library using PLT trampolines
 
+``NVPL``
+  .. versionadded:: 4.1
+
+  NVIDIA Performance Libraries
+
 ``NVHPC``
   .. versionadded:: 3.21
 
@@ -417,6 +437,16 @@
   message(FATAL_ERROR "BLA_SIZEOF_INTEGER can have only <no value>, ANY, 4, or 8 values")
 endif()
 
+if(NOT BLA_THREAD)
+  set(_blas_thread "ANY")
+elseif((BLA_THREAD STREQUAL "ANY") OR
+       (BLA_THREAD STREQUAL "SEQ") OR
+       (BLA_THREAD STREQUAL "OMP"))
+  set(_blas_thread ${BLA_THREAD})
+else()
+  message(FATAL_ERROR "BLA_THREAD can have only <no value>, ANY, SEQ, or OMP values")
+endif()
+
 # Implicitly linked BLAS libraries?
 if(BLA_VENDOR STREQUAL "All")
   if(NOT BLAS_LIBRARIES)
@@ -1315,6 +1345,52 @@
   unset(_blas_fjlapack_lib)
 endif()
 
+# nVidia NVPL? (https://developer.nvidia.com/nvpl)
+if(BLA_VENDOR STREQUAL "NVPL" OR BLA_VENDOR STREQUAL "All")
+  # Prefer lp64 unless ilp64 is requested.
+  if((_blas_sizeof_integer EQUAL 4) OR (_blas_sizeof_integer STREQUAL "ANY"))
+    list(APPEND _blas_nvpl_ints "_lp64")
+  endif()
+  if((_blas_sizeof_integer EQUAL 8) OR (_blas_sizeof_integer STREQUAL "ANY"))
+    list(APPEND _blas_nvpl_ints "_ilp64")
+  endif()
+
+  # Prefer OMP if available
+  if((_blas_thread STREQUAL "OMP") OR (_blas_thread STREQUAL "ANY"))
+    list(APPEND _blas_nvpl_threads "_omp")
+  endif()
+  if((_blas_thread STREQUAL "SEQ") OR (_blas_thread STREQUAL "ANY"))
+    list(APPEND _blas_nvpl_threads "_seq")
+  endif()
+
+  if(NOT BLAS_LIBRARIES)
+    find_package(nvpl QUIET)
+    if(nvpl_FOUND)
+      foreach(_nvpl_thread IN LISTS _blas_nvpl_threads)
+        foreach(_nvpl_int IN LISTS _blas_nvpl_ints)
+
+          set(_blas_lib "nvpl::blas${_nvpl_int}${_nvpl_thread}")
+
+          if(TARGET ${_blas_lib})
+            set(BLAS_LIBRARIES ${_blas_lib})
+            break()
+          endif()
+
+        endforeach()
+
+        if(BLAS_LIBRARIES)
+          break()
+        endif()
+
+      endforeach()
+    endif()
+  endif()
+
+  unset(_blas_lib)
+  unset(_blas_nvpl_ints)
+  unset(_blas_nvpl_threads)
+endif()
+
 # BLAS in nVidia HPC SDK? (https://developer.nvidia.com/hpc-sdk)
 if(BLA_VENDOR STREQUAL "NVHPC" OR BLA_VENDOR STREQUAL "All")
   set(_blas_nvhpc_lib "blas")
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index b214f30..0b9f3fe 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -5,47 +5,63 @@
 FindBZip2
 ---------
 
-Try to find BZip2
+Finds the BZip2 data compression library (libbz2):
+
+.. code-block:: cmake
+
+  find_package(BZip2 [<version>] [...])
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.12
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``BZip2::BZip2``, if
-BZip2 has been found.
+``BZip2::BZip2``
+  .. versionadded:: 3.12
+
+  Target encapsulating the usage requirements of BZip2 library.  This target is
+  available only when BZip2 is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``BZIP2_FOUND``
-  system has BZip2
+``BZip2_FOUND``
+  Boolean indicating whether the BZip2 library is found.  For backward
+  compatibility, the ``BZIP2_FOUND`` variable is also set to the same value.
+
 ``BZIP2_INCLUDE_DIRS``
   .. versionadded:: 3.12
-    the BZip2 include directories
+
+  Include directories needed to use BZip2 library.
+
 ``BZIP2_LIBRARIES``
-  Link these to use BZip2
-``BZIP2_NEED_PREFIX``
-  this is set if the functions are prefixed with ``BZ2_``
+  Libraries needed for linking to use BZip2.
+
 ``BZIP2_VERSION``
   .. versionadded:: 3.26
-    the version of BZip2 found.
 
-  See also legacy variable ``BZIP2_VERSION_STRING``.
+  The version of BZip2 found.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``BZIP2_INCLUDE_DIR``
-  the directory containing the BZip2 headers
+  The directory containing the BZip2 headers.
+
 ``BZIP2_LIBRARY_RELEASE``
-  the path to the BZip2 library for release configurations
+  The path to the BZip2 library for release configurations.
+
 ``BZIP2_LIBRARY_DEBUG``
-  the path to the BZip2 library for debug configurations
+  The path to the BZip2 library for debug configurations.
+
+``BZIP2_NEED_PREFIX``
+  Boolean indicating whether BZip2 functions are prefixed with ``BZ2_``
+  (e.g., ``BZ2_bzCompressInit()``).  Versions of BZip2 prior to 1.0.0 used
+  unprefixed function names (e.g., ``bzCompressInit()``).
 
 Legacy Variables
 ^^^^^^^^^^^^^^^^
@@ -53,10 +69,20 @@
 The following variables are provided for backward compatibility:
 
 ``BZIP2_VERSION_STRING``
-  the version of BZip2 found.
-
   .. versionchanged:: 3.26
     Superseded by ``BZIP2_VERSION``.
+
+  The version of BZip2 found.
+
+Examples
+^^^^^^^^
+
+Finding BZip2 library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(BZip2)
+  target_link_libraries(project_target PRIVATE BZip2::BZip2)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -89,7 +115,7 @@
                                   REQUIRED_VARS BZIP2_LIBRARIES BZIP2_INCLUDE_DIR
                                   VERSION_VAR BZIP2_VERSION)
 
-if (BZIP2_FOUND)
+if (BZip2_FOUND)
   set(BZIP2_INCLUDE_DIRS ${BZIP2_INCLUDE_DIR})
   include(${CMAKE_CURRENT_LIST_DIR}/CheckSymbolExists.cmake)
   include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
@@ -97,7 +123,15 @@
   set(CMAKE_REQUIRED_QUIET ${BZip2_FIND_QUIETLY})
   set(CMAKE_REQUIRED_INCLUDES ${BZIP2_INCLUDE_DIR})
   set(CMAKE_REQUIRED_LIBRARIES ${BZIP2_LIBRARIES})
-  check_symbol_exists(BZ2_bzCompressInit "bzlib.h" BZIP2_NEED_PREFIX)
+
+  # Versions before 1.0.2 required <stdio.h> for the FILE definition.
+  set(BZip2_headers "bzlib.h")
+  if(BZIP2_VERSION VERSION_LESS "1.0.2")
+    list(PREPEND BZip2_headers "stdio.h")
+  endif()
+  check_symbol_exists(BZ2_bzCompressInit "${BZip2_headers}" BZIP2_NEED_PREFIX)
+  unset(BZip2_headers)
+
   cmake_pop_check_state()
 
   if(NOT TARGET BZip2::BZip2)
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake
index ca768f9..0674c5f 100644
--- a/Modules/FindBacktrace.cmake
+++ b/Modules/FindBacktrace.cmake
@@ -5,50 +5,103 @@
 FindBacktrace
 -------------
 
-Find provider for `backtrace(3) <https://man7.org/linux/man-pages/man3/backtrace.3.html>`__.
+Finds `backtrace(3) <https://man7.org/linux/man-pages/man3/backtrace.3.html>`_,
+a library that provides functions for application self-debugging.
 
-Checks if OS supports ``backtrace(3)`` via either ``libc`` or custom library.
-This module defines the following variables:
-
-``Backtrace_HEADER``
-  The header file needed for ``backtrace(3)``. Cached.
-  Could be forcibly set by user.
-``Backtrace_INCLUDE_DIRS``
-  The include directories needed to use ``backtrace(3)`` header.
-``Backtrace_LIBRARIES``
-  The libraries (linker flags) needed to use ``backtrace(3)``, if any.
-``Backtrace_FOUND``
-  Is set if and only if ``backtrace(3)`` support detected.
-
-The following cache variables are also available to set or use:
-
-``Backtrace_LIBRARY``
-  The external library providing backtrace, if any.
-``Backtrace_INCLUDE_DIR``
-  The directory holding the ``backtrace(3)`` header.
-
-Typical usage is to generate of header file using :command:`configure_file`
-with the contents like the following:
-
-.. code-block:: c
-
- #cmakedefine01 Backtrace_FOUND
- #if Backtrace_FOUND
- # include <${Backtrace_HEADER}>
- #endif
-
-And then reference that generated header file in actual source.
+This module checks whether ``backtrace(3)`` is supported, either through the
+standard C library (``libc``), or a separate library.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
 .. versionadded:: 3.30
 
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``Backtrace::Backtrace``
-  An interface library providing usage requirements for the found components.
+  An interface library encapsulating the usage requirements of Backtrace.  This
+  target is available only when Backtrace is found.
 
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Backtrace_INCLUDE_DIRS``
+  The include directories needed to use ``backtrace(3)`` header.
+``Backtrace_LIBRARIES``
+  The libraries (linker flags) needed to use ``backtrace(3)``, if any.
+``Backtrace_FOUND``
+  Boolean indicating whether the ``backtrace(3)`` support is available.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables are also available to set or use:
+
+``Backtrace_HEADER``
+  The header file needed for ``backtrace(3)``.  This variable allows dynamic
+  usage of the header in the project code.  It can also be overridden by the
+  user.
+``Backtrace_LIBRARY``
+  The external library providing backtrace, if any.
+``Backtrace_INCLUDE_DIR``
+  The directory holding the ``backtrace(3)`` header.
+
+Examples
+^^^^^^^^
+
+Finding Backtrace and linking it to a project target as of CMake 3.30:
+
+.. code-block:: cmake
+  :caption: CMakeLists.txt
+
+  find_package(Backtrace)
+  target_link_libraries(app PRIVATE Backtrace::Backtrace)
+
+The ``Backtrace_HEADER`` variable can be used, for example, in a configuration
+header file created by :command:`configure_file`:
+
+.. code-block:: cmake
+  :caption: CMakeLists.txt
+
+  add_library(app app.c)
+
+  find_package(Backtrace)
+  target_link_libraries(app PRIVATE Backtrace::Backtrace)
+
+  configure_file(config.h.in config.h)
+
+.. code-block:: c
+  :caption: config.h.in
+
+  #cmakedefine01 Backtrace_FOUND
+  #if Backtrace_FOUND
+  #  include <@Backtrace_HEADER@>
+  #endif
+
+.. code-block:: c
+  :caption: app.c
+
+  #include "config.h"
+
+If the project needs to support CMake 3.29 or earlier, the imported target can
+be defined manually:
+
+.. code-block:: cmake
+  :caption: CMakeLists.txt
+
+  find_package(Backtrace)
+  if(Backtrace_FOUND AND NOT TARGET Backtrace::Backtrace)
+    add_library(Backtrace::Backtrace INTERFACE IMPORTED)
+    set_target_properties(
+      Backtrace::Backtrace
+      PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${Backtrace_LIBRARIES}"
+        INTERFACE_INCLUDE_DIRECTORIES "${Backtrace_INCLUDE_DIRS}"
+    )
+  endif()
+  target_link_libraries(app PRIVATE Backtrace::Backtrace)
 #]=======================================================================]
 
 include(CMakePushCheckState)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 7436336..8ae4223 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -1409,7 +1409,7 @@
       set(_Boost_THREAD_DEPENDENCIES chrono atomic)
       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic)
       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
-    else()
+    elseif(Boost_VERSION_STRING VERSION_LESS 1.88.0)
       set(_Boost_CONTRACT_DEPENDENCIES thread chrono)
       set(_Boost_COROUTINE_DEPENDENCIES context)
       set(_Boost_FIBER_DEPENDENCIES context)
@@ -1423,7 +1423,22 @@
       set(_Boost_THREAD_DEPENDENCIES chrono atomic)
       set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic)
       set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
-      if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.88.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
+    else()
+      set(_Boost_CONTRACT_DEPENDENCIES thread chrono)
+      set(_Boost_COROUTINE_DEPENDENCIES context)
+      set(_Boost_FIBER_DEPENDENCIES context)
+      set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+      set(_Boost_JSON_DEPENDENCIES container)
+      set(_Boost_LOG_DEPENDENCIES log_setup filesystem thread regex atomic)
+      set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
+      set(_Boost_MPI_DEPENDENCIES serialization)
+      set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
+      set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
+      set(_Boost_PROCESS_DEPENDENCIES filesystem)
+      set(_Boost_THREAD_DEPENDENCIES chrono atomic)
+      set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic)
+      set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+      if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.89.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
         message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
       endif()
     endif()
@@ -1698,7 +1713,7 @@
   # _Boost_COMPONENT_HEADERS.  See the instructions at the top of
   # _Boost_COMPONENT_DEPENDENCIES.
   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
-    "1.87.0" "1.87" "1.86.0" "1.86" "1.85.0" "1.85" "1.84.0" "1.84"
+    "1.88.0" "1.88" "1.87.0" "1.87" "1.86.0" "1.86" "1.85.0" "1.85" "1.84.0" "1.84"
     "1.83.0" "1.83" "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79"
     "1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75" "1.74.0" "1.74"
     "1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69"
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index f9250ae..61a5fb3 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -5,35 +5,39 @@
 FindBullet
 ----------
 
-Try to find the Bullet physics engine
+Finds the Bullet physics engine.
 
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
-::
+``Bullet_FOUND``
+  Boolean true if Bullet was found.  For backward compatibility, the
+  ``BULLET_FOUND`` variable is also set to the same value.
+``BULLET_INCLUDE_DIRS``
+  The Bullet include directories.
+``BULLET_LIBRARIES``
+  Libraries needed to link to Bullet.  By default, all Bullet components
+  (Dynamics, Collision, LinearMath, and SoftBody) are added.
 
-  This module defines the following variables
+Hints
+^^^^^
 
+This module accepts the following variables:
 
+``BULLET_ROOT``
+  Can be set to Bullet install path or Windows build path to specify where to
+  find Bullet.
 
-::
+Examples
+^^^^^^^^
 
-  BULLET_FOUND - Was bullet found
-  BULLET_INCLUDE_DIRS - the Bullet include directories
-  BULLET_LIBRARIES - Link to this, by default it includes
-                     all bullet components (Dynamics,
-                     Collision, LinearMath, & SoftBody)
+Finding Bullet:
 
+.. code-block:: cmake
 
-
-::
-
-  This module accepts the following variables
-
-
-
-::
-
-  BULLET_ROOT - Can be set to bullet install path or Windows build path
+  find_package(Bullet)
 #]=======================================================================]
 
 macro(_FIND_BULLET_LIBRARY _var)
@@ -85,7 +89,7 @@
     BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
 
 set(BULLET_INCLUDE_DIRS ${BULLET_INCLUDE_DIR})
-if(BULLET_FOUND)
+if(Bullet_FOUND)
    _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_DYNAMICS_LIBRARY)
    _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_COLLISION_LIBRARY)
    _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_MATH_LIBRARY)
diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake
index 4d72897..af0e6b6 100644
--- a/Modules/FindCABLE.cmake
+++ b/Modules/FindCABLE.cmake
@@ -5,25 +5,58 @@
 FindCABLE
 ---------
 
-Find CABLE
+.. versionchanged:: 4.1
+  This module is available only if policy :policy:`CMP0191` is not set to ``NEW``.
 
-This module finds if CABLE is installed and determines where the
-include files and libraries are.  This code sets the following
-variables:
+Finds the CABLE installation and determines its include paths and libraries.
 
-::
+Package called CABLE (CABLE Automates Bindings for Language Extension) was
+initially developed by Kitware to generate bindings to C++ classes for use in
+interpreted languages, such as Tcl.  It worked in conjunction with packages like
+GCC-XML.  The CABLE package has since been superseded by the ITK CableSwig
+package.
 
-  CABLE             the path to the cable executable
-  CABLE_TCL_LIBRARY the path to the Tcl wrapper library
-  CABLE_INCLUDE_DIR the path to the include directory
+.. note::
 
+  When building wrappers for interpreted languages, these packages are no longer
+  necessary.  The CastXML package now serves as the recommended tool for this
+  purpose and can be found directly using the :command:`find_program` command.
 
+Cache Variables
+^^^^^^^^^^^^^^^
 
-To build Tcl wrappers, you should add shared library and link it to
-${CABLE_TCL_LIBRARY}.  You should also add ${CABLE_INCLUDE_DIR} as an
-include directory.
+The following cache variables may be set when using this module:
+
+``CABLE``
+  Path to the ``cable`` executable.
+``CABLE_INCLUDE_DIR``
+  Path to the include directory.
+``CABLE_TCL_LIBRARY``
+  Path to the Tcl wrapper library.
+
+Examples
+^^^^^^^^
+
+Finding CABLE to build Tcl wrapper, by linking library and adding the include
+directories:
+
+.. code-block:: cmake
+
+  find_package(CABLE)
+  target_link_libraries(tcl_wrapper_target PRIVATE ${CABLE_TCL_LIBRARY})
+  target_include_directories(tcl_wrapper_target PRIVATE ${CABLE_INCLUDE_DIR})
 #]=======================================================================]
 
+cmake_policy(GET CMP0191 _FindCABLE_CMP0191)
+if(_FindCABLE_CMP0191 STREQUAL "NEW")
+  message(FATAL_ERROR "The FindCABLE module has been removed by policy CMP0191.")
+endif()
+
+if(_FindCABLE_testing)
+  set(_FindCABLE_included TRUE)
+  return()
+endif()
+
 if(NOT CABLE)
   find_path(CABLE_BUILD_DIR cableVersion.h)
 endif()
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 4323fda..bceb615 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -891,21 +891,22 @@
 
 if(CMAKE_CROSSCOMPILING)
   set(CUDA_TOOLKIT_ROOT $ENV{CUDA_TOOLKIT_ROOT})
+  # Keep in sync with equivalent table in FindCUDAToolkit!
   if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
     # Support for NVPACK
-    set (CUDA_TOOLKIT_TARGET_NAMES "armv7-linux-androideabi")
+    set(CUDA_TOOLKIT_TARGET_NAMES "armv7-linux-androideabi")
   elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
-    # Support for arm cross compilation
     set(CUDA_TOOLKIT_TARGET_NAMES "armv7-linux-gnueabihf")
   elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
-    # Support for aarch64 cross compilation
-    if (ANDROID_ARCH_NAME STREQUAL "arm64")
+    if(ANDROID_ARCH_NAME STREQUAL "arm64")
       set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-linux-androideabi")
     elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
       set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-qnx")
     else()
       set(CUDA_TOOLKIT_TARGET_NAMES "aarch64-linux" "sbsa-linux")
     endif()
+  elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+    set(CUDA_TOOLKIT_TARGET_NAMES "x86_64-linux")
   endif()
 
   foreach(CUDA_TOOLKIT_TARGET_NAME IN LISTS CUDA_TOOLKIT_TARGET_NAMES)
@@ -1624,7 +1625,7 @@
       # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g
       set(_cuda_fix_g3 FALSE)
 
-      if(CMAKE_COMPILER_IS_GNUCC)
+      if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
         if (CUDA_VERSION VERSION_LESS  "3.0" OR
             CUDA_VERSION VERSION_EQUAL "4.1" OR
             CUDA_VERSION VERSION_EQUAL "4.2"
diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake
index e161f2f..b00cd26 100644
--- a/Modules/FindCUDAToolkit.cmake
+++ b/Modules/FindCUDAToolkit.cmake
@@ -110,31 +110,29 @@
 This module defines :prop_tgt:`IMPORTED` targets for each
 of the following libraries that are part of the CUDAToolkit:
 
-- :ref:`CUDA Runtime Library<cuda_toolkit_rt_lib>`
-- :ref:`CUDA Driver Library<cuda_toolkit_driver_lib>`
-- :ref:`cuBLAS<cuda_toolkit_cuBLAS>`
-- :ref:`cuDLA<cuda_toolkit_cuDLA>`
-- :ref:`cuFile<cuda_toolkit_cuFile>`
-- :ref:`cuFFT<cuda_toolkit_cuFFT>`
-- :ref:`cuRAND<cuda_toolkit_cuRAND>`
-- :ref:`cuSOLVER<cuda_toolkit_cuSOLVER>`
-- :ref:`cuSPARSE<cuda_toolkit_cuSPARSE>`
-- :ref:`cuPTI<cuda_toolkit_cupti>`
-- :ref:`NPP<cuda_toolkit_NPP>`
-- :ref:`nvBLAS<cuda_toolkit_nvBLAS>`
-- :ref:`nvGRAPH<cuda_toolkit_nvGRAPH>`
-- :ref:`nvJPEG<cuda_toolkit_nvJPEG>`
-- :ref:`nvidia-ML<cuda_toolkit_nvML>`
-- :ref:`nvPTX Compiler<cuda_toolkit_nvptx>`
-- :ref:`nvRTC<cuda_toolkit_nvRTC>`
-- :ref:`nvJitLink<cuda_toolkit_nvJitLink>`
-- :ref:`nvFatBin<cuda_toolkit_nvfatbin>`
-- :ref:`nvToolsExt<cuda_toolkit_nvToolsExt>`
-- :ref:`nvtx3<cuda_toolkit_nvtx3>`
-- :ref:`OpenCL<cuda_toolkit_opencl>`
-- :ref:`cuLIBOS<cuda_toolkit_cuLIBOS>`
-
-.. _`cuda_toolkit_rt_lib`:
+- `CUDA Runtime Library`_
+- `CUDA Driver Library`_
+- `cuBLAS`_
+- `cuDLA`_
+- `cuFile`_
+- `cuFFT`_
+- `cuRAND`_
+- `cuSOLVER`_
+- `cuSPARSE`_
+- `cuPTI`_
+- `NPP`_
+- `nvBLAS`_
+- `nvGRAPH`_
+- `nvJPEG`_
+- `nvidia-ML`_
+- `nvPTX Compiler`_
+- `nvRTC`_
+- `nvJitLink`_
+- `nvFatBin`_
+- `nvToolsExt`_
+- `nvtx3`_
+- `OpenCL`_
+- `cuLIBOS`_
 
 CUDA Runtime Library
 """"""""""""""""""""
@@ -147,8 +145,6 @@
 - ``CUDA::cudart``
 - ``CUDA::cudart_static``
 
-.. _`cuda_toolkit_driver_lib`:
-
 CUDA Driver Library
 """"""""""""""""""""
 
@@ -159,12 +155,10 @@
 
 - ``CUDA::cuda_driver``
 
-.. _`cuda_toolkit_cuBLAS`:
-
 cuBLAS
 """"""
 
-The `cuBLAS <https://docs.nvidia.com/cuda/cublas>`_ library.
+The `CUDA Basic Linear Algebra Subroutine`_ library.
 
 Targets Created:
 
@@ -173,27 +167,27 @@
 - ``CUDA::cublasLt`` starting in CUDA 10.1
 - ``CUDA::cublasLt_static`` starting in CUDA 10.1
 
-.. _`cuda_toolkit_cuDLA`:
+.. _`CUDA Basic Linear Algebra Subroutine`: https://docs.nvidia.com/cuda/cublas
 
 cuDLA
 """"""
 
 .. versionadded:: 3.27
 
-The NVIDIA Tegra Deep Learning Accelerator `cuDLA <https://docs.nvidia.com/cuda/cublas>`_ library.
+The `NVIDIA Tegra Deep Learning Accelerator`_ library.
 
 Targets Created:
 
 - ``CUDA::cudla`` starting in CUDA 11.6
 
-.. _`cuda_toolkit_cuFile`:
+.. _`NVIDIA Tegra Deep Learning Accelerator`: https://docs.nvidia.com/cuda/cuda-for-tegra-appnote#cudla
 
 cuFile
 """"""
 
 .. versionadded:: 3.25
 
-The NVIDIA GPUDirect Storage `cuFile <https://docs.nvidia.com/gpudirect-storage/api-reference-guide>`_ library.
+The `NVIDIA GPUDirect Storage cuFile`_ library.
 
 Targets Created:
 
@@ -202,12 +196,12 @@
 - ``CUDA::cuFile_rdma`` starting in CUDA 11.4
 - ``CUDA::cuFile_rdma_static`` starting in CUDA 11.4
 
-.. _`cuda_toolkit_cuFFT`:
+.. _`NVIDIA GPUDirect Storage cuFile`: https://docs.nvidia.com/gpudirect-storage/api-reference-guide
 
 cuFFT
 """""
 
-The `cuFFT <https://docs.nvidia.com/cuda/cufft>`_ library.
+The `CUDA Fast Fourier Transform`_ library.
 
 Targets Created:
 
@@ -217,46 +211,48 @@
 - ``CUDA::cufft_static_nocallback`` starting in CUDA 9.2, requires CMake 3.23+
 - ``CUDA::cufftw_static``
 
+.. _`CUDA Fast Fourier Transform`: https://docs.nvidia.com/cuda/cufft
+
 cuRAND
 """"""
 
-The `cuRAND <https://docs.nvidia.com/cuda/curand>`_ library.
+The `CUDA random number generation`_ library.
 
 Targets Created:
 
 - ``CUDA::curand``
 - ``CUDA::curand_static``
 
-.. _`cuda_toolkit_cuSOLVER`:
+.. _`CUDA random number generation`: https://docs.nvidia.com/cuda/curand
 
 cuSOLVER
 """"""""
 
-The `cuSOLVER <https://docs.nvidia.com/cuda/cusolver>`_ library.
+A `GPU accelerated linear system solver`_ library.
 
 Targets Created:
 
 - ``CUDA::cusolver``
 - ``CUDA::cusolver_static``
 
-.. _`cuda_toolkit_cuSPARSE`:
+.. _`GPU accelerated linear system solver`: https://docs.nvidia.com/cuda/cusolver
 
 cuSPARSE
 """"""""
 
-The `cuSPARSE <https://docs.nvidia.com/cuda/cusparse>`_ library.
+The `CUDA sparse matrix`_ library.
 
 Targets Created:
 
 - ``CUDA::cusparse``
 - ``CUDA::cusparse_static``
 
-.. _`cuda_toolkit_cupti`:
+.. _`CUDA sparse matrix`: https://docs.nvidia.com/cuda/cusparse
 
 cupti
 """""
 
-The `NVIDIA CUDA Profiling Tools Interface <https://developer.nvidia.com/cupti>`_.
+The `NVIDIA CUDA Profiling Tools Interface`_.
 
 Targets Created:
 
@@ -270,12 +266,12 @@
   - ``CUDA::nvperf_target``       starting in CUDA 10.2
   - ``CUDA::pcsamplingutil``      starting in CUDA 11.3
 
-.. _`cuda_toolkit_NPP`:
+.. _`NVIDIA CUDA Profiling Tools Interface`: https://developer.nvidia.com/cupti
 
 NPP
 """
 
-The `NPP <https://docs.nvidia.com/cuda/npp>`_ libraries.
+The `NVIDIA 2D Image and Signal Processing Performance Primitives`_ libraries.
 
 Targets Created:
 
@@ -295,7 +291,7 @@
   - ``CUDA::nppicc_static``
 
 - `nppicom`: JPEG compression and decompression functions in `nppi_compression_functions.h`
-  Removed starting in CUDA 11.0, use :ref:`nvJPEG<cuda_toolkit_nvJPEG>` instead.
+  Removed starting in CUDA 11.0, use `nvJPEG`_ instead.
 
   - ``CUDA::nppicom``
   - ``CUDA::nppicom_static``
@@ -340,24 +336,24 @@
   - ``CUDA::npps``
   - ``CUDA::npps_static``
 
-.. _`cuda_toolkit_nvBLAS`:
+.. _`NVIDIA 2D Image and Signal Processing Performance Primitives`: https://docs.nvidia.com/cuda/npp
 
 nvBLAS
 """"""
 
-The `nvBLAS <https://docs.nvidia.com/cuda/nvblas>`_ libraries.
+The `GPU-accelerated drop-in BLAS`_ library.
 This is a shared library only.
 
 Targets Created:
 
 - ``CUDA::nvblas``
 
-.. _`cuda_toolkit_nvGRAPH`:
+.. _`GPU-accelerated drop-in BLAS`: https://docs.nvidia.com/cuda/nvblas
 
 nvGRAPH
 """""""
 
-The `nvGRAPH <https://web.archive.org/web/20201111171403/https://docs.nvidia.com/cuda/nvgraph/index.html>`_ library.
+A `GPU-accelerated graph analytics`_ library.
 Removed starting in CUDA 11.0
 
 Targets Created:
@@ -365,13 +361,12 @@
 - ``CUDA::nvgraph``
 - ``CUDA::nvgraph_static``
 
-
-.. _`cuda_toolkit_nvJPEG`:
+.. _`GPU-accelerated graph analytics`: https://docs.nvidia.com/cuda/archive/10.0/nvgraph
 
 nvJPEG
 """"""
 
-The `nvJPEG <https://docs.nvidia.com/cuda/nvjpeg>`_ library.
+A `GPU-accelerated JPEG codec`_ library.
 Introduced in CUDA 10.
 
 Targets Created:
@@ -379,15 +374,15 @@
 - ``CUDA::nvjpeg``
 - ``CUDA::nvjpeg_static``
 
-.. _`cuda_toolkit_nvPTX`:
+.. _`GPU-accelerated JPEG codec`: https://docs.nvidia.com/cuda/nvjpeg
 
 nvPTX Compiler
 """"""""""""""
 
 .. versionadded:: 3.25
 
-The `nvPTX <https://docs.nvidia.com/cuda/ptx-compiler-api>`_ (PTX Compilation) library.
-The PTX Compiler APIs are a set of APIs which can be used to compile a PTX program into GPU assembly code.
+The `PTX Compiler APIs`_.
+These are a set of APIs which can be used to compile a PTX program into GPU assembly code.
 Introduced in CUDA 11.1
 This is a static library only.
 
@@ -395,12 +390,12 @@
 
 - ``CUDA::nvptxcompiler_static`` starting in CUDA 11.1
 
-.. _`cuda_toolkit_nvRTC`:
+.. _`PTX Compiler APIs`: https://docs.nvidia.com/cuda/ptx-compiler-api
 
 nvRTC
 """""
 
-The `nvRTC <https://docs.nvidia.com/cuda/nvrtc>`_ (Runtime Compilation) library.
+A `runtime compilation library for CUDA`_.
 
 Targets Created:
 
@@ -412,38 +407,38 @@
   - ``CUDA::nvrtc_static`` starting in CUDA 11.5
   - ``CUDA::nvrtc_builtins_static`` starting in CUDA 11.5
 
-.. _`cuda_toolkit_nvjitlink`:
+.. _`runtime compilation library for CUDA`: https://docs.nvidia.com/cuda/nvrtc
 
 nvJitLink
 """""""""
 
-The `nvJItLink <https://docs.nvidia.com/cuda/>`_ (Runtime LTO Linking) library.
+The `JIT Link APIs`_.
 
 Targets Created:
 
 - ``CUDA::nvJitLink`` starting in CUDA 12.0
 - ``CUDA::nvJitLink_static``  starting in CUDA 12.0
 
-.. _`cuda_toolkit_nvfatbin`:
+.. _`JIT Link APIs`: https://docs.nvidia.com/cuda/nvjitlink
 
 nvFatBin
 """""""""
 
 .. versionadded:: 3.30
 
-The `nvFatBin <https://docs.nvidia.com/cuda/>`_ (Runtime fatbin creation) library.
+The `Fatbin Creator APIs`_.
 
 Targets Created:
 
 - ``CUDA::nvfatbin`` starting in CUDA 12.4
 - ``CUDA::nvfatbin_static``  starting in CUDA 12.4
 
-.. _`cuda_toolkit_nvml`:
+.. _`Fatbin Creator APIs`: https://docs.nvidia.com/cuda/nvfatbin
 
 nvidia-ML
 """""""""
 
-The `NVIDIA Management Library <https://developer.nvidia.com/management-library-nvml>`_.
+The `NVIDIA Management Library`_.
 
 Targets Created:
 
@@ -453,47 +448,62 @@
 .. versionadded:: 3.31
   Added ``CUDA::nvml_static``.
 
-.. _`cuda_toolkit_nvToolsExt`:
+.. _`NVIDIA Management Library`: https://developer.nvidia.com/management-library-nvml
+
+.. _`FindCUDAToolkit_nvToolsExt`:
 
 nvToolsExt
 """"""""""
 
-.. deprecated:: 3.25 With CUDA 10.0+, use :ref:`nvtx3 <cuda_toolkit_nvtx3>`.
+.. deprecated:: 3.25
 
-The `NVIDIA Tools Extension <https://docs.nvidia.com/nvtx/>`_.
+  With CUDA 10.0+, use `nvtx3`_.
+  Starting in CUDA 12.9 the `nvToolsExt` library no longer exists
+
+The `legacy NVIDIA Tools Extension`_.
 This is a shared library only.
 
 Targets Created:
 
 - ``CUDA::nvToolsExt``
 
-.. _`cuda_toolkit_nvtx3`:
+.. _`legacy NVIDIA Tools Extension`: https://docs.nvidia.com/cuda/archive/9.0/profiler-users-guide#nvtx
+
+.. _`FindCUDAToolkit_nvtx3`:
 
 nvtx3
 """""
 
 .. versionadded:: 3.25
 
-The header-only `NVIDIA Tools Extension Library <https://nvidia.github.io/NVTX/doxygen>`_.
+The header-only `NVIDIA Tools Extension`_ library.
 Introduced in CUDA 10.0.
 
 Targets created:
 
 - ``CUDA::nvtx3``
 
-.. _`cuda_toolkit_opencl`:
+
+- ``CUDA::nvtx3_interop``
+
+  .. versionadded:: 4.1
+
+  This is provided by CUDA 12.9 and above for use by languages that
+  cannot consume C++ header-only libraries, such as ``Fortran``.
+
+.. _`NVIDIA Tools Extension`: https://nvidia.github.io/NVTX/doxygen
 
 OpenCL
 """"""
 
-The `NVIDIA OpenCL Library <https://developer.nvidia.com/opencl>`_.
+The `NVIDIA Open Computing Language`_ library.
 This is a shared library only.
 
 Targets Created:
 
 - ``CUDA::OpenCL``
 
-.. _`cuda_toolkit_cuLIBOS`:
+.. _`NVIDIA Open Computing Language`: https://developer.nvidia.com/opencl
 
 cuLIBOS
 """""""
@@ -509,10 +519,6 @@
 
 **Note**: direct usage of this target by consumers should not be necessary.
 
-.. _`cuda_toolkit_cuRAND`:
-
-
-
 Result variables
 ^^^^^^^^^^^^^^^^
 
@@ -951,12 +957,25 @@
 
 # Find target directory when crosscompiling.
 if(CMAKE_CROSSCOMPILING)
-  if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a")
+  # When a language is enabled we can use its compiler's target architecture.
+  if(CMAKE_CUDA_COMPILER_LOADED AND CMAKE_CUDA_COMPILER_ARCHITECTURE_ID)
+    set(_CUDA_TARGET_PROCESSOR "${CMAKE_CUDA_COMPILER_ARCHITECTURE_ID}")
+  elseif(CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
+    set(_CUDA_TARGET_PROCESSOR "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
+  elseif(CMAKE_C_COMPILER_LOADED AND CMAKE_C_COMPILER_ARCHITECTURE_ID)
+    set(_CUDA_TARGET_PROCESSOR "${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
+  elseif(CMAKE_SYSTEM_PROCESSOR)
+    set(_CUDA_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+  else()
+    message(FATAL_ERROR "Cross-compiling with the CUDA toolkit requires CMAKE_SYSTEM_PROCESSOR to be set.")
+  endif()
+  # Keep in sync with equivalent table in CMakeDetermineCUDACompiler and FindCUDA!
+  if(_CUDA_TARGET_PROCESSOR STREQUAL "armv7-a")
     # Support for NVPACK
     set(CUDAToolkit_TARGET_NAMES "armv7-linux-androideabi")
-  elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
+  elseif(_CUDA_TARGET_PROCESSOR MATCHES "arm")
     set(CUDAToolkit_TARGET_NAMES "armv7-linux-gnueabihf")
-  elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
+  elseif(_CUDA_TARGET_PROCESSOR MATCHES "aarch64")
     if(ANDROID_ARCH_NAME STREQUAL "arm64")
       set(CUDAToolkit_TARGET_NAMES "aarch64-linux-androideabi")
     elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
@@ -964,9 +983,10 @@
     else()
       set(CUDAToolkit_TARGET_NAMES "aarch64-linux" "sbsa-linux")
     endif()
-  elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+  elseif(_CUDA_TARGET_PROCESSOR STREQUAL "x86_64")
     set(CUDAToolkit_TARGET_NAMES "x86_64-linux")
   endif()
+  unset(_CUDA_TARGET_PROCESSOR)
 
   foreach(CUDAToolkit_TARGET_NAME IN LISTS CUDAToolkit_TARGET_NAMES)
     if(EXISTS "${CUDAToolkit_ROOT_DIR}/targets/${CUDAToolkit_TARGET_NAME}")
@@ -1383,26 +1403,7 @@
   _CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml)
   _CUDAToolkit_find_and_add_import_lib(nvml_static ONLY_SEARCH_FOR libnvidia-ml.a libnvml.a)
 
-  if(WIN32)
-    # nvtools can be installed outside the CUDA toolkit directory
-    # so prefer the NVTOOLSEXT_PATH windows only environment variable
-    # In addition on windows the most common name is nvToolsExt64_1
-    find_library(CUDA_nvToolsExt_LIBRARY
-      NAMES nvToolsExt64_1 nvToolsExt64 nvToolsExt
-      PATHS ENV NVTOOLSEXT_PATH
-            ENV CUDA_PATH
-      PATH_SUFFIXES lib/x64 lib
-    )
-  endif()
-  _CUDAToolkit_find_and_add_import_lib(nvToolsExt ALT nvToolsExt64)
-
   if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
-    # nvToolsExt is deprecated since nvtx3 introduction.
-    # Warn only if the project requires a sufficiently new CMake to make migration possible.
-    if(TARGET CUDA::nvToolsExt AND CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER_EQUAL 3.25)
-      set_property(TARGET CUDA::nvToolsExt PROPERTY DEPRECATION "nvToolsExt has been superseded by nvtx3 since CUDA 10.0 and CMake 3.25. Use CUDA::nvtx3 and include <nvtx3/nvToolsExt.h> instead.")
-    endif()
-
     # Header-only variant. Uses dlopen().
     if(NOT TARGET CUDA::nvtx3)
       add_library(CUDA::nvtx3 INTERFACE IMPORTED)
@@ -1410,6 +1411,35 @@
       target_link_libraries(CUDA::nvtx3 INTERFACE ${CMAKE_DL_LIBS})
     endif()
   endif()
+  if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.9)
+    if(NOT TARGET CUDA::nvtx3_interop)
+      _CUDAToolkit_find_and_add_import_lib(nvtx3_interop ALT nvtx3interop)
+    endif()
+  endif()
+
+  # nvToolsExt is removed starting in 12.9
+  if(CUDAToolkit_VERSION VERSION_LESS 12.9)
+    if(WIN32)
+      # nvtools can be installed outside the CUDA toolkit directory
+      # so prefer the NVTOOLSEXT_PATH windows only environment variable
+      # In addition on windows the most common name is nvToolsExt64_1
+      find_library(CUDA_nvToolsExt_LIBRARY
+        NAMES nvToolsExt64_1 nvToolsExt64 nvToolsExt
+        PATHS ENV NVTOOLSEXT_PATH
+              ENV CUDA_PATH
+        PATH_SUFFIXES lib/x64 lib
+      )
+    endif()
+    _CUDAToolkit_find_and_add_import_lib(nvToolsExt ALT nvToolsExt64)
+
+    if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.0)
+      # nvToolsExt is deprecated since nvtx3 introduction.
+      # Warn only if the project requires a sufficiently new CMake to make migration possible.
+      if(TARGET CUDA::nvToolsExt AND CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER_EQUAL 3.25)
+        set_property(TARGET CUDA::nvToolsExt PROPERTY DEPRECATION "nvToolsExt has been superseded by nvtx3 since CUDA 10.0 and CMake 3.25. Use CUDA::nvtx3 and include <nvtx3/nvToolsExt.h> instead.")
+      endif()
+    endif()
+  endif()
 
   _CUDAToolkit_find_and_add_import_lib(OpenCL)
 endif()
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index d4b4b6b..1488412 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -5,26 +5,62 @@
 FindCURL
 --------
 
-Find the native CURL headers and libraries.
+Finds the native curl installation (include directories and libraries) for
+transferring data with URLS.
+
+.. versionadded:: 3.17
+  If curl is built using its CMake-based build system, it will provide its own
+  CMake Package Configuration file (``CURLConfig.cmake``) for use with the
+  :command:`find_package` command in *config mode*.  By default, this module
+  searches for this file and, if found, returns the results without further
+  action.  If the upstream configuration file is not found, this module falls
+  back to *module mode* and searches standard locations.
+
+.. versionadded:: 3.13
+  Debug and Release library variants are found separately.
+
+Components
+^^^^^^^^^^
 
 .. versionadded:: 3.14
-  This module accept optional COMPONENTS to check supported features and
-  protocols:
 
-::
+This module supports optional components to detect the protocols and features
+available in the installed curl (these can vary based on the curl version)::
 
-  PROTOCOLS: ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3
-             POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP
-  FEATURES:  SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO
-             Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy
+  Protocols: DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS IPFS IPNS
+             LDAP LDAPS MQTT POP3 POP3S RTMP RTMPS RTSP SCP SFTP SMB SMBS SMTP
+             SMTPS TELNET TFTP WS WSS
+  Features:  alt-svc asyn-rr AsynchDNS brotli CAcert Debug ECH gsasl GSS-API
+             HSTS HTTP2 HTTP3 HTTPS-proxy HTTPSRR IDN IPv6 Kerberos Largefile
+             libz MultiSSL NTLM NTLM_WB PSL SPNEGO SSL SSLS-EXPORT SSPI
+             threadsafe TLS-SRP TrackMemory Unicode UnixSockets zstd
+
+Components can be specified with the :command:`find_package` command as required
+for curl to be considered found:
+
+.. code-block:: cmake
+
+  find_package(CURL [COMPONENTS <protocols>... <features>...])
+
+Or to check for them optionally, allowing conditional handling in the code:
+
+.. code-block:: cmake
+
+  find_package(CURL [OPTIONAL_COMPONENTS <protocols>... <features>...])
+
+Refer to the curl documentation for more information on supported protocols and
+features.  Component names are case-sensitive and follow the upstream curl
+naming conventions.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.12
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
-curl has been found.
+``CURL::libcurl``
+  .. versionadded:: 3.12
+
+  Target encapsulating the curl usage requirements, available if curl is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
@@ -32,51 +68,95 @@
 This module defines the following variables:
 
 ``CURL_FOUND``
-  "True" if ``curl`` found.
-
-``CURL_INCLUDE_DIRS``
-  where to find ``curl``/``curl.h``, etc.
-
-``CURL_LIBRARIES``
-  List of libraries when using ``curl``.
+  Boolean indicating whether the (requested version of) curl and all required
+  components are found.
 
 ``CURL_VERSION``
   .. versionadded:: 4.0
 
-  The version of ``curl`` found.
-  This supersedes ``CURL_VERSION_STRING``.
+  The version of curl found.  This supersedes ``CURL_VERSION_STRING``.
 
-``CURL_VERSION_STRING``
-  The version of ``curl`` found.
-  Superseded by ``CURL_VERSION``.
+``CURL_<component>_FOUND``
+  .. versionadded:: 3.14
 
-.. versionadded:: 3.13
-  Debug and Release variants are found separately.
+  Boolean indicating whether the specified component (curl protocol or feature)
+  is found.
 
-CURL CMake
-^^^^^^^^^^
+``CURL_INCLUDE_DIRS``
+  Include directories containing the ``curl/curl.h`` and other headers needed to
+  use curl.
 
-.. versionadded:: 3.17
+  .. note::
 
-If CURL was built using the CMake buildsystem then it provides its own
-``CURLConfig.cmake`` file for use with the :command:`find_package` command's
-config mode. This module looks for this file and, if found,
-returns its results with no further action.
+    When curl is found via *config mode*, this variable is available only with
+    curl version 8.9 or newer.
 
-Set ``CURL_NO_CURL_CMAKE`` to ``ON`` to disable this search.
+``CURL_LIBRARIES``
+  List of libraries needed to link against to use curl.
+
+  .. note::
+
+    When curl is found via *module mode*, this is a list of library file paths.
+    In *config mode*, this variable is available only with curl version 8.9 or
+    newer and contains a list of imported targets.
 
 Hints
 ^^^^^
 
-``CURL_USE_STATIC_LIBS``
+This module accepts the following variables:
 
+``CURL_NO_CURL_CMAKE``
+  .. versionadded:: 3.17
+
+  Set this variable to ``TRUE`` to disable searching for curl via *config mode*.
+
+``CURL_USE_STATIC_LIBS``
   .. versionadded:: 3.28
 
-  Set to ``TRUE`` to use static libraries.
+  Set this variable to ``TRUE`` to use static libraries.  This is meaningful
+  only when curl is not found via *config mode*.
 
-  This is meaningful only when CURL is not found via its
-  CMake Package Configuration file.
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
+The following variables are provided for backward compatibility:
+
+``CURL_VERSION_STRING``
+  .. deprecated:: 4.0
+    Superseded by ``CURL_VERSION``.
+
+  The version of curl found.
+
+Examples
+^^^^^^^^
+
+Finding the curl library and specifying the required minimum version:
+
+.. code-block:: cmake
+
+  find_package(CURL 7.61.0)
+
+Finding the curl library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(CURL)
+  target_link_libraries(project_target PRIVATE CURL::libcurl)
+
+Using components to check if the found curl supports specific protocols or
+features:
+
+.. code-block:: cmake
+
+  find_package(CURL OPTIONAL_COMPONENTS HTTPS SSL)
+
+  if(CURL_HTTPS_FOUND)
+    # curl supports the HTTPS protocol
+  endif()
+
+  if(CURL_SSL_FOUND)
+    # curl has SSL feature enabled
+  endif()
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -163,11 +243,10 @@
 endif()
 
 if(CURL_FIND_COMPONENTS)
-  set(CURL_KNOWN_PROTOCOLS ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP)
-  set(CURL_KNOWN_FEATURES  SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy)
-  foreach(component IN LISTS CURL_KNOWN_PROTOCOLS CURL_KNOWN_FEATURES)
+  foreach(component IN LISTS CURL_FIND_COMPONENTS)
     set(CURL_${component}_FOUND FALSE)
   endforeach()
+
   if(NOT PC_CURL_FOUND)
     find_program(CURL_CONFIG_EXECUTABLE NAMES curl-config)
     if(CURL_CONFIG_EXECUTABLE)
@@ -186,23 +265,17 @@
                       OUTPUT_STRIP_TRAILING_WHITESPACE)
       string(REPLACE "\n" ";" CURL_SUPPORTED_PROTOCOLS "${CURL_CONFIG_PROTOCOLS_STRING}")
     endif()
-
   endif()
+
   foreach(component IN LISTS CURL_FIND_COMPONENTS)
-    list(FIND CURL_KNOWN_PROTOCOLS ${component} _found)
+    list(FIND CURL_SUPPORTED_PROTOCOLS ${component} _found)
+
     if(NOT _found EQUAL -1)
-      list(FIND CURL_SUPPORTED_PROTOCOLS ${component} _found)
-      if(NOT _found EQUAL -1)
-        set(CURL_${component}_FOUND TRUE)
-      elseif(CURL_FIND_REQUIRED)
-        message(FATAL_ERROR "CURL: Required protocol ${component} is not found")
-      endif()
+      set(CURL_${component}_FOUND TRUE)
     else()
       list(FIND CURL_SUPPORTED_FEATURES ${component} _found)
       if(NOT _found EQUAL -1)
         set(CURL_${component}_FOUND TRUE)
-      elseif(CURL_FIND_REQUIRED)
-        message(FATAL_ERROR "CURL: Required feature ${component} is not found")
       endif()
     endif()
   endforeach()
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
index 9ae6d8c..d50a758 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -5,23 +5,35 @@
 FindCVS
 -------
 
-Find the Concurrent Versions System (CVS).
+Finds the Concurrent Versions System (CVS).
 
-The module defines the following variables:
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-   CVS_EXECUTABLE - path to cvs command line client
-   CVS_FOUND - true if the command line client was found
+``CVS_FOUND``
+  True if the command-line client was found.
 
-Example usage:
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``CVS_EXECUTABLE``
+  Path to ``cvs`` command-line client.
+
+Examples
+^^^^^^^^
+
+Finding CVS and executing it in a process:
 
 .. code-block:: cmake
 
-   find_package(CVS)
-   if(CVS_FOUND)
-     message("CVS found: ${CVS_EXECUTABLE}")
-   endif()
+  find_package(CVS)
+  if(CVS_FOUND)
+    execute_process(COMMAND ${CVS_EXECUTABLE} --help)
+  endif()
 #]=======================================================================]
 
 # CVSNT
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index f517f3b..1d89c60 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -5,18 +5,38 @@
 FindCoin3D
 ----------
 
-Find Coin3D (Open Inventor)
+Finds Coin3D (Open Inventor).
 
 Coin3D is an implementation of the Open Inventor API.  It provides
 data structures and algorithms for 3D visualization.
 
-This module defines the following variables
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  COIN3D_FOUND         - system has Coin3D - Open Inventor
-  COIN3D_INCLUDE_DIRS  - where the Inventor include directory can be found
-  COIN3D_LIBRARIES     - Link to this to use Coin3D
+``Coin3D_FOUND``
+  True if Coin3D, Open Inventor was found.  For backward compatibility, the
+  ``COIN3D_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``COIN3D_INCLUDE_DIRS``
+  Directory containing the Open Inventor header files (``Inventor/So.h``).
+``COIN3D_LIBRARIES``
+  Coin3D libraries required for linking.
+
+Examples
+^^^^^^^^
+
+Finding Coin3D:
+
+.. code-block:: cmake
+
+  find_package(Coin3D)
 #]=======================================================================]
 
 if (WIN32)
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index c5355f1..871a809 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -5,40 +5,60 @@
 FindCups
 --------
 
-Find the Common UNIX Printing System (CUPS).
-
-Set ``CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE`` to ``TRUE`` if you need a version which
-features this function (i.e. at least ``1.1.19``)
+Finds the Common UNIX Printing System (CUPS).
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.15
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``Cups::Cups``, if Cups has
-been found.
+``Cups::Cups``
+  .. versionadded:: 3.15
 
-Result variables
+  Target encapsulating the CUPS usage requirements, available only if CUPS is
+  found.
+
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
-``CUPS_FOUND``
-  true if CUPS headers and libraries were found
+``Cups_FOUND``
+  Boolean indicating whether the CUPS is found.  For backward compatibility, the
+  ``CUPS_FOUND`` variable is also set to the same value.
 ``CUPS_INCLUDE_DIRS``
-  the directory containing the Cups headers
-``CUPS_LIBRARIES``
-  the libraries to link against to use CUPS.
+  Include directories needed for using CUPS.
 ``CUPS_VERSION_STRING``
-  the version of CUPS found (since CMake 2.8.8)
+  The version of CUPS found.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``CUPS_INCLUDE_DIR``
-  the directory containing the Cups headers
+  The directory containing the CUPS headers.
+``CUPS_LIBRARIES``
+  Libraries needed to link against to use CUPS.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE``
+  Set this variable to ``TRUE`` to require CUPS version which features the
+  ``ippDeleteAttribute()`` function (i.e. at least of CUPS ``1.1.19``).
+
+Examples
+^^^^^^^^
+
+Finding CUPS and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Cups)
+  target_link_libraries(project_target PRIVATE Cups::Cups)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -92,7 +112,7 @@
 
 mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES)
 
-if (CUPS_FOUND)
+if (Cups_FOUND)
     set(CUPS_INCLUDE_DIRS "${CUPS_INCLUDE_DIR}")
     if (NOT TARGET Cups::Cups)
         add_library(Cups::Cups INTERFACE IMPORTED)
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index b166e68..64600c6 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -5,48 +5,107 @@
 FindCurses
 ----------
 
-Find the curses or ncurses include file and library.
+Finds the curses or ncurses library.
+
+Curses is a terminal control library for Unix-like systems, used to build text
+user interface (TUI) applications.  Originally developed in 1978, it has since
+evolved into multiple implementations, most notably ncurses (new curses), BSD
+curses, and PDCurses (a public domain curses library for non-Unix platforms).
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``CURSES_FOUND``
-  True if Curses is found.
+``Curses_FOUND``
+  Boolean indicating whether the Curses is found.  For backward compatibility,
+  the ``CURSES_FOUND`` variable is also set to the same value.
+
 ``CURSES_INCLUDE_DIRS``
+  .. versionadded:: 3.1
+
   The include directories needed to use Curses.
+
 ``CURSES_LIBRARIES``
   The libraries needed to use Curses.
+
 ``CURSES_CFLAGS``
   .. versionadded:: 3.16
 
-  Parameters which ought be given to C/C++ compilers when using Curses.
+  Compiler flags which ought be given to C/C++ compilers when using Curses.
+
 ``CURSES_HAVE_CURSES_H``
-  True if curses.h is available.
+  Boolean indicating whether ``curses.h`` is available.
+
 ``CURSES_HAVE_NCURSES_H``
-  True if ncurses.h is available.
+  Boolean indicating whether ``ncurses.h`` is available.
+
 ``CURSES_HAVE_NCURSES_NCURSES_H``
-  True if ``ncurses/ncurses.h`` is available.
+  Boolean indicating whether ``ncurses/ncurses.h`` is available.
+
 ``CURSES_HAVE_NCURSES_CURSES_H``
-  True if ``ncurses/curses.h`` is available.
+  Boolean indicating whether ``ncurses/curses.h`` is available.
 
-Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
-``find_package(Curses)`` call if NCurses functionality is required.
+Hints
+^^^^^
 
-.. versionadded:: 3.10
-  Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
-  ``find_package(Curses)`` call if unicode functionality is required.
+This module accepts the following variables:
 
-Backward Compatibility
-^^^^^^^^^^^^^^^^^^^^^^
+``CURSES_NEED_NCURSES``
+  Set this variable to ``TRUE`` before calling ``find_package(Curses)`` if the
+  the ncurses implementation functionality is specifically required.
 
-The following variable are provided for backward compatibility:
+``CURSES_NEED_WIDE``
+  .. versionadded:: 3.10
+
+  Set this variable to ``TRUE`` before calling ``find_package(Curses)`` if
+  Unicode (wide character) support is required.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
+
+The following legacy variables are provided for backward compatibility:
 
 ``CURSES_INCLUDE_DIR``
-  Path to Curses include.  Use ``CURSES_INCLUDE_DIRS`` instead.
+  .. deprecated:: 3.1
+    Use the ``CURSES_INCLUDE_DIRS`` variable instead.
+
+  Path to a Curses include directory.
+
 ``CURSES_LIBRARY``
-  Path to Curses library.  Use ``CURSES_LIBRARIES`` instead.
+  .. deprecated:: 2.4
+    Use the ``CURSES_LIBRARIES`` variable instead.
+
+  Path to Curses library.
+
+Examples
+^^^^^^^^
+
+Finding Curses and creating an imported interface target for linking it to a
+project target:
+
+.. code-block:: cmake
+
+  find_package(Curses)
+  if(Curses_FOUND AND NOT TARGET Curses::Curses)
+    add_library(Curses::Curses INTERFACE IMPORTED)
+    set_target_properties(
+      Curses::Curses
+      PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${CURSES_LIBRARIES}"
+        INTERFACE_INCLUDE_DIRECTORIES "${CURSES_INCLUDE_DIRS}"
+    )
+  endif()
+
+  add_executable(app app.c)
+  target_link_libraries(app PRIVATE Curses::Curses)
+
+When ncurses is specifically required:
+
+.. code-block:: cmake
+
+  set(CURSES_NEED_NCURSES TRUE)
+  find_package(Curses)
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
@@ -174,8 +233,8 @@
   get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
   get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
 
-  #We can't find anything with CURSES_NEED_WIDE because we know
-  #only about ncursesw unicode curses version
+  # We can't find anything with CURSES_NEED_WIDE because we know
+  # only about ncursesw unicode curses version
   if(NOT CURSES_NEED_WIDE)
     find_path(CURSES_INCLUDE_PATH
       NAMES curses.h
@@ -218,7 +277,7 @@
   endif()
 endif()
 if(NOT CURSES_NEED_WIDE)
-  #ncursesw can't be found for this paths
+  # ncursesw can't be found for this paths
   if(NOT DEFINED CURSES_HAVE_NCURSES_H)
     if(EXISTS "${CURSES_INCLUDE_PATH}/ncurses.h")
       set(CURSES_HAVE_NCURSES_H "${CURSES_INCLUDE_PATH}/ncurses.h")
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 8fd7285..37f1e7a 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -5,123 +5,163 @@
 FindCxxTest
 -----------
 
-Find CxxTest unit testing framework.
-
-Find the `CxxTest`_ suite and declare a helper macro for creating
-unit tests and integrating them with CTest.
+Finds `CxxTest`_, a C++ unit testing framework suite, and provides a helper
+command to create test runners and integrate them with CTest.
 
 .. _`CxxTest`: https://github.com/CxxTest/cxxtest
 
-Input Variables
-^^^^^^^^^^^^^^^
-
-``CXXTEST_USE_PYTHON``
-  .. deprecated:: 1.3
-
-  Only used in the case both Python & Perl
-  are detected on the system to control
-  which CxxTest code generator is used.
-  Valid only for CxxTest version 3.
-
-  In older versions of this Find Module,
-  this variable controlled if the Python test
-  generator was used instead of the Perl one,
-  regardless of which scripting language the
-  user had installed.
-
-``CXXTEST_TESTGEN_ARGS``
-  .. versionadded:: 2.8.3
-
-  Specify a list of options to pass to the CxxTest code
-  generator.  If not defined, ``--error-printer`` is passed.
-
 Result Variables
 ^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
+
 ``CXXTEST_FOUND``
-  True if the CxxTest framework was found
+  Boolean indicating whether the CxxTest framework is found.
 
 ``CXXTEST_INCLUDE_DIRS``
-  Where to find the CxxTest include directory
-
-``CXXTEST_PERL_TESTGEN_EXECUTABLE``
-  The perl-based test generator
-
-``CXXTEST_PYTHON_TESTGEN_EXECUTABLE``
-  The python-based test generator
+  Include directories containing headers needed to use CxxTest.
 
 ``CXXTEST_TESTGEN_EXECUTABLE``
-  .. versionadded:: 2.8.3
-
-  The test generator that is actually used (chosen using user preferences
-  and interpreters found in the system)
+  The path to the found CxxTest test generator script (Perl- or Python-based),
+  selected based on the found interpreter or user-specified preference.
 
 ``CXXTEST_TESTGEN_INTERPRETER``
-  .. versionadded:: 2.8.3
+  The path to the found Perl or Python interpreter used to run the test
+  generator script, if needed (e.g., on platforms where script shebang lines are
+  not supported).
 
-  The full path to the Perl or Python executable on the system, on
-  platforms where the script cannot be executed using its shebang line.
-
-
-Module Commands
+Cache Variables
 ^^^^^^^^^^^^^^^
 
+The following cache variables may also be set:
+
+``CXXTEST_PERL_TESTGEN_EXECUTABLE``
+  The path to the Perl-based CxxTest test generator script.
+
+``CXXTEST_PYTHON_TESTGEN_EXECUTABLE``
+  The path to the Python-based CxxTest test generator script.
+
+Hints
+^^^^^
+
+This module accepts the following variables before calling
+``find_package(CxxTest)``:
+
+``CXXTEST_TESTGEN_ARGS``
+  This variable can be set to specify a semicolon-separated list of command-line
+  options to pass to the CxxTest code generator.  If not set, the default value
+  is ``--error-printer``.
+
+Commands
+^^^^^^^^
+
+This module provides the following command if CxxTest is found:
+
 .. command:: cxxtest_add_test
 
-  Create a CxxTest runner and adds it to the CTest testing suite:
+  Creates a CxxTest runner and adds it to the CTest testing suite:
 
   .. code-block:: cmake
 
-    CXXTEST_ADD_TEST(<test_name> <gen_source_file>
-                     <input_files_to_testgen>...)
+    cxxtest_add_test(<test-name> <gen-source-file> <input-files-to-testgen>...)
 
   Parameters:
 
-  ``test_name``
-    The name of the test
+  ``<test-name>``
+    The name of the test executable target to be created and registered as a
+    test in the CTest suite.
 
-  ``gen_source_file``
-    The generated source filename to be generated by CxxTest
+  ``<gen-source-file>``
+    The name of the source file to be generated by the CxxTest code generator.
+    This must be a relative path.  It is interpreted relative to the
+    current binary directory (:variable:`CMAKE_CURRENT_BINARY_DIR`).
 
-  ``input_files_to_testgen``
-    The list of header files containing the CxxTest::TestSuite's
-    to be included in this runner
+  ``<input-files-to-testgen>``
+    A list of header files containing test suite classes derived from the C++
+    class ``CxxTest::TestSuite``, to be included in the test runner.  These must
+    be given as absolute paths.
 
-Example Usage
-^^^^^^^^^^^^^
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
-The following example, if CxxTest is found, will:
+The following variables are deprecated and provided for backward compatibility:
 
-* Invoke the testgen executable to autogenerate foo_test.cc in the
-  binary tree from "foo_test.h" in the current source directory.
-* Create an executable and test called unittest_foo.
+``CXXTEST_USE_PYTHON``
+  .. deprecated:: 2.8.3
+    In earlier versions of CMake, this hint variable was used to force the use
+    of the Python-based test generator instead of the Perl one, regardless of
+    which scripting language was installed.  It is now only considered when both
+    Perl and Python interpreters are found.
+
+  A boolean hint variable that, when set to true, prefers the Python code
+  generator over the Perl one if both interpreters are found.  This variable is
+  only relevant when using CxxTest version 3.
+
+Examples
+^^^^^^^^
+
+The following example demonstrates how CxxTest can be used in CMake with this
+module.  If CxxTest is found:
+
+* Additional interface :ref:`imported target <Imported Targets>` is created
+  manually in the project to encapsulate the CxxTest usage requirements and
+  link it to specified tests.  Such target is useful, for example, when dealing
+  with multiple tests.
+
+* Test generator is invoked to create ``foo_test.cc`` in the current binary
+  directory from the input header ``foo_test.h`` located in the current source
+  directory.
+
+* An executable named ``unit_test_foo`` is built and registered as a test in
+  CTest.
 
 .. code-block:: cmake
+  :caption: ``CMakeLists.txt``
 
   find_package(CxxTest)
-  if(CXXTEST_FOUND)
-    include_directories(${CXXTEST_INCLUDE_DIR})
-    enable_testing()
-    CXXTEST_ADD_TEST(unittest_foo foo_test.cc
-                     ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
-    target_link_libraries(unittest_foo foo) # as needed
+
+  # Create interface imported target:
+  if(CXXTEST_FOUND AND NOT TARGET CxxTest::CxxTest)
+    add_library(CxxTest::CxxTest INTERFACE IMPORTED)
+    set_target_properties(
+      CxxTest::CxxTest
+      PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CXXTEST_INCLUDE_DIRS}"
+    )
   endif()
 
-``foo_test.h`` contains:
+  # Add test:
+  if(CXXTEST_FOUND)
+    enable_testing()
+
+    cxxtest_add_test(
+      unit_test_foo
+      foo_test.cc
+      ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h
+    )
+
+    target_link_libraries(
+      unit_test_foo
+      PRIVATE
+        CxxTest::CxxTest
+        # Link any project targets as needed, if test depends on them:
+        foo
+    )
+  endif()
 
 .. code-block:: c++
+  :caption: ``foo_test.h``
 
   #include <cxxtest/TestSuite.h>
+
   class MyTestSuite : public CxxTest::TestSuite
   {
   public:
-     void testAddition( void )
-     {
-        TS_ASSERT( 1 + 1 > 1 );
-        TS_ASSERT_EQUALS( 1 + 1, 2 );
-     }
+    void testAddition(void)
+    {
+      TS_ASSERT(1 + 1 > 1);
+      TS_ASSERT_EQUALS(1 + 1, 2);
+    }
   };
-
 #]=======================================================================]
 
 # Version 1.4 (11/18/10) (CMake 2.8.4)
@@ -150,7 +190,7 @@
 #     Cleaned up and added more documentation
 
 #=============================================================
-# CXXTEST_ADD_TEST (public macro)
+# cxxtest_add_test (public macro)
 #=============================================================
 macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
     set(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
@@ -194,10 +234,10 @@
 find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
          PATHS ${CXXTEST_INCLUDE_DIR})
 
-if(PYTHON_FOUND OR PERL_FOUND)
+if(PYTHON_FOUND OR Perl_FOUND)
   include(FindPackageHandleStandardArgs)
 
-  if(PYTHON_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND OR NOT DEFINED CXXTEST_USE_PYTHON))
+  if(PYTHON_FOUND AND (CXXTEST_USE_PYTHON OR NOT Perl_FOUND OR NOT DEFINED CXXTEST_USE_PYTHON))
     set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
     execute_process(COMMAND ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE} --version
       OUTPUT_VARIABLE _CXXTEST_OUT ERROR_VARIABLE _CXXTEST_OUT RESULT_VARIABLE _CXXTEST_RESULT)
@@ -209,7 +249,7 @@
     find_package_handle_standard_args(CxxTest DEFAULT_MSG
         CXXTEST_INCLUDE_DIR CXXTEST_PYTHON_TESTGEN_EXECUTABLE)
 
-  elseif(PERL_FOUND)
+  elseif(Perl_FOUND)
     set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
     set(CXXTEST_TESTGEN_INTERPRETER ${PERL_EXECUTABLE})
     find_package_handle_standard_args(CxxTest DEFAULT_MSG
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index 30bed56..ba26980 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -5,8 +5,43 @@
 FindCygwin
 ----------
 
-Find Cygwin, a POSIX-compatible environment that runs natively
-on Microsoft Windows
+Finds Cygwin, a POSIX-compatible environment that runs natively on Microsoft
+Windows.
+
+.. note::
+
+  This module is primarily intended for use in other :ref:`Find Modules` to help
+  locate programs when using the ``find_*()`` commands, such as
+  :command:`find_program`.  In most cases, direct use of those commands is
+  sufficient.  Use this module only if a specific program is known to be
+  installed via Cygwin and is usable from Windows.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``CYGWIN_INSTALL_PATH``
+  The path to the Cygwin root installation directory.
+
+Examples
+^^^^^^^^
+
+Finding the Cygwin installation and using its path in a custom find module:
+
+.. code-block:: cmake
+  :caption: FindFoo.cmake
+
+  find_package(Cygwin)
+  find_program(Foo_EXECUTABLE NAMES foo PATHS ${CYGWIN_INSTALL_PATH}/bin)
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(Foo REQUIRED_VARS Foo_EXECUTABLE)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindMsys` module to find MSYS path in a similar way.
 #]=======================================================================]
 
 if (WIN32)
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index e012f91..9e195d3 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -5,60 +5,108 @@
 FindDevIL
 ---------
 
-This module locates the Developer's Image Library,
-`DevIL <https://openil.sourceforge.net/>`_.
+Finds the Developer's Image Library, `DevIL <https://openil.sourceforge.net/>`_.
+
+The DevIL package internally consists of the following libraries, all
+distributed as part of the same release:
+
+* The core Image Library (IL)
+
+  This library is always required when working with DevIL, as it provides the
+  main image loading and manipulation functionality.
+
+* The Image Library Utilities (ILU)
+
+  This library depends on IL and provides image filters and effects. It is only
+  required if the application uses this extended functionality.
+
+* The Image Library Utility Toolkit (ILUT)
+
+  This library depends on both IL and ILU, and additionally provides an
+  interface to OpenGL.  It is only needed if the application uses DevIL together
+  with OpenGL.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.21
-
-This module defines the :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``DevIL::IL``
- Defined if the system has DevIL.
+  .. versionadded:: 3.21
+
+  Target encapsulating the core Image Library (IL) usage requirements, available
+  if the DevIL package is found.
 
 ``DevIL::ILU``
- Defined if the system has DevIL Utilities.
+  .. versionadded:: 3.21
+
+  Target encapsulating the Image Library Utilities (ILU) usage requirements,
+  available if the DevIL package is found.  This target also links to
+  ``DevIL::IL`` for convenience, as ILU depends on the core IL library.
 
 ``DevIL::ILUT``
- Defined if the system has DevIL Utility Toolkit.
+  .. versionadded:: 3.21
+
+  Target encapsulating the Image Library Utility Toolkit (ILUT) usage
+  requirements, available if the DevIL package and its ILUT library are found.
+  This target also links to ``DevIL::ILU``, and transitively to ``DevIL::IL``,
+  since ILUT depends on both.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module sets:
-
-``IL_LIBRARIES``
-  The name of the IL library. These include the full path to
-  the core DevIL library. This one has to be linked into the
-  application.
-
-``ILU_LIBRARIES``
-  The name of the ILU library. Again, the full path. This
-  library is for filters and effects, not actual loading. It
-  doesn't have to be linked if the functionality it provides
-  is not used.
-
-``ILUT_LIBRARIES``
-  The name of the ILUT library. Full path. This part of the
-  library interfaces with OpenGL. It is not strictly needed
-  in applications.
-
-``IL_INCLUDE_DIR``
-  where to find the il.h, ilu.h and ilut.h files.
+This module defines the following variables:
 
 ``DevIL_FOUND``
-  This is set to TRUE if all the above variables were set.
-  This will be set to false if ILU or ILUT are not found,
-  even if they are not needed. In most systems, if one
-  library is found all the others are as well. That's the
-  way the DevIL developers release it.
+  Boolean indicating whether the DevIL package is found, including the IL and
+  ILU libraries.
 
 ``DevIL_ILUT_FOUND``
   .. versionadded:: 3.21
 
-  This is set to TRUE if the ILUT library is found.
+  Boolean indicating whether the ILUT library is found.  On most systems, ILUT
+  is found when both IL and ILU are available.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``IL_INCLUDE_DIR``
+  The directory containing the ``il.h``, ``ilu.h`` and ``ilut.h`` header files.
+
+``IL_LIBRARIES``
+  The full path to the core Image Library (IL).
+
+``ILU_LIBRARIES``
+  The full path to the ILU library.
+
+``ILUT_LIBRARIES``
+  The full path to the ILUT library.
+
+Examples
+^^^^^^^^
+
+Finding the DevIL package and linking against the core Image Library (IL):
+
+.. code-block:: cmake
+
+  find_package(DevIL)
+  target_link_libraries(app PRIVATE DevIL::IL)
+
+Linking against the Image Library Utilities (ILU):
+
+.. code-block:: cmake
+
+  find_package(DevIL)
+  target_link_libraries(app PRIVATE DevIL::ILU)
+
+Linking against the Image Library Utility Toolkit (ILUT):
+
+.. code-block:: cmake
+
+  find_package(DevIL)
+  target_link_libraries(app PRIVATE DevIL::ILUT)
 #]=======================================================================]
 
 # TODO: Add version support.
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index 41979ee..2d43099 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -5,188 +5,291 @@
 FindDoxygen
 -----------
 
-Doxygen is a documentation generation tool (see https://www.doxygen.nl).
-This module looks for Doxygen and some optional tools it supports:
-
-``dot``
-  `Graphviz <https://graphviz.org>`_ ``dot`` utility used to render various
-  graphs.
-``mscgen``
-  `Message Chart Generator <https://www.mcternan.me.uk/mscgen/>`_ utility used
-  by Doxygen's ``\msc`` and ``\mscfile`` commands.
-``dia``
-  `Dia <https://wiki.gnome.org/Apps/Dia>`_ the diagram editor used by Doxygen's
-  ``\diafile`` command.
-
-.. versionadded:: 3.9
-  These tools are available as components in the :command:`find_package` command.
-  For example:
+Finds `Doxygen <https://www.doxygen.nl>`_, a source code documentation
+generator, along with some optional supporting tools, and provides a command
+for integrating Doxygen-based documentation into CMake projects:
 
 .. code-block:: cmake
 
-  # Require dot, treat the other components as optional
-  find_package(Doxygen
-               REQUIRED dot
-               OPTIONAL_COMPONENTS mscgen dia)
+  find_package(Doxygen [<version>] [...] [COMPONENTS <components>...] [...])
 
-The following variables are defined by this module:
+Components
+^^^^^^^^^^
 
-.. variable:: DOXYGEN_FOUND
+Additional Doxygen supporting tools, can be specified as components with the
+:command:`find_package()` command:
 
-  True if the ``doxygen`` executable was found.
+.. code-block:: cmake
 
-.. variable:: DOXYGEN_VERSION
+  find_package(Doxygen [COMPONENTS <components>...])
 
-  The version reported by ``doxygen --version``.
+Supported components include:
+
+``doxygen``
+  .. versionadded:: 3.9
+
+  Finds the ``doxygen`` executable.  This component is always automatically
+  implied, even if not requested.
+
+``dot``
+  .. versionadded:: 3.9
+
+  Finds the `Graphviz <https://graphviz.org>`_ ``dot`` utility, used for
+  rendering graphs and diagrams as part of the documentation.
+
+``mscgen``
+  .. versionadded:: 3.9
+
+  Finds the `Message Chart Generator <https://www.mcternan.me.uk/mscgen/>`_
+  utility used by Doxygen's ``\msc`` and ``\mscfile`` commands.
+
+``dia``
+  .. versionadded:: 3.9
+
+  Finds the `Dia <https://wiki.gnome.org/Apps/Dia>`_ diagram editor used by
+  Doxygen's ``\diafile`` command.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.9
+This module provides the following :ref:`Imported Targets`, each of which is
+defined if the corresponding component was requested and its associated
+executable was found:
 
-The module defines ``IMPORTED`` targets for Doxygen and each component found.
-These can be used as part of custom commands, etc. and should be preferred over
-old-style (and now deprecated) variables like ``DOXYGEN_EXECUTABLE``. The
-following import targets are defined if their corresponding executable could be
-found (the component import targets will only be defined if that component was
-requested):
+``Doxygen::doxygen``
+  .. versionadded:: 3.9
 
-* ``Doxygen::doxygen``
-* ``Doxygen::dot``
-* ``Doxygen::mscgen``
-* ``Doxygen::dia``
+  Imported executable target encapsulating the ``doxygen`` executable usage
+  requirements, available if Doxygen is found.
 
-Functions
-^^^^^^^^^
+``Doxygen::dot``
+  .. versionadded:: 3.9
+
+  Imported executable target encapsulating the ``dot`` executable usage
+  requirements, available if the above ``dot`` component is found.
+
+``Doxygen::mscgen``
+  .. versionadded:: 3.9
+
+  Imported executable target encapsulating the ``mscgen`` executable usage
+  requirements, available if the above ``mscgen`` component is found.
+
+``Doxygen::dia``
+  .. versionadded:: 3.9
+
+  Imported executable target encapsulating the ``dia`` executable usage
+  requirements, available if the above ``dia`` component is found.
+
+These targets can be used in commands such as :command:`add_custom_command`
+and are preferred over the older, now-deprecated variables like
+``DOXYGEN_EXECUTABLE``.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Doxygen_FOUND``
+  Boolean indicating whether (the requested version of) ``doxygen`` executable
+  and all requested required components are found.  For backward compatibility,
+  the ``DOXYGEN_FOUND`` variable is also set, except it has boolean value of
+  ``YES`` or ``NO``.
+
+``DOXYGEN_VERSION``
+  The version of Doxygen found (as reported by ``doxygen --version``).
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: doxygen_add_docs
 
   .. versionadded:: 3.9
 
-  This function is intended as a convenience for adding a target for generating
-  documentation with Doxygen. It aims to provide sensible defaults so that
-  projects can generally just provide the input files and directories and that
-  will be sufficient to give sensible results. The function supports the
-  ability to customize the Doxygen configuration used to build the
-  documentation.
+  Adds a custom target for generating documentation with Doxygen during the
+  build phase:
 
   .. code-block:: cmake
 
-    doxygen_add_docs(targetName
-        [filesOrDirs...]
-        [ALL]
-        [USE_STAMP_FILE]
-        [WORKING_DIRECTORY dir]
-        [COMMENT comment]
-        [CONFIG_FILE filename])
+    doxygen_add_docs(
+      <target-name>
+      [<files-or-dirs>...]
+      [ALL]
+      [USE_STAMP_FILE]
+      [WORKING_DIRECTORY <dir>]
+      [COMMENT <comment>]
+      [CONFIG_FILE <file>]
+    )
 
-  The function constructs a ``Doxyfile`` and defines a custom target that runs
-  Doxygen on that generated file. The listed files and directories are used as
-  the ``INPUT`` of the generated ``Doxyfile`` and they can contain wildcards.
-  Any files that are listed explicitly will also be added as ``SOURCES`` of the
-  custom target so they will show up in an IDE project's source list.
+  By default, this convenience command also generates a configuration file
+  named ``Doxyfile.<target-name>`` in the current binary directory at
+  CMake configuration phase.  It provides sensible defaults, so most projects
+  only need to specify input files or directories.  Additional behavior and
+  configuration can be customized using variables described in the following
+  sections.
 
-  So that relative input paths work as expected, by default the working
-  directory of the Doxygen command will be the current source directory (i.e.
-  :variable:`CMAKE_CURRENT_SOURCE_DIR`). This can be overridden with the
-  ``WORKING_DIRECTORY`` option to change the directory used as the relative
-  base point. Note also that Doxygen's default behavior is to strip the working
-  directory from relative paths in the generated documentation (see the
-  ``STRIP_FROM_PATH`` `Doxygen config option
-  <https://www.doxygen.nl/manual/config.html>`_ for details).
+  .. rubric:: The arguments are:
 
-  If provided, the optional ``comment`` will be passed as the ``COMMENT`` for
-  the :command:`add_custom_target` command used to create the custom target
-  internally.
+  ``<target-name>``
+    The name of the target to be created for generating documentation with
+    Doxygen.
 
-  .. versionadded:: 3.27
-    If ``CONFIG_FILE`` is set, the given file provided with full-path
-    will be used as doxygen configuration file
+  ``<files-or-dirs>...``
+    One or more paths (files or directories) that serve as input sources for
+    documentation.
 
-  .. versionadded:: 3.12
-    If ``ALL`` is set, the target will be added to the default build target.
+    These are passed to the ``INPUT`` Doxygen configuration tag in the
+    generated ``Doxyfile.<target-name>``.  Files listed here are also added
+    as ``SOURCES`` argument of the underlying :command:`add_custom_target`
+    command so they appear in IDE project's source list.
 
-  .. versionadded:: 3.16
-    If ``USE_STAMP_FILE`` is set, the custom command defined by this function will
-    create a stamp file with the name ``<targetName>.stamp`` in the current
-    binary directory whenever doxygen is re-run.  With this option present, all
-    items in ``<filesOrDirs>`` must be files (i.e. no directories, symlinks or
-    wildcards) and each of the files must exist at the time
-    ``doxygen_add_docs()`` is called.  An error will be raised if any of the
-    items listed is missing or is not a file when ``USE_STAMP_FILE`` is given.
-    A dependency will be created on each of the files so that doxygen will only
-    be re-run if one of the files is updated.  Without the ``USE_STAMP_FILE``
-    option, doxygen will always be re-run if the ``<targetName>`` target is built
-    regardless of whether anything listed in ``<filesOrDirs>`` has changed.
+    When using the ``USE_STAMP_FILE`` option, only files (not directories,
+    symlinks, or wildcards) are allowed, and each must exist when this
+    command is called.
 
-  The contents of the generated ``Doxyfile`` can be customized by setting CMake
-  variables before calling ``doxygen_add_docs()``. Any variable with a name of
-  the form ``DOXYGEN_<tag>`` will have its value substituted for the
-  corresponding ``<tag>`` configuration option in the ``Doxyfile``. See the
-  `Doxygen documentation <https://www.doxygen.nl/manual/config.html>`_ for the
-  full list of supported configuration options.
+  ``ALL``
+    .. versionadded:: 3.12
 
-  Some of Doxygen's defaults are overridden to provide more appropriate
-  behavior for a CMake project. Each of the following will be explicitly set
-  unless the variable already has a value before ``doxygen_add_docs()`` is
-  called (with some exceptions noted):
+    Adds the created documentation target to the default build target so
+    that it runs automatically as part of the build phase.
 
-  .. variable:: DOXYGEN_HAVE_DOT
+  ``USE_STAMP_FILE``
+    .. versionadded:: 3.16
 
-    Set to ``YES`` if the ``dot`` component was requested and it was found,
-    ``NO`` otherwise. Any existing value of ``DOXYGEN_HAVE_DOT`` is ignored.
+    Enables use of a stamp file to avoid regenerating documentation unless
+    source files have changed.
 
-  .. variable:: DOXYGEN_DOT_MULTI_TARGETS
+    Stamp file named ``<target-name>.stamp`` is created in the current binary
+    directory by an underlying custom command.
 
+    With this option present, all entries in ``<files-or-dirs>`` must be
+    existing files (i.e. no directories, symlinks or wildcards) when this
+    command is called.  An error is raised if any listed path is invalid.
+
+    Without this option, CMake will re-run Doxygen every time the
+    ``<target-name>`` target is built, regardless of whether any input source
+    file listed in ``<files-or-dirs>`` has changed.
+
+  ``WORKING_DIRECTORY <dir>``
+    By default, the Doxygen working directory is the current source directory
+    (:variable:`CMAKE_CURRENT_SOURCE_DIR`).  This aligns with using relative
+    input paths.
+
+    Use this option, to change and override the directory where Doxygen is
+    being run.  The absolute path ``<dir>`` will then be used as the base
+    point for relative paths.
+
+    Note also that Doxygen's default behavior is to strip the working
+    directory from relative paths in the generated documentation.  See the
+    ``STRIP_FROM_PATH`` config tag in the `Doxygen manual
+    <https://www.doxygen.nl/manual/config.html>`_ for more details.
+
+  ``COMMENT <comment>``
+    If provided, the ``<comment>`` string will be passed as the ``COMMENT``
+    argument to the underlying :command:`add_custom_target` command used to
+    create the custom target internally.  This appears in the build system
+    output, when the target is built.
+
+  ``CONFIG_FILE <file>``
+    .. versionadded:: 3.27
+
+    If specified, the given file provided with full-path will be used as
+    Doxygen configuration file instead of the default
+    ``Doxyfile.<target-name>``.
+
+  .. rubric:: Variables for customizing Doxygen configuration
+
+  The ``doxygen_add_docs()`` command generates a Doxygen configuration file
+  containing configuration tags.  For example:
+
+  .. code-block:: text
+    :caption: ``Doxygen.<target-name>``
+
+    DOXYFILE_ENCODING      = UTF-8
+    PROJECT_NAME           = DoxygenExample
+    PROJECT_NUMBER         = 1.2.3
+    PROJECT_BRIEF          = "Example project using Doxygen"
+    PROJECT_LOGO           =
+    OUTPUT_DIRECTORY       = /home/user/doxygen-example/build
+    GENERATE_HTML          = YES
+    GENERATE_MAN           = NO
+    # ...
+
+  In CMake, these tags can be modified by setting input variables in form
+  of ``DOXYGEN_<tag>``, where ``<tag>`` is one of the configuration tags
+  listed in the `Doxygen manual
+  <https://www.doxygen.nl/manual/config.html>`_.
+
+  For example, to modify the ``GENERATE_HTML`` and ``GENERATE_MAN``
+  configuration tags, the following variables can be set before calling
+  ``doxygen_add_docs()``:
+
+  .. code-block:: cmake
+    :caption: ``CMakeLists.txt``
+
+    find_package(Doxygen)
+
+    if(Doxygen_FOUND)
+      set(DOXYGEN_GENERATE_HTML NO)
+      set(DOXYGEN_GENERATE_MAN YES)
+
+      doxygen_add_docs(project_docs ${PROJECT_SOURCE_DIR})
+    endif()
+
+  .. rubric:: Default configuration
+
+  By default, ``doxygen_add_docs()`` overrides several of Doxygen's settings
+  to better suit typical CMake projects.  Each of the following variables is
+  explicitly set unless already defined prior to calling
+  ``doxygen_add_docs()``, with a few exceptions noted below:
+
+  ``DOXYGEN_HAVE_DOT``
+    Set to ``YES`` if the ``dot`` component was requested and found, ``NO``
+    otherwise.  Any existing value of ``DOXYGEN_HAVE_DOT`` is ignored.
+
+  ``DOXYGEN_DOT_MULTI_TARGETS``
     Set to ``YES`` by this module (note that this requires a ``dot`` version
-    newer than 1.8.10). This option is only meaningful if ``DOXYGEN_HAVE_DOT``
+    newer than 1.8.10).  This option is only meaningful if ``DOXYGEN_HAVE_DOT``
     is also set to ``YES``.
 
-  .. variable:: DOXYGEN_GENERATE_LATEX
-
+  ``DOXYGEN_GENERATE_LATEX``
     Set to ``NO`` by this module.
 
-  .. variable:: DOXYGEN_WARN_FORMAT
-
+  ``DOXYGEN_WARN_FORMAT``
     For Visual Studio based generators, this is set to the form recognized by
     the Visual Studio IDE: ``$file($line) : $text``. For all other generators,
     Doxygen's default value is not overridden.
 
-  .. variable:: DOXYGEN_PROJECT_NAME
-
+  ``DOXYGEN_PROJECT_NAME``
     Populated with the name of the current project (i.e.
     :variable:`PROJECT_NAME`).
 
-  .. variable:: DOXYGEN_PROJECT_NUMBER
-
+  ``DOXYGEN_PROJECT_NUMBER``
     Populated with the version of the current project (i.e.
     :variable:`PROJECT_VERSION`).
 
-  .. variable:: DOXYGEN_PROJECT_BRIEF
-
+  ``DOXYGEN_PROJECT_BRIEF``
     Populated with the description of the current project (i.e.
     :variable:`PROJECT_DESCRIPTION`).
 
-  .. variable:: DOXYGEN_INPUT
+  ``DOXYGEN_INPUT``
+    This variable is automatically populated with the list of files and
+    directories passed to ``doxygen_add_docs()``.  For consistent behavior
+    with other built-in commands like :command:`add_executable`,
+    :command:`add_library`, and :command:`add_custom_target`, projects should
+    not set this variable manually.  If a variable named ``DOXYGEN_INPUT``
+    is set by the project, it will be ignored and a warning will be issued.
 
-    Projects should not set this variable. It will be populated with the set of
-    files and directories passed to ``doxygen_add_docs()``, thereby providing
-    consistent behavior with the other built-in commands like
-    :command:`add_executable`, :command:`add_library` and
-    :command:`add_custom_target`. If a variable named ``DOXYGEN_INPUT`` is set
-    by the project, it will be ignored and a warning will be issued.
-
-  .. variable:: DOXYGEN_RECURSIVE
-
+  ``DOXYGEN_RECURSIVE``
     Set to ``YES`` by this module.
 
-  .. variable:: DOXYGEN_EXCLUDE_PATTERNS
-
-    If the set of inputs includes directories, this variable will specify
-    patterns used to exclude files from them. The following patterns are added
-    by ``doxygen_add_docs()`` to ensure CMake-specific files and directories
-    are not included in the input. If the project sets
-    ``DOXYGEN_EXCLUDE_PATTERNS``, those contents are merged with these
+  ``DOXYGEN_EXCLUDE_PATTERNS``
+    If the ``<files-or-dirs>`` argument of ``doxygen_add_docs()`` contains
+    directories, this variable will specify patterns used to exclude files
+    from them.  The following patterns are added by default to ensure
+    CMake-specific files and directories are not included in the input.  If
+    the project sets this variable, those contents are merged with these
     additional patterns rather than replacing them:
 
     ::
@@ -200,205 +303,383 @@
       CMakeLists.txt
       CMakeCache.txt
 
-  .. variable:: DOXYGEN_OUTPUT_DIRECTORY
+  ``DOXYGEN_OUTPUT_DIRECTORY``
+    Set to :variable:`CMAKE_CURRENT_BINARY_DIR` by this module.  If the
+    project provides its own value for this and it is a relative path, it
+    will be interpreted relative to the current binary directory
+    (:variable:`CMAKE_CURRENT_BINARY_DIR`).  This is necessary because
+    Doxygen will normally be run from a directory within the source tree so
+    that relative source paths work as expected.  If this directory does not
+    exist, it will be recursively created prior to executing Doxygen.
 
-    Set to :variable:`CMAKE_CURRENT_BINARY_DIR` by this module. Note that if
-    the project provides its own value for this and it is a relative path, it
-    will be converted to an absolute path relative to the current binary
-    directory. This is necessary because doxygen will normally be run from a
-    directory within the source tree so that relative source paths work as
-    expected. If this directory does not exist, it will be recursively created
-    prior to executing the doxygen commands.
+  .. rubric:: Lists
 
-To change any of these defaults or override any other Doxygen config option,
-set relevant variables before calling ``doxygen_add_docs()``. For example:
+  A number of Doxygen config tags accept lists of values, and Doxygen
+  requires them to be separated by whitespace, while in CMake a list is a
+  string with items separated by :ref:`semicolons <CMake Language Lists>`.
+
+  The ``doxygen_add_docs()`` specifically checks for the following Doxygen
+  config tags and converts their associated CMake ``DOXYGEN_<tag>`` variable
+  values into the Doxygen-formatted lists if set:
+
+  .. hlist::
+
+    - ``ABBREVIATE_BRIEF``
+    - ``ALIASES``
+    - ``CITE_BIB_FILES``
+    - ``DIAFILE_DIRS``
+    - ``DOTFILE_DIRS``
+    - ``DOT_FONTPATH``
+    - ``ENABLED_SECTIONS``
+    - ``EXAMPLE_PATH``
+    - ``EXAMPLE_PATTERNS``
+    - ``EXCLUDE``
+    - ``EXCLUDE_PATTERNS``
+    - ``EXCLUDE_SYMBOLS``
+    - ``EXPAND_AS_DEFINED``
+    - ``EXTENSION_MAPPING``
+    - ``EXTRA_PACKAGES``
+    - ``EXTRA_SEARCH_MAPPINGS``
+    - ``FILE_PATTERNS``
+    - ``FILTER_PATTERNS``
+    - ``FILTER_SOURCE_PATTERNS``
+    - ``HTML_EXTRA_FILES``
+    - ``HTML_EXTRA_STYLESHEET``
+    - ``IGNORE_PREFIX``
+    - ``IMAGE_PATH``
+    - ``INCLUDE_FILE_PATTERNS``
+    - ``INCLUDE_PATH``
+    - ``INPUT``
+    - ``LATEX_EXTRA_FILES``
+    - ``LATEX_EXTRA_STYLESHEET``
+    - ``MATHJAX_EXTENSIONS``
+    - ``MSCFILE_DIRS``
+    - ``PLANTUML_INCLUDE_PATH``
+    - ``PREDEFINED``
+    - ``QHP_CUST_FILTER_ATTRS``
+    - ``QHP_SECT_FILTER_ATTRS``
+    - ``STRIP_FROM_INC_PATH``
+    - ``STRIP_FROM_PATH``
+    - ``TAGFILES``
+    - ``TCL_SUBST``
+
+  For example, to customize the Doxygen file patterns, a usual
+  :ref:`semicolon-separated list <CMake Language Lists>` can be set in CMake:
 
   .. code-block:: cmake
+    :caption: ``CMakeLists.txt``
 
-    set(DOXYGEN_GENERATE_HTML NO)
-    set(DOXYGEN_GENERATE_MAN YES)
+    find_package(Doxygen)
 
-    doxygen_add_docs(
-        doxygen
-        ${PROJECT_SOURCE_DIR}
-        COMMENT "Generate man pages"
-    )
+    if(Doxygen_FOUND)
+      set(DOXYGEN_FILE_PATTERNS *.c *.cxx *.h *.hxx)
+      doxygen_add_docs(example_docs ${CMAKE_CURRENT_SOURCE_DIR} ALL)
+    endif()
 
-A number of Doxygen config options accept lists of values, but Doxygen requires
-them to be separated by whitespace. CMake variables hold lists as a string with
-items separated by semi-colons, so a conversion needs to be performed. The
-``doxygen_add_docs()`` command specifically checks the following Doxygen config
-options and will convert their associated CMake variable's contents into the
-required form if set. CMake variables are named ``DOXYGEN_<name>`` for the
-Doxygen settings specified here.
+  Which will produce a Doxygen list of patterns separated by spaces in the
+  generated configuration file:
 
-.. hlist::
+  .. code-block:: text
+    :caption: ``Doxyfile.<target-name>``
 
-  - ``ABBREVIATE_BRIEF``
-  - ``ALIASES``
-  - ``CITE_BIB_FILES``
-  - ``DIAFILE_DIRS``
-  - ``DOTFILE_DIRS``
-  - ``DOT_FONTPATH``
-  - ``ENABLED_SECTIONS``
-  - ``EXAMPLE_PATH``
-  - ``EXAMPLE_PATTERNS``
-  - ``EXCLUDE``
-  - ``EXCLUDE_PATTERNS``
-  - ``EXCLUDE_SYMBOLS``
-  - ``EXPAND_AS_DEFINED``
-  - ``EXTENSION_MAPPING``
-  - ``EXTRA_PACKAGES``
-  - ``EXTRA_SEARCH_MAPPINGS``
-  - ``FILE_PATTERNS``
-  - ``FILTER_PATTERNS``
-  - ``FILTER_SOURCE_PATTERNS``
-  - ``HTML_EXTRA_FILES``
-  - ``HTML_EXTRA_STYLESHEET``
-  - ``IGNORE_PREFIX``
-  - ``IMAGE_PATH``
-  - ``INCLUDE_FILE_PATTERNS``
-  - ``INCLUDE_PATH``
-  - ``INPUT``
-  - ``LATEX_EXTRA_FILES``
-  - ``LATEX_EXTRA_STYLESHEET``
-  - ``MATHJAX_EXTENSIONS``
-  - ``MSCFILE_DIRS``
-  - ``PLANTUML_INCLUDE_PATH``
-  - ``PREDEFINED``
-  - ``QHP_CUST_FILTER_ATTRS``
-  - ``QHP_SECT_FILTER_ATTRS``
-  - ``STRIP_FROM_INC_PATH``
-  - ``STRIP_FROM_PATH``
-  - ``TAGFILES``
-  - ``TCL_SUBST``
+    # ...
+    FILE_PATTERNS          = *.c *.cxx *.h *.hxx
 
-The following single value Doxygen options will be quoted automatically
-if they contain at least one space:
+  .. rubric:: Automatic quoting
 
-.. hlist::
+  If a Doxygen single-value tag contains spaces, their values must be
+  surrounded by double quotes (``"..."``).  ``doxygen_add_docs()``
+  automatically quotes values of the following Doxygen tags when generating
+  the ``Doxyfile``, if they contain at least one space:
 
-  - ``CHM_FILE``
-  - ``DIA_PATH``
-  - ``DOCBOOK_OUTPUT``
-  - ``DOCSET_FEEDNAME``
-  - ``DOCSET_PUBLISHER_NAME``
-  - ``DOT_FONTNAME``
-  - ``DOT_PATH``
-  - ``EXTERNAL_SEARCH_ID``
-  - ``FILE_VERSION_FILTER``
-  - ``GENERATE_TAGFILE``
-  - ``HHC_LOCATION``
-  - ``HTML_FOOTER``
-  - ``HTML_HEADER``
-  - ``HTML_OUTPUT``
-  - ``HTML_STYLESHEET``
-  - ``INPUT_FILTER``
-  - ``LATEX_FOOTER``
-  - ``LATEX_HEADER``
-  - ``LATEX_OUTPUT``
-  - ``LAYOUT_FILE``
-  - ``MAN_OUTPUT``
-  - ``MAN_SUBDIR``
-  - ``MATHJAX_CODEFILE``
-  - ``MSCGEN_PATH``
-  - ``OUTPUT_DIRECTORY``
-  - ``PERL_PATH``
-  - ``PLANTUML_JAR_PATH``
-  - ``PROJECT_BRIEF``
-  - ``PROJECT_LOGO``
-  - ``PROJECT_NAME``
-  - ``QCH_FILE``
-  - ``QHG_LOCATION``
-  - ``QHP_CUST_FILTER_NAME``
-  - ``QHP_VIRTUAL_FOLDER``
-  - ``RTF_EXTENSIONS_FILE``
-  - ``RTF_OUTPUT``
-  - ``RTF_STYLESHEET_FILE``
-  - ``SEARCHDATA_FILE``
-  - ``USE_MDFILE_AS_MAINPAGE``
-  - ``WARN_FORMAT``
-  - ``WARN_LOGFILE``
-  - ``XML_OUTPUT``
+  .. hlist::
 
-.. versionadded:: 3.11
-  There are situations where it may be undesirable for a particular config option
-  to be automatically quoted by ``doxygen_add_docs()``, such as ``ALIASES`` which
-  may need to include its own embedded quoting.  The ``DOXYGEN_VERBATIM_VARS``
-  variable can be used to specify a list of Doxygen variables (including the
-  leading ``DOXYGEN_`` prefix) which should not be quoted.  The project is then
-  responsible for ensuring that those variables' values make sense when placed
-  directly in the Doxygen input file.  In the case of list variables, list items
-  are still separated by spaces, it is only the automatic quoting that is
-  skipped.  For example, the following allows ``doxygen_add_docs()`` to apply
-  quoting to ``DOXYGEN_PROJECT_BRIEF``, but not each item in the
-  ``DOXYGEN_ALIASES`` list (:ref:`bracket syntax <Bracket Argument>` can also
-  be used to make working with embedded quotes easier):
+    - ``CHM_FILE``
+    - ``DIA_PATH``
+    - ``DOCBOOK_OUTPUT``
+    - ``DOCSET_FEEDNAME``
+    - ``DOCSET_PUBLISHER_NAME``
+    - ``DOT_FONTNAME``
+    - ``DOT_PATH``
+    - ``EXTERNAL_SEARCH_ID``
+    - ``FILE_VERSION_FILTER``
+    - ``GENERATE_TAGFILE``
+    - ``HHC_LOCATION``
+    - ``HTML_FOOTER``
+    - ``HTML_HEADER``
+    - ``HTML_OUTPUT``
+    - ``HTML_STYLESHEET``
+    - ``INPUT_FILTER``
+    - ``LATEX_FOOTER``
+    - ``LATEX_HEADER``
+    - ``LATEX_OUTPUT``
+    - ``LAYOUT_FILE``
+    - ``MAN_OUTPUT``
+    - ``MAN_SUBDIR``
+    - ``MATHJAX_CODEFILE``
+    - ``MSCGEN_PATH``
+    - ``OUTPUT_DIRECTORY``
+    - ``PERL_PATH``
+    - ``PLANTUML_JAR_PATH``
+    - ``PROJECT_BRIEF``
+    - ``PROJECT_LOGO``
+    - ``PROJECT_NAME``
+    - ``QCH_FILE``
+    - ``QHG_LOCATION``
+    - ``QHP_CUST_FILTER_NAME``
+    - ``QHP_VIRTUAL_FOLDER``
+    - ``RTF_EXTENSIONS_FILE``
+    - ``RTF_OUTPUT``
+    - ``RTF_STYLESHEET_FILE``
+    - ``SEARCHDATA_FILE``
+    - ``USE_MDFILE_AS_MAINPAGE``
+    - ``WARN_FORMAT``
+    - ``WARN_LOGFILE``
+    - ``XML_OUTPUT``
 
-.. code-block:: cmake
+  ``DOXYGEN_VERBATIM_VARS``
+    .. versionadded:: 3.11
 
-  set(DOXYGEN_PROJECT_BRIEF "String with spaces")
-  set(DOXYGEN_ALIASES
-      [[somealias="@some_command param"]]
-      "anotherAlias=@foobar"
-  )
-  set(DOXYGEN_VERBATIM_VARS DOXYGEN_ALIASES)
+    A CMake input variable used by ``doxygen_add_docs()`` to specify a list
+    of Doxygen input variables (including their leading ``DOXYGEN_`` prefix)
+    whose values should be passed to the generated ``Doxyfile`` configuration
+    without automatic quoting.
 
-The resultant ``Doxyfile`` will contain the following lines:
+    When using this variable, the project is then responsible for ensuring
+    that those variables' values make sense when placed directly in the
+    generated ``Doxyfile`` configuration.  For list variables, items are
+    still separated by spaces in the output, but no quoting is applied to the
+    individual items.
 
-.. code-block:: text
+    For certain Doxygen tags, such as ``ALIASES``, automatic quoting done by
+    ``doxygen_add_docs()`` may interfere with correct syntax (e.g., embedded
+    quotes).
 
-  PROJECT_BRIEF = "String with spaces"
-  ALIASES       = somealias="@some_command param" anotherAlias=@foobar
+    For example, the following will quote ``DOXYGEN_PROJECT_BRIEF``, but skip
+    each item in the ``DOXYGEN_ALIASES`` list (:ref:`bracket syntax
+    <Bracket Argument>` is used to make working with embedded quotes easier):
 
+    .. code-block:: cmake
+      :caption: ``CMakeLists.txt``
 
-Deprecated Result Variables
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
+      find_package(Doxygen)
 
-.. deprecated:: 3.9
+      if(Doxygen_FOUND)
+        set(DOXYGEN_PROJECT_BRIEF "String with spaces")
+        set(
+          DOXYGEN_ALIASES
+          [[somealias="@some_command param"]]
+          "anotherAlias=@foobar"
+        )
+        set(DOXYGEN_VERBATIM_VARS DOXYGEN_ALIASES)
+
+        add_doxygen_docs(project_docs ${PROJECT_SOURCE_DIR})
+      endif()
+
+    The resultant ``Doxyfile`` configuration will contain the following lines:
+
+    .. code-block:: text
+      :caption: ``Doxyfile.project_docs``
+
+      PROJECT_BRIEF = "String with spaces"
+      ALIASES       = somealias="@some_command param" anotherAlias=@foobar
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
 For compatibility with previous versions of CMake, the following variables
 are also defined but they are deprecated and should no longer be used:
 
-.. variable:: DOXYGEN_EXECUTABLE
+``DOXYGEN_EXECUTABLE``
+  .. deprecated:: 3.9
+    Use ``Doxygen::doxygen`` imported target instead of referring to the
+    ``doxygen`` executable directly.
 
-  The path to the ``doxygen`` command. If projects need to refer to the
-  ``doxygen`` executable directly, they should use the ``Doxygen::doxygen``
-  import target instead.
+  Cache variable containing the path to the ``doxygen`` command.
 
-.. variable:: DOXYGEN_DOT_FOUND
+``DOXYGEN_DOT_FOUND``
+  .. deprecated:: 3.9
 
-  True if the ``dot`` executable was found.
+  Boolean result variable indicating whether ``dot`` executable is found.
 
-.. variable:: DOXYGEN_DOT_EXECUTABLE
+``DOXYGEN_DOT_EXECUTABLE``
+  .. deprecated:: 3.9
+    Use ``Doxygen::dot`` imported target instead of referring to the ``dot``
+    executable directly.
 
-  The path to the ``dot`` command. If projects need to refer to the ``dot``
-  executable directly, they should use the ``Doxygen::dot`` import target
-  instead.
+  Cache variable containing the path to the ``dot`` command-line executable.
 
-.. variable:: DOXYGEN_DOT_PATH
+``DOXYGEN_DOT_PATH``
+  .. deprecated:: 3.9
 
-  The path to the directory containing the ``dot`` executable as reported in
-  ``DOXYGEN_DOT_EXECUTABLE``. The path may have forward slashes even on Windows
-  and is not suitable for direct substitution into a ``Doxyfile.in`` template.
-  If you need this value, get the :prop_tgt:`IMPORTED_LOCATION` property of the
-  ``Doxygen::dot`` target and use :command:`get_filename_component` to extract
-  the directory part of that path. You may also want to consider using
-  :command:`file(TO_NATIVE_PATH)` to prepare the path for a Doxygen
-  configuration file.
+  Result variable containing the path to the directory where the ``dot``
+  executable is located as reported in ``DOXYGEN_DOT_EXECUTABLE``.  The path
+  may have forward slashes even on Windows and is not suitable for direct
+  substitution into a ``Doxyfile.in`` template.  If this value is needed, get
+  the :prop_tgt:`IMPORTED_LOCATION` property of the ``Doxygen::dot`` target
+  and use :command:`get_filename_component` to extract the directory part of
+  that path.  Consider also using :command:`file(TO_NATIVE_PATH)` to prepare
+  the path for a Doxygen configuration file.
 
+``DOXYGEN_SKIP_DOT``
+  .. deprecated:: 3.9
 
-Deprecated Hint Variables
-^^^^^^^^^^^^^^^^^^^^^^^^^
+  This hint variable has no effect when specifying components in
+  ``find_package(Doxygen COMPONENTS ...)``.  In backward-compatibility mode
+  (i.e. without specifying components) it prevents this find module from
+  searching for Graphviz's ``dot`` utility.
 
-.. deprecated:: 3.9
+Examples
+^^^^^^^^
 
-.. variable:: DOXYGEN_SKIP_DOT
+Examples: Finding Doxygen
+"""""""""""""""""""""""""
 
-  This variable has no effect for the component form of ``find_package``.
-  In backward compatibility mode (i.e. without components list) it prevents
-  the finder module from searching for Graphviz's ``dot`` utility.
+Finding Doxygen:
 
+.. code-block:: cmake
+
+  find_package(Doxygen)
+
+Or, finding Doxygen and specifying a minimum required version:
+
+.. code-block:: cmake
+
+  find_package(Doxygen 1.9)
+
+Or, finding Doxygen and making it required (if not found, processing stops
+with an error message):
+
+.. code-block:: cmake
+
+  find_package(Doxygen REQUIRED)
+
+Or, finding Doxygen as required and specifying ``dot`` tool as required
+component and ``mscgen`` and ``dia`` tools as optional components:
+
+.. code-block:: cmake
+
+  find_package(Doxygen REQUIRED COMPONENTS dot OPTIONAL_COMPONENTS mscgen dia)
+
+Example: Using Doxygen in CMake
+"""""""""""""""""""""""""""""""
+
+The following example demonstrates how to find Doxygen and create documentation
+from source files at build phase.  Once project is built, generated
+documentation files will be located in the ``html`` directory inside the
+project binary directory:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  cmake_minimum_required(VERSION 3.24)
+  project(
+    DoxygenExample
+    DESCRIPTION "Example project using Doxygen"
+    VERSION 1.2.3
+  )
+
+  add_executable(example example.c)
+
+  find_package(Doxygen)
+
+  if(Doxygen_FOUND)
+    doxygen_add_docs(project_docs example.c ALL USE_STAMP_FILE)
+  endif()
+
+.. code-block:: c
+  :caption: ``example.c``
+
+  /**
+   * @file example.c
+   * @brief A simple example to demonstrate Doxygen.
+   */
+
+  #include <stdio.h>
+
+  /**
+   * @brief Calculates the sum of two integers.
+   *
+   * @param a First integer.
+   * @param b Second integer.
+   * @return Sum of a and b.
+   *
+   * @par Example
+   * @code
+   * int result = sum(3, 4);
+   * printf("%d\n", result); // Outputs: 7
+   * @endcode
+   */
+  int sum(int a, int b) { return a + b; }
+
+  /**
+   * @brief Main function.
+   *
+   * @return 0 on success.
+   */
+  int main(void)
+  {
+    int result = sum(5, 7);
+    printf("Result: %d\n", result);
+    return 0;
+  }
+
+Example: Configuring Doxygen With Variables
+"""""""""""""""""""""""""""""""""""""""""""
+
+In the following example, Doxygen configuration is customized using CMake
+variables.  The configuration sets file patterns when using a directory as
+the source input (:variable:`CMAKE_CURRENT_SOURCE_DIR`), enables a theme
+toggle for switching between light and dark modes, suppresses Doxygen's
+standard output during the build phase, specifies a Markdown file as the
+main page, and disables warnings about undocumented code:
+
+.. code-block:: cmake
+
+  find_package(Doxygen)
+
+  if(Doxygen_FOUND)
+    set(DOXYGEN_FILE_PATTERNS *.c *.cxx *.md)
+    set(DOXYGEN_HTML_COLORSTYLE "TOGGLE")
+    set(DOXYGEN_QUIET YES)
+    set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
+    set(DOXYGEN_WARN_IF_UNDOCUMENTED NO)
+
+    doxygen_add_docs(example_docs ${CMAKE_CURRENT_SOURCE_DIR} ALL)
+  endif()
+
+Example: Custom Configuration File
+""""""""""""""""""""""""""""""""""
+
+In the following example, a custom ``Doxyfile`` configuration file is created
+in the current binary directory (:variable:`CMAKE_CURRENT_BINARY_DIR`) prior
+to calling the ``doxygen_add_doxs()``.  This allows project-specific
+configuration tags to be customized as needed:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  find_package(Doxygen)
+
+  if(Doxygen_FOUND)
+    configure_file(Doxyfile.in Doxyfile)
+
+    doxygen_add_doxs(
+      example_docs
+      foo.c bar.c
+      ALL
+      USE_STAMP_FILE
+      COMMENT "Generating project documentation with custom Doxyfile"
+      CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+    )
+  endif()
+
+.. code-block:: text
+  :caption: ``Doxyfile.in``
+
+  PROJECT_NAME           = "Customized project name"
+  OUTPUT_DIRECTORY       = "@CMAKE_CURRENT_BINARY_DIR@"
+  # ...
 #]=======================================================================]
 
 # For backwards compatibility support
@@ -694,7 +975,7 @@
 # Maintain the _FOUND variables as "YES" or "NO" for backwards
 # compatibility. This allows people to substitute them directly into
 # Doxyfile with configure_file().
-if(DOXYGEN_FOUND)
+if(Doxygen_FOUND)
     set(DOXYGEN_FOUND "YES")
 else()
     set(DOXYGEN_FOUND "NO")
@@ -874,7 +1155,7 @@
                           ${ARGN})
 
     if(NOT _args_COMMENT)
-        set(_args_COMMENT "Generate API documentation for ${targetName}")
+        set(_args_COMMENT "Generating API documentation for ${targetName}")
     endif()
 
     if(NOT _args_WORKING_DIRECTORY)
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 0dcf361..dd45e58 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -5,36 +5,39 @@
 FindEXPAT
 ---------
 
-Find the native Expat headers and library.
-Expat is a stream-oriented XML parser library written in C.
+Finds the native Expat headers and library.  Expat is a stream-oriented XML
+parser library written in C.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.10
-
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``EXPAT::EXPAT``
-  The Expat ``expat`` library, if found.
+  .. versionadded:: 3.10
+
+  Target encapsulating the Expat library (``expat``) usage requirements.  This
+  target is available only if Expat is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module sets the following variables:
 
 ``EXPAT_INCLUDE_DIRS``
-  where to find expat.h, etc.
+  Include directories containing ``expat.h`` and related headers needed to use
+  Expat.
 ``EXPAT_LIBRARIES``
-  the libraries to link against to use Expat.
+  Libraries needed to link against to use Expat.
 ``EXPAT_FOUND``
-  true if the Expat headers and libraries were found.
+  Boolean indicating whether the Expat is found.
 
 Hints
 ^^^^^
 
-``EXPAT_USE_STATIC_LIBS``
+This module accepts the following variables:
 
+``EXPAT_USE_STATIC_LIBS``
   .. versionadded:: 3.28
 
   Set to ``TRUE`` to use static libraries.
@@ -43,6 +46,15 @@
 
     Implemented on non-Windows platforms.
 
+Examples
+^^^^^^^^
+
+Finding Expat library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(EXPAT)
+  target_link_libraries(project_target PRIVATE EXPAT::EXPAT)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindEnvModules.cmake b/Modules/FindEnvModules.cmake
index 37901fc..3e7d800 100644
--- a/Modules/FindEnvModules.cmake
+++ b/Modules/FindEnvModules.cmake
@@ -7,126 +7,126 @@
 
 .. versionadded:: 3.15
 
-Locate an environment module implementation and make commands available to
-CMake scripts to use them.  This is compatible with both Lua-based Lmod
-and TCL-based EnvironmentModules.
-
-This module is intended for the use case of setting up the compiler and library
-environment within a :ref:`CTest Script <CTest Script>` (``ctest -S``).  It can
-also be used in a :ref:`CMake Script <Script Processing Mode>` (``cmake -P``).
-
-.. note::
-
-  The loaded environment will not survive past the end of the calling process.
-  Do not use this module in project code (``CMakeLists.txt`` files) to load
-  a compiler environment; it will not be available during the build.  Instead
-  load the environment manually before running CMake or using the generated
-  build system.
-
-Example Usage
-^^^^^^^^^^^^^
+Finds an Environment Modules implementation and provides commands for use in
+CMake scripts:
 
 .. code-block:: cmake
 
-  set(CTEST_BUILD_NAME "CrayLinux-CrayPE-Cray-dynamic")
-  set(CTEST_BUILD_CONFIGURATION Release)
-  set(CTEST_BUILD_FLAGS "-k -j8")
-  set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+  find_package(EnvModules [...])
 
-  ...
+The Environment Modules system is a command-line tool that manages Unix-like
+shell environments by dynamically modifying environment variables.
+It is commonly used in High-Performance Computing (HPC) environments to
+support multiple software versions or configurations.
 
-  find_package(EnvModules REQUIRED)
+This module is compatible with the two most common implementations:
 
-  env_module(purge)
-  env_module(load modules)
-  env_module(load craype)
-  env_module(load PrgEnv-cray)
-  env_module(load craype-knl)
-  env_module(load cray-mpich)
-  env_module(load cray-libsci)
+* Lua-based Lmod
+* TCL-based Environment Modules
 
-  set(ENV{CRAYPE_LINK_TYPE} dynamic)
+This module is primarily intended for setting up compiler and library
+environments within a :ref:`CTest Script <CTest Script>` (``ctest -S``).
+It may also be used in a :ref:`CMake Script <Script Processing Mode>`
+(``cmake -P``).
 
-  ...
+.. note::
+
+  The loaded environment will not persist beyond the end of the calling
+  process.  Do not use this module in CMake project code (such as
+  ``CMakeLists.txt``) to load compiler environments, as the environment
+  changes will not be available during the build phase.  In such a case, load
+  the desired environment before invoking CMake or the generated build system.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``EnvModules_FOUND``
-  True if a compatible environment modules framework was found.
+  Boolean indicating whether a compatible Environment Modules framework is
+  found.
 
 Cache Variables
 ^^^^^^^^^^^^^^^
 
-The following cache variable will be set:
+The following cache variables may also be set:
 
 ``EnvModules_COMMAND``
-  The low level module command to use.  Currently supported
-  implementations are the Lua based Lmod and TCL based EnvironmentModules.
+  The path to a low level module command to use.
 
-Environment Variables
-^^^^^^^^^^^^^^^^^^^^^
+Hints
+^^^^^
+
+This module accepts the following variables before calling the
+``find_package(EnvModules)``:
 
 ``ENV{MODULESHOME}``
-  Usually set by the module environment implementation, used as a hint to
-  locate the module command to execute.
+  This environment variable is usually set by the Environment Modules
+  implementation, and can be used as a hint to locate the module command to
+  execute.
 
-Provided Functions
-^^^^^^^^^^^^^^^^^^
+Commands
+^^^^^^^^
 
-This defines the following CMake functions for interacting with environment
-modules:
+This module provides the following commands for interacting with the
+Environment Modules system, if found:
 
 .. command:: env_module
 
-  Execute an arbitrary module command:
+  Executes an arbitrary module command:
 
   .. code-block:: cmake
 
-    env_module(cmd arg1 ... argN)
+    env_module(<command> <args>...)
     env_module(
-      COMMAND cmd arg1 ... argN
+      COMMAND <command> <args>...
       [OUTPUT_VARIABLE <out-var>]
       [RESULT_VARIABLE <ret-var>]
     )
 
   The options are:
 
-  ``cmd arg1 ... argN``
-    The module sub-command and arguments to execute as if they were
-    passed directly to the module command in your shell environment.
+  ``COMMAND <command> <args>...``
+    The module sub-command and arguments to execute as if passed directly to
+    the module command in the shell environment.
 
   ``OUTPUT_VARIABLE <out-var>``
-    The standard output from executing the module command.
+    Stores the standard output of the executed module command in the specified
+    variable.
 
   ``RESULT_VARIABLE <ret-var>``
-    The return code from executing the module command.
+    Stores the return code of the executed module command in the specified
+    variable.
 
 .. command:: env_module_swap
 
-  Swap one module for another:
+  Swaps one module for another:
 
   .. code-block:: cmake
 
-    env_module_swap(out_mod in_mod
+    env_module_swap(
+      <out-mod>
+      <in-mod>
       [OUTPUT_VARIABLE <out-var>]
       [RESULT_VARIABLE <ret-var>]
     )
 
-  This is functionally equivalent to the ``module swap out_mod in_mod`` shell
-  command.  The options are:
+  This is functionally equivalent to the ``module swap <out-mod> <in-mod>``
+  shell command.
+
+  The options are:
 
   ``OUTPUT_VARIABLE <out-var>``
-    The standard output from executing the module command.
+    Stores the standard output of the executed module command in the specified
+    variable.
 
   ``RESULT_VARIABLE <ret-var>``
-    The return code from executing the module command.
+    Stores the return code of the executed module command in the specified
+    variable.
 
 .. command:: env_module_list
 
-  Retrieve the list of currently loaded modules:
+  Retrieves the list of currently loaded modules:
 
   .. code-block:: cmake
 
@@ -138,7 +138,7 @@
 
 .. command:: env_module_avail
 
-  Retrieve the list of available modules:
+  Retrieves the list of available modules:
 
   .. code-block:: cmake
 
@@ -148,6 +148,58 @@
   command.  The result is stored in ``<out-var>`` as a properly formatted
   CMake :ref:`semicolon-separated list <CMake Language Lists>` variable.
 
+Examples
+^^^^^^^^
+
+In the following example, this module is used in a CTest script to configure
+the compiler and libraries for a Cray Programming Environment.
+After the Environment Modules system is found, the ``env_module()`` command is
+used to load the necessary compiler, MPI, and scientific libraries to set up
+the build environment.  The ``CRAYPE_LINK_TYPE`` environment variable is set
+to ``dynamic`` to specify dynamic linking.  This instructs the Cray Linux
+Environment compiler driver to link against dynamic libraries at runtime,
+rather than linking static libraries at compile time.  As a result, the
+compiler produces dynamically linked executable files.
+
+.. code-block:: cmake
+  :caption: ``example-script.cmake``
+
+  set(CTEST_BUILD_NAME "CrayLinux-CrayPE-Cray-dynamic")
+  set(CTEST_BUILD_CONFIGURATION Release)
+  set(CTEST_BUILD_FLAGS "-k -j8")
+  set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+
+  # ...
+
+  find_package(EnvModules REQUIRED)
+
+  # Clear all currently loaded Environment Modules to start with a clean state
+  env_module(purge)
+
+  # Load the base module-handling system to use other modules
+  env_module(load modules)
+
+  # Load Cray Programming Environment (Cray PE) support, which manages
+  # platform-specific optimizations and architecture selection
+  env_module(load craype)
+
+  # Load the Cray programming environment
+  env_module(load PrgEnv-cray)
+
+  # Load settings targeting the Intel Knights Landing (KNL) CPU architecture
+  env_module(load craype-knl)
+
+  # Load the Cray MPI (Message Passing Interface) library, needed for
+  # distributed computing
+  env_module(load cray-mpich)
+
+  # Load Cray's scientific library package, which includes optimized math
+  # libraries (like BLAS, LAPACK)
+  env_module(load cray-libsci)
+
+  set(ENV{CRAYPE_LINK_TYPE} dynamic)
+
+  # ...
 #]=======================================================================]
 
 function(env_module)
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index b7a6e5f..11c53a9 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -5,126 +5,194 @@
 FindFLEX
 --------
 
-Find Fast Lexical Analyzer (Flex) executable and provide a macro
-to generate custom build rules.
+Finds the Fast Lexical Analyzer (Flex) command-line generator and its library,
+and provides CMake commands to create custom build rules for using Flex:
 
-The module defines the following variables:
+.. code-block:: cmake
+
+  find_package(FLEX [<version>] ...)
+
+Flex generates lexical analyzers, also known as *scanners* or *lexers*.  It also
+includes a runtime library (``fl``) that supplies support functions for the
+generated scanners, such as input handling, buffer management, and error
+reporting.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
 
 ``FLEX_FOUND``
-  True if ``flex`` executable is found.
+  Boolean indicating whether (the requested version of) Flex is found.
+
+``FLEX_VERSION``
+  The version of Flex found.
+
+``FLEX_INCLUDE_DIRS``
+  The include directories containing headers for using Flex library.
+
+``FLEX_LIBRARIES``
+  The libraries needed to link against to use Flex library.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
 
 ``FLEX_EXECUTABLE``
   The path to the ``flex`` executable.
 
-``FLEX_VERSION``
-  The version of ``flex``.
+Commands
+^^^^^^^^
 
-``FLEX_LIBRARIES``
-  The ``flex`` libraries.
+This module provides the following commands if ``flex`` is found:
 
-``FLEX_INCLUDE_DIRS``
-  The path to the ``flex`` headers.
-
-The minimum required version of ``flex`` can be specified using the
-standard CMake syntax, e.g. :command:`find_package(FLEX 2.5.13)`.
-
-If ``flex`` is found on the system, the module defines the macro:
+Generating Scanners
+"""""""""""""""""""
 
 .. command:: flex_target
 
+  Creates a custom build rule to generate a scanner file from a lex file using
+  Flex:
+
   .. code-block:: cmake
 
-    flex_target(<Name> <FlexInput> <FlexOutput>
-                [OPTIONS <options>...]
-                [COMPILE_FLAGS <string>]
-                [DEFINES_FILE <string>]
-                )
+    flex_target(
+      <name>
+      <input-lex-file>
+      <output-scanner-file>
+      [DEFINES_FILE <header>]
+      [OPTIONS <options>...]
+      [COMPILE_FLAGS <string>] # Deprecated
+    )
 
-which creates a custom command to generate the ``<FlexOutput>`` file from
-the ``<FlexInput>`` file.  ``<Name>`` is an alias used to get details of this
-custom command.
+  .. versionchanged:: 3.17
+    When policy :policy:`CMP0098` is set to ``NEW``, ``flex`` runs in the
+    :variable:`CMAKE_CURRENT_BINARY_DIR` directory.
 
-The options are:
+  ``<name>``
+    String used as an identifier for this command invocation.
 
-``OPTIONS <options>...``
-  .. versionadded:: 4.0
+  ``<input-lex-file>``
+    The path to an input Flex source file (``.l``).  If given as a relative
+    path, it will be interpreted relative to the current source directory
+    (:variable:`CMAKE_CURRENT_SOURCE_DIR`).
 
-  A :ref:`semicolon-separated list <CMake Language Lists>` of flex options added
-  to the ``flex`` command line.
+  ``<output-scanner-file>``
+    The path of the output file to be generated by Flex.  If given as a relative
+    path, it will be interpreted relative to the current Flex working directory.
 
-``COMPILE_FLAGS <string>``
-  .. deprecated:: 4.0
+  ``DEFINES_FILE <header>``
+    .. versionadded:: 3.5
 
-  Space-separated flex options added to the ``flex`` command line.
-  A :ref:`;-list <CMake Language Lists>` will not work.
-  This option is deprecated in favor of ``OPTIONS <options>...``.
+    If Flex is configured to output a header file, this option may be used to
+    specify its name.  If given as a relative path, it will be interpreted
+    relative to the current Flex working directory.
 
-``DEFINES_FILE <string>``
-  .. versionadded:: 3.5
+  ``OPTIONS <options>...``
+    .. versionadded:: 4.0
 
-  If flex is configured to output a header file, this option may be used to
-  specify its name.
+    A :ref:`semicolon-separated list <CMake Language Lists>` of extra options
+    added to the ``flex`` command line.
 
-.. versionchanged:: 3.17
-  When :policy:`CMP0098` is set to ``NEW``, ``flex`` runs in the
-  :variable:`CMAKE_CURRENT_BINARY_DIR` directory.
+  ``COMPILE_FLAGS <string>``
+    .. deprecated:: 4.0
+      Superseded by ``OPTIONS <options>...``.
 
-The macro defines the following variables:
+    A string of space-separated extra options added to the ``flex`` command
+    line. A :ref:`semicolon-separated list <CMake Language Lists>` will not
+    work.
 
-``FLEX_<Name>_DEFINED``
-  True if the macro ran successfully.
+  .. rubric:: Command variables
 
-``FLEX_<Name>_OUTPUTS``
-  The source file generated by the custom rule, an alias for ``<FlexOutput>``.
+  This command also defines the following variables:
 
-``FLEX_<Name>_INPUT``
-  The flex source file, an alias for ``<FlexInput>``.
+  ``FLEX_<name>_DEFINED``
+    Boolean indicating whether this command was successfully invoked.
 
-``FLEX_<Name>_OUTPUT_HEADER``
-  The header flex output, if any.
+  ``FLEX_<name>_INPUT``
+    The Flex source file, an alias for ``<input-lex-file>``.
 
-``FLEX_<Name>_OPTIONS``
-  .. versionadded:: 4.0
+  ``FLEX_<name>_OUTPUT_HEADER``
+    .. versionadded:: 3.5
 
-  Options used in the ``flex`` command line.
+    The header file generated by ``flex``, if any.
 
-Flex scanners often use tokens defined by Bison: the code generated
-by Flex depends of the header generated by Bison.  This module also
-defines a macro:
+  ``FLEX_<name>_OUTPUTS``
+    A list of files generated by ``flex``, including the output scanner file,
+    and the header file.
+
+  ``FLEX_<name>_OPTIONS``
+    .. versionadded:: 4.0
+
+    A list of command-line options used for the ``flex`` command.
+
+Adding Dependency Between Scanner and Parser
+""""""""""""""""""""""""""""""""""""""""""""
 
 .. command:: add_flex_bison_dependency
 
+  Adds the required dependency between a scanner and a parser:
+
   .. code-block:: cmake
 
-    add_flex_bison_dependency(<FlexTarget> <BisonTarget>)
+    add_flex_bison_dependency(<flex-name> <bison-name>)
 
-which adds the required dependency between a scanner and a parser
-where ``<FlexTarget>`` and ``<BisonTarget>`` are the first parameters of
-respectively ``flex_target`` and ``bison_target`` macros.
+  Flex scanners often rely on token definitions generated by Bison, meaning the
+  code produced by Flex depends on the header file created by Bison.
+
+  This command adds the required dependency between a scanner and a parser
+  where ``<flex-name>`` and ``<bison-name>`` are the first parameters of
+  respectively ``flex_target(<name> ...)`` and
+  :command:`bison_target(<name> ...)` commands.
 
 Examples
 ^^^^^^^^
 
+Examples: Finding Flex
+""""""""""""""""""""""
+
+Finding Flex:
+
 .. code-block:: cmake
 
-  find_package(BISON)
   find_package(FLEX)
 
-  bison_target(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
-  flex_target(MyScanner lexer.l  ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
-  add_flex_bison_dependency(MyScanner MyParser)
+Finding Flex and specifying its minimum required version:
 
-  include_directories(${CMAKE_CURRENT_BINARY_DIR})
-  add_executable(Foo
-    Foo.cc
-    ${BISON_MyParser_OUTPUTS}
-    ${FLEX_MyScanner_OUTPUTS}
-  )
-  target_link_libraries(Foo ${FLEX_LIBRARIES})
+.. code-block:: cmake
+
+  find_package(FLEX 2.5.13)
+
+Finding Flex and making it required (if Flex is not found, processing stops
+with an error message):
+
+.. code-block:: cmake
+
+  find_package(FLEX 2.5.13 REQUIRED)
+
+Example: Generating Scanner
+"""""""""""""""""""""""""""
+
+Finding Flex and generating scanner source file in the current binary directory
+from the lex source file in the current source directory:
+
+.. code-block:: cmake
+
+  find_package(FLEX)
+
+  if(FLEX_FOUND)
+    flex_target(MyScanner lexer.l lexer.cpp)
+  endif()
+
+  add_executable(foo foo.cc ${FLEX_MyScanner_OUTPUTS})
+
+Example: Command-line Options
+"""""""""""""""""""""""""""""
 
 Adding additional command-line options to the ``flex`` executable can be passed
-as a list. For example, adding the ``--warn`` option to report warnings, and the
-``--noline`` (``-L``) to not generate ``#line`` directives.
+as a list.  For example, adding the ``--warn`` option to report warnings, and
+the ``--noline`` (``-L``) to not generate ``#line`` directives.
 
 .. code-block:: cmake
 
@@ -134,8 +202,9 @@
     flex_target(MyScanner lexer.l lexer.cpp OPTIONS --warn --noline)
   endif()
 
-Generator expressions can be used in ``OPTIONS <options...``. For example, to
-add the ``--debug`` (``-d``) option only for the ``Debug`` build type:
+:manual:`Generator expressions <cmake-generator-expressions(7)>` can be used in
+the ``OPTIONS <options>...`` argument.  For example, to add the ``--debug``
+(``-d``) option only for the ``Debug`` build type:
 
 .. code-block:: cmake
 
@@ -144,6 +213,60 @@
   if(FLEX_FOUND)
     flex_target(MyScanner lexer.l lexer.cpp OPTIONS $<$<CONFIG:Debug>:--debug>)
   endif()
+
+Example: Using Flex Library
+"""""""""""""""""""""""""""
+
+Finding Flex and creating an interface :ref:`imported target <Imported Targets>`
+that encapsulates its library usage requirements for linking to a project
+target:
+
+.. code-block:: cmake
+
+  find_package(FLEX)
+
+  if(FLEX_FOUND AND NOT TARGET FLEX::fl)
+    add_library(FLEX::fl INTERFACE IMPORTED)
+    set_target_properties(
+      FLEX::fl
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${FLEX_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${FLEX_LIBRARIES}"
+    )
+  endif()
+
+  if(FLEX_FOUND)
+    flex_target(MyScanner lexer.l lexer.cpp)
+  endif()
+
+  add_executable(Foo foo.cc ${FLEX_MyScanner_OUTPUTS})
+  target_link_libraries(Foo PRIVATE FLEX::fl)
+
+Example: Using Flex and Bison
+"""""""""""""""""""""""""""""
+
+The following example demonstrates, how to use Flex and :module:`Bison
+<FindBISON>` in CMake:
+
+.. code-block:: cmake
+
+  find_package(BISON)
+  find_package(FLEX)
+
+  if(BISON_FOUND AND FLEX_FOUND)
+    bison_target(MyParser parser.y parser.cpp)
+    flex_target(MyScanner lexer.l lexer.cpp)
+    add_flex_bison_dependency(MyScanner MyParser)
+  endif()
+
+  add_executable(Foo foo.cc ${BISON_MyParser_OUTPUTS} ${FLEX_MyScanner_OUTPUTS})
+
+  # ...
+
+See Also
+^^^^^^^^
+
+* The :module:`FindBISON` module to find Bison parser generator.
 #]=======================================================================]
 
 find_program(FLEX_EXECUTABLE NAMES flex win-flex win_flex DOC "path to the flex executable")
@@ -185,7 +308,7 @@
   endif()
 
   #============================================================
-  # FLEX_TARGET (public macro)
+  # flex_target() public macro
   #============================================================
   #
   macro(FLEX_TARGET Name Input Output)
@@ -209,12 +332,12 @@
       JOIN "\n" FLEX_TARGET_usage
       "Usage:"
       "  flex_target("
-      "    <Name>"
-      "    <Input>"
-      "    <Output>"
+      "    <name>"
+      "    <input-lex-file>"
+      "    <output-scanner-file>"
+      "    [DEFINES_FILE <header>]"
       "    [OPTIONS <options>...]"
       "    [COMPILE_FLAGS <string>]"
-      "    [DEFINES_FILE <string>]"
       "  )"
     )
 
@@ -319,7 +442,7 @@
 
 
   #============================================================
-  # ADD_FLEX_BISON_DEPENDENCY (public macro)
+  # add_flex_bison_dependency() public macro
   #============================================================
   #
   macro(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index 8305b65..6b3438c 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -5,82 +5,135 @@
 FindFLTK
 --------
 
-Find the Fast Light Toolkit (FLTK) library
+Finds the Fast Light Toolkit (FLTK), a cross-platform toolkit for GUI
+development.
 
-Input Variables
-^^^^^^^^^^^^^^^
+FLTK uses CMake-based build system and provides a package configuration file for
+projects to find it.  As of its 1.4.0 version it also provides
+:ref:`Imported Targets` that encapsulate usage requirements.  For example,
+``fltk::fltk``, which can be linked to project targets where FLTK is needed.
+This module takes that into account and first attempts to find FLTK in
+*config mode*.  If the configuration file is not available, it falls back to
+*module mode* and searches standard locations. See also to the official FLTK
+documentation for more information, how to use FLTK with CMake.
 
-By default this module will search for all of the FLTK components and
-add them to the ``FLTK_LIBRARIES`` variable.  You can limit the components
-which get placed in ``FLTK_LIBRARIES`` by defining one or more of the
-following three options:
-
-``FLTK_SKIP_OPENGL``
-  Set to true to disable searching for the FLTK GL library
-
-``FLTK_SKIP_FORMS``
-  Set to true to disable searching for the FLTK Forms library
-
-``FLTK_SKIP_IMAGES``
-  Set to true to disable searching for the FLTK Images library
-
-FLTK is composed also by a binary tool. You can set the following option:
-
-``FLTK_SKIP_FLUID``
-  Set to true to not look for the FLUID binary
+.. versionadded:: 3.11
+  Debug and Release library variants are found separately and use
+  per-configuration variables.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-The following variables will be defined:
+This module defines the following variables:
 
 ``FLTK_FOUND``
-  True if all components not skipped were found
-
-``FLTK_INCLUDE_DIR``
-  Path to the include directory for FLTK header files
+  Boolean indicating whether FLTK is found.
 
 ``FLTK_LIBRARIES``
-  List of the FLTK libraries found
-
-``FLTK_FLUID_EXECUTABLE``
-  Path to the FLUID binary tool
+  Libraries needed to link against to use FLTK.
 
 ``FLTK_WRAP_UI``
-  True if FLUID is found, used to enable the FLTK_WRAP_UI command
+  Boolean indicating whether the ``fluid`` executable is found.  This variable
+  is available only if FLTK is found in *module mode* and can be used, for
+  example, to conditionally invoke the :command:`fltk_wrap_ui` command if it is
+  needed and available.
 
 Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables are also available to set or use:
 
+``FLTK_FLUID_EXECUTABLE``
+  The path to the ``fluid`` binary tool.
+
+``FLTK_INCLUDE_DIR``
+  The include directory containing header files needed to use FLTK.
+
 ``FLTK_BASE_LIBRARY_RELEASE``
-  The FLTK base library (optimized)
+  .. versionadded:: 3.11
+
+  The path to the release (optimized) FLTK base library.
 
 ``FLTK_BASE_LIBRARY_DEBUG``
-  The FLTK base library (debug)
+  .. versionadded:: 3.11
+
+  The path to the debug FLTK base library.
 
 ``FLTK_GL_LIBRARY_RELEASE``
-  The FLTK GL library (optimized)
+  .. versionadded:: 3.11
+
+  The path to the release (optimized) FLTK GL library.
 
 ``FLTK_GL_LIBRARY_DEBUG``
-  The FLTK GL library (debug)
+  .. versionadded:: 3.11
+
+  The path to the debug FLTK GL library.
 
 ``FLTK_FORMS_LIBRARY_RELEASE``
-  The FLTK Forms library (optimized)
+  .. versionadded:: 3.11
+
+  The path to the release (optimized) FLTK Forms library.
 
 ``FLTK_FORMS_LIBRARY_DEBUG``
-  The FLTK Forms library (debug)
+  .. versionadded:: 3.11
+
+  The path to the debug FLTK Forms library.
 
 ``FLTK_IMAGES_LIBRARY_RELEASE``
-  The FLTK Images protobuf library (optimized)
+  .. versionadded:: 3.11
+
+  The path to the release (optimized) FLTK Images protobuf library.
 
 ``FLTK_IMAGES_LIBRARY_DEBUG``
-  The FLTK Images library (debug)
+  .. versionadded:: 3.11
 
-.. versionadded:: 3.11
-  Debug and Release variants are found separately and use per-configuration
-  variables.
+  The path to the debug FLTK Images library.
+
+Input Variables
+^^^^^^^^^^^^^^^
+
+By default, this module searches for all FLTK libraries and its ``fluid``
+executable.  The following variables can be set before calling
+``find_package(FLTK)`` to indicate which elements are optional for a successful
+configuration:
+
+``FLTK_SKIP_FLUID``
+  Set to boolean true to mark the ``fluid`` executable as optional.
+
+``FLTK_SKIP_FORMS``
+  Set to boolean true to mark the FLTK Forms library as optional; it will
+  therefore not be included in the ``FLTK_LIBRARIES`` result variable.
+
+``FLTK_SKIP_IMAGES``
+  Set to boolean true to mark the FLTK Image library as optional; it will
+  therefore not be included in the ``FLTK_LIBRARIES`` result variable.
+
+``FLTK_SKIP_OPENGL``
+  Set to boolean true to mark the FLTK OpenGL library as optional; it will
+  therefore not be included in the ``FLTK_LIBRARIES`` result variable.
+
+Examples
+^^^^^^^^
+
+Finding FLTK and conditionally creating a ``fltk::fltk`` imported interface
+target, if it is not provided by the upstream FLTK package.  Imported target can
+then be linked to a project target:
+
+.. code-block:: cmake
+
+  find_package(FLTK)
+
+  if(FLTK_FOUND AND NOT TARGET fltk::fltk)
+    add_library(fltk::fltk INTERFACE IMPORTED)
+    set_target_properties(
+      fltk::fltk
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${FLTK_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${FLTK_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE fltk::fltk)
 #]=======================================================================]
 
 if(NOT FLTK_SKIP_OPENGL)
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 83c5d20..c839d3f 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -5,25 +5,66 @@
 FindFLTK2
 ---------
 
-Find the native FLTK 2.0 includes and library
+.. note::
 
-The following settings are defined
+  This module is specifically for FLTK version 2.x.  The 2.0 series was
+  originally a development branch intended as the next major version of FLTK.
+  However, it never reached stable release status, and active development has
+  shifted back to the FLTK 1.x branch.  For finding FLTK, including stable and
+  modern versions, use the :module:`FindFLTK` module instead.
 
-::
+Finds the Fast Light Toolkit (FLTK) version 2.x, a cross-platform toolkit for
+GUI development.
 
-  FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
-  FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
-  FLTK2_INCLUDE_DIR, where to find include files
-  FLTK2_LIBRARIES, list of fltk2 libraries
-  FLTK2_FOUND, Don't use FLTK2 if false.
+Result Variables
+^^^^^^^^^^^^^^^^
 
-The following settings should not be used in general.
+This module defines the following variables:
 
-::
+``FLTK2_FOUND``
+  Boolean indicating whether FLTK 2.x is found.
 
-  FLTK2_BASE_LIBRARY   = the full path to fltk2.lib
-  FLTK2_GL_LIBRARY     = the full path to fltk2_gl.lib
-  FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
+``FLTK2_LIBRARIES``
+  Libraries needed to link against to use FLTK 2.x.
+
+``FLTK2_WRAP_UI``
+  Boolean indicating whether the ``fluid2`` executable is found.  This variable
+  can be used, for example, to conditionally invoke the :command:`fltk_wrap_ui`
+  command if it is needed and available.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``FLTK2_FLUID_EXECUTABLE``
+  The path to the ``fluid2`` binary tool.
+
+``FLTK2_INCLUDE_DIR``
+  The directory containing header files needed to use FLTK 2.x.
+
+``FLTK2_BASE_LIBRARY``
+  The path to the FLTK 2.x library (``fltk2``).
+
+``FLTK2_GL_LIBRARY``
+  The path to the FLTK 2.x OpenGL compatibility library (``fltk2_gl``).
+
+``FLTK2_IMAGES_LIBRARY``
+  The path to the FLTK 2.x Images library (``fltk2_images``).
+
+Examples
+^^^^^^^^
+
+Finding FLTK version 2:
+
+.. code-block:: cmake
+
+  find_package(FLTK2)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindFLTK` module to find FLTK in a version-agnostic way.
 #]=======================================================================]
 
 set (FLTK2_DIR $ENV{FLTK2_DIR} )
diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake
index a4546fd..218ad2f 100644
--- a/Modules/FindFontconfig.cmake
+++ b/Modules/FindFontconfig.cmake
@@ -7,38 +7,51 @@
 
 .. versionadded:: 3.14
 
-Find Fontconfig headers and library.
+Finds Fontconfig, a library for font configuration and customization.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
+This module provides the following :ref:`Imported Targets`:
+
 ``Fontconfig::Fontconfig``
-  The Fontconfig library, if found.
+  Target encapsulating the Fontconfig usage requirements, available if
+  Fontconfig is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This will define the following variables in your project:
+This module defines the following variables:
 
 ``Fontconfig_FOUND``
-  true if (the requested version of) Fontconfig is available.
+  Boolean indicating whether the (requested version of) Fontconfig is found.
 ``Fontconfig_VERSION``
-  the version of Fontconfig.
+  The version of Fontconfig found.
 ``Fontconfig_LIBRARIES``
-  the libraries to link against to use Fontconfig.
+  The libraries to link against to use Fontconfig.
 ``Fontconfig_INCLUDE_DIRS``
-  where to find the Fontconfig headers.
+  The include directories containing headers needed to use Fontconfig.
 ``Fontconfig_COMPILE_OPTIONS``
-  this should be passed to target_compile_options(), if the
-  target is not used for linking
+  Compiler options needed to use Fontconfig.  These should be passed to
+  :command:`target_compile_options` when not using the
+  ``Fontconfig::Fontconfig`` imported target.
 
+Examples
+^^^^^^^^
+
+Finding Fontconfig and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Fontconfig)
+  target_link_libraries(project_target PRIVATE Fontconfig::Fontconfig)
 #]=======================================================================]
 
 cmake_policy(PUSH)
 cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
 
 # use pkg-config to get the directories and then use these values
-# in the FIND_PATH() and FIND_LIBRARY() calls
+# in the find_path() and find_library() calls
 find_package(PkgConfig QUIET)
 if(PKG_CONFIG_FOUND)
   pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig)
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 8a8e002..0a4d9a3 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -5,46 +5,72 @@
 FindFreetype
 ------------
 
-Find the FreeType font renderer includes and library.
+Finds the FreeType font renderer library.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.10
-
-This module defines the following :prop_tgt:`IMPORTED` target:
+This module provides the following :ref:`Imported Targets`:
 
 ``Freetype::Freetype``
-  The Freetype ``freetype`` library, if found
+  .. versionadded:: 3.10
+
+  Target encapsulating the Freetype library usage requirements, available if
+  Freetype is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
-``FREETYPE_FOUND``
-  true if the Freetype headers and libraries were found
+``Freetype_FOUND``
+  Boolean indicating whether the (requested version of) Freetype is found.  For
+  backward compatibility, the ``FREETYPE_FOUND`` variable is also set to the
+  same value.
+
 ``FREETYPE_INCLUDE_DIRS``
-  directories containing the Freetype headers. This is the
-  concatenation of the variables:
+  Include directories containing headers needed to use Freetype.  This is the
+  concatenation of ``FREETYPE_INCLUDE_DIR_ft2build`` and
+  ``FREETYPE_INCLUDE_DIR_freetype2`` variables.
 
-  ``FREETYPE_INCLUDE_DIR_ft2build``
-    directory holding the main Freetype API configuration header
-  ``FREETYPE_INCLUDE_DIR_freetype2``
-    directory holding Freetype public headers
 ``FREETYPE_LIBRARIES``
-  the library to link against
+  Libraries needed to link against for using Freetype.
+
 ``FREETYPE_VERSION_STRING``
-  the version of freetype found
+  The version of Freetype found.
 
 .. versionadded:: 3.7
-  Debug and Release variants are found separately.
+  Debug and Release library variants are found separately.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``FREETYPE_INCLUDE_DIR_ft2build``
+  The directory containing the main Freetype API configuration header.
+
+``FREETYPE_INCLUDE_DIR_freetype2``
+  The directory containing Freetype public headers.
 
 Hints
 ^^^^^
 
-The user may set the environment variable ``FREETYPE_DIR`` to the root
-directory of a Freetype installation.
+This module accepts the following variables:
+
+``FREETYPE_DIR``
+  The user may set this environment variable to the root directory of a Freetype
+  installation to find Freetype in non-standard locations.
+
+Examples
+^^^^^^^^
+
+Finding Freetype and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Freetype)
+  target_link_libraries(project_target PRIVATE Freetype::Freetype)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindGCCXML.cmake b/Modules/FindGCCXML.cmake
index 43ca395..fdab959 100644
--- a/Modules/FindGCCXML.cmake
+++ b/Modules/FindGCCXML.cmake
@@ -5,17 +5,28 @@
 FindGCCXML
 ----------
 
+.. versionchanged:: 4.1
+  This module is available only if policy :policy:`CMP0188` is not set to ``NEW``.
+  Port projects to search for CastXML by calling ``find_program`` directly.
+
 Find the GCC-XML front-end executable.
 
-
-
 This module will define the following variables:
 
-::
-
-  GCCXML - the GCC-XML front-end executable.
+``GCCXML``
+  The GCC-XML front-end executable.
 #]=======================================================================]
 
+cmake_policy(GET CMP0188 _FindGCCXML_CMP0188)
+if(_FindGCCXML_CMP0188 STREQUAL "NEW")
+  message(FATAL_ERROR "The FindGCCXML module has been removed by policy CMP0188.")
+endif()
+
+if(_FindGCCXML_testing)
+  set(_FindGCCXML_included TRUE)
+  return()
+endif()
+
 find_program(GCCXML
   NAMES gccxml
         ../GCC_XML/gccxml
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index 81c5080..585b846 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -5,45 +5,65 @@
 FindGIF
 -------
 
-This finds the Graphics Interchange Format (GIF) library (``giflib``)
+Finds the Graphics Interchange Format (GIF) library (``giflib``).
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module defines the following :prop_tgt:`IMPORTED` target:
+This module provides the following :ref:`Imported Targets`:
 
 ``GIF::GIF``
-  The ``giflib`` library, if found.
+  .. versionadded:: 3.14
 
-Result variables
+  Target that encapsulates the usage requirements of the GIF library, available
+  when the library is found.
+
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module sets the following variables:
 
 ``GIF_FOUND``
-  If false, do not try to use GIF.
+  Boolean indicating whether the GIF library was found.
 ``GIF_INCLUDE_DIRS``
-  where to find gif_lib.h, etc.
+  Include directories needed to use the GIF library.
 ``GIF_LIBRARIES``
-  the libraries needed to use GIF.
+  Libraries needed to link to the GIF library.
 ``GIF_VERSION``
-  3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6.
+  Version string of the GIF library found (for example, ``5.1.4``).  For GIF
+  library versions prior to 4.1.6, version string will be set only to ``3`` or
+  ``4`` as these versions did not provide version information in their headers.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``GIF_INCLUDE_DIR``
-  where to find the GIF headers.
+  Directory containing the ``gif_lib.h`` and other GIF library headers.
 ``GIF_LIBRARY``
-  where to find the GIF library.
+  Path to the GIF library.
 
 Hints
 ^^^^^
 
-``GIF_DIR`` is an environment variable that would correspond to the
-``./configure --prefix=$GIF_DIR``.
+This module accepts the following variables:
+
+``GIF_DIR``
+  Environment variable that can be set to help locate a GIF library installed in
+  a custom location.  It should point to the installation destination that was
+  used when configuring, building, and installing GIF library:
+  ``./configure --prefix=$GIF_DIR``.
+
+Examples
+^^^^^^^^
+
+Finding GIF library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(GIF)
+  target_link_libraries(project_target PRIVATE GIF::GIF)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index 083217e..03d19bf 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -5,61 +5,128 @@
 FindGLEW
 --------
 
-Find the OpenGL Extension Wrangler Library (GLEW)
+Finds the OpenGL Extension Wrangler Library (GLEW).
 
-Input Variables
-^^^^^^^^^^^^^^^
+GLEW is a cross-platform C/C++ library that helps manage OpenGL extensions by
+providing efficient run-time mechanisms to query and load OpenGL functionality
+beyond the core specification.
 
-The following variables may be set to influence this module's behavior:
+.. versionadded:: 3.7
+  Debug and Release library variants are found separately.
 
-``GLEW_USE_STATIC_LIBS``
-  to find and create :prop_tgt:`IMPORTED` target for static linkage.
-
-``GLEW_VERBOSE``
-  to output a detailed log of this module.
+.. versionadded:: 3.15
+  If GLEW is built using its CMake-based build system, it provides a CMake
+  package configuration file (``GLEWConfig.cmake``).  This module now takes that
+  into account and first attempts to find GLEW in *config mode*.  If the
+  configuration file is not available, it falls back to *module mode* and
+  searches standard locations.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.1
+This module provides the following :ref:`Imported Targets`:
 
-This module defines the following :ref:`Imported Targets <Imported Targets>`:
+``GLEW::GLEW``
+  .. versionadded:: 3.1
 
+  The main imported target encapsulating the GLEW usage requirements, available
+  if GLEW is found.  It maps usage requirements of either ``GLEW::glew`` or
+  ``GLEW::glew_s`` target depending on their availability.
 
 ``GLEW::glew``
-  The GLEW shared library.
+  .. versionadded:: 3.15
+
+  Target encapsulating the usage requirements for a shared GLEW library.  This
+  target is available if GLEW is found and static libraries aren't requested via
+  the ``GLEW_USE_STATIC_LIBS`` hint variable (see below).
+
 ``GLEW::glew_s``
-  The GLEW static library, if ``GLEW_USE_STATIC_LIBS`` is set to ``TRUE``.
-``GLEW::GLEW``
-  Duplicates either ``GLEW::glew`` or ``GLEW::glew_s`` based on availability.
+  .. versionadded:: 3.15
+
+  Target encapsulating the usage requirements for a static GLEW library.  This
+  target is available if GLEW is found and the ``GLEW_USE_STATIC_LIBS`` hint
+  variable is set to boolean true.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``GLEW_INCLUDE_DIRS``
-  include directories for GLEW
-``GLEW_LIBRARIES``
-  libraries to link against GLEW
-``GLEW_SHARED_LIBRARIES``
-  libraries to link against shared GLEW
-``GLEW_STATIC_LIBRARIES``
-  libraries to link against static GLEW
 ``GLEW_FOUND``
-  true if GLEW has been found and can be used
+  Boolean indicating whether GLEW is found.
+
 ``GLEW_VERSION``
-  GLEW version
+  .. versionadded:: 3.15
+
+  The version of GLEW found.
+
 ``GLEW_VERSION_MAJOR``
-  GLEW major version
+  .. versionadded:: 3.15
+
+  The major version of GLEW found.
+
 ``GLEW_VERSION_MINOR``
-  GLEW minor version
+  .. versionadded:: 3.15
+
+  The minor version of GLEW found.
+
 ``GLEW_VERSION_MICRO``
-  GLEW micro version
+  .. versionadded:: 3.15
 
-.. versionadded:: 3.7
-  Debug and Release variants are found separately.
+  The micro version of GLEW found.
 
+``GLEW_INCLUDE_DIRS``
+  Include directories needed to use GLEW library.
+
+``GLEW_LIBRARIES``
+  Libraries needed to link against to use GLEW library (shared or static
+  depending on configuration).
+
+``GLEW_SHARED_LIBRARIES``
+  .. versionadded:: 3.15
+
+  Libraries needed to link against to use shared GLEW library.
+
+``GLEW_STATIC_LIBRARIES``
+  .. versionadded:: 3.15
+
+  Libraries needed to link against to use static GLEW library.
+
+Hints
+^^^^^
+
+This module accepts the following variables before calling
+``find_package(GLEW)`` to influence this module's behavior:
+
+``GLEW_USE_STATIC_LIBS``
+  .. versionadded:: 3.15
+
+  Set to boolean true to find static GLEW library and create the
+  ``GLEW::glew_s`` imported target for static linkage.
+
+``GLEW_VERBOSE``
+  .. versionadded:: 3.15
+
+  Set to boolean true to output a detailed log of this module.  Can be used, for
+  example, for debugging.
+
+Examples
+^^^^^^^^
+
+Finding GLEW and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(GLEW)
+  target_link_libraries(project_target PRIVATE GLEW::GLEW)
+
+Using the static GLEW library, if found:
+
+.. code-block:: cmake
+
+  set(GLEW_USE_STATIC_LIBS TRUE)
+  find_package(GLEW)
+  target_link_libraries(project_target PRIVATE GLEW::GLEW)
 #]=======================================================================]
 
 include(FindPackageHandleStandardArgs)
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 3704e85..e29758d 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -5,17 +5,18 @@
 FindGLUT
 --------
 
-Find OpenGL Utility Toolkit (GLUT) library and include files.
+Finds the OpenGL Utility Toolkit (GLUT) library, which provides a simple API for
+creating windows, handling input, and managing events in OpenGL applications.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.1
-
-This module defines the :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``GLUT::GLUT``
- Defined if the system has GLUT.
+  .. versionadded:: 3.1
+
+  Target encapsulating the GLUT usage requirements, available if GLUT is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
@@ -23,45 +24,48 @@
 This module defines the following variables:
 
 ``GLUT_FOUND``
-  True if ``glut`` was found.
+  Boolean indicating whether GLUT is found.
 
 ``GLUT_INCLUDE_DIRS``
   .. versionadded:: 3.23
 
-  Where to find GL/glut.h, etc.
+  Include directories needed to use GLUT.  Starting with CMake 3.23, this
+  variable is intended to be used in target usage requirements instead of the
+  cache variable ``GLUT_INCLUDE_DIR``, which is intended for finding GLUT.
 
 ``GLUT_LIBRARIES``
-  List of libraries for using ``glut``.
+  List of libraries needed to link against for using GLUT.
 
 Cache Variables
 ^^^^^^^^^^^^^^^
 
-This module may set the following variables depending on platform.
+This module may set the following cache variables depending on platform.
 These variables may optionally be set to help this module find the
-correct files, but clients should not use these as results:
+correct files, but should not be used as result variables:
 
 ``GLUT_INCLUDE_DIR``
-  The full path to the directory containing ``GL/glut.h``,
-  not including ``GL/``.
+  The full path to the directory containing ``GL/glut.h`` (without the ``GL/``).
 
 ``GLUT_glut_LIBRARY``
-  The full path to the glut library.
-
-``GLUT_Xmu_LIBRARY``
-  The full path to the Xmu library.
+  The full path to the ``glut`` library.
 
 ``GLUT_Xi_LIBRARY``
-  The full path to the Xi Library.
+  The full path to the dependent ``Xi`` (X Input Device Extension) library on
+  some systems.
 
-Obsolete Variables
-^^^^^^^^^^^^^^^^^^
+``GLUT_Xmu_LIBRARY``
+  The full path to the dependent ``Xmu`` (X Miscellaneous Utilities) library on
+  some systems.
 
-The following variables may also be provided, for backwards compatibility:
+Examples
+^^^^^^^^
 
-``GLUT_INCLUDE_DIR``
-  This is one of above `Cache Variables`_, but prior to CMake 3.23 was
-  also a result variable.  Prefer to use ``GLUT_INCLUDE_DIRS`` instead
-  in CMake 3.23 and above.
+Finding GLUT and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(GLUT)
+  target_link_libraries(project_target PRIVATE GLUT::GLUT)
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake
index 5714979..a3cd654 100644
--- a/Modules/FindGSL.cmake
+++ b/Modules/FindGSL.cmake
@@ -7,7 +7,7 @@
 
 .. versionadded:: 3.2
 
-Find the native GNU Scientific Library (GSL) includes and libraries.
+Finds the native GNU Scientific Library (GSL) includes and libraries.
 
 The GNU Scientific Library (GSL) is a numerical library for C and C++
 programmers. It is free software under the GNU General Public
@@ -16,47 +16,71 @@
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-If GSL is found, this module defines the following :prop_tgt:`IMPORTED`
-targets::
+If GSL is found, this module defines the following :ref:`Imported Targets`:
 
- GSL::gsl      - The main GSL library.
- GSL::gslcblas - The CBLAS support library used by GSL.
+``GSL::gsl``
+  The main GSL library that provides all usage requirements to use GSL.
+``GSL::gslcblas``
+  The CBLAS support library used by GSL.  It is linked also into the
+  ``GSL::gsl`` target but provided separately for granularity.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project::
+This module will set the following variables in the project:
 
- GSL_FOUND          - True if GSL found on the local system
- GSL_INCLUDE_DIRS   - Location of GSL header files.
- GSL_LIBRARIES      - The GSL libraries.
- GSL_VERSION        - The version of the discovered GSL install.
+``GSL_FOUND``
+  True if GSL is found on the local system.
+``GSL_INCLUDE_DIRS``
+  Directory containing GSL header files.
+``GSL_LIBRARIES``
+  The GSL libraries.
+``GSL_VERSION``
+  The version of the discovered GSL installation.
 
 Hints
 ^^^^^
 
-Set ``GSL_ROOT_DIR`` to a directory that contains a GSL installation.
+``GSL_ROOT_DIR``
+  Set this variable to a directory that contains a GSL installation.
 
-This script expects to find libraries at ``$GSL_ROOT_DIR/lib`` and the GSL
-headers at ``$GSL_ROOT_DIR/include/gsl``.  The library directory may
-optionally provide Release and Debug folders. If available, the libraries
-named ``gsld``, ``gslblasd`` or ``cblasd`` are recognized as debug libraries.
-For Unix-like systems, this script will use ``$GSL_ROOT_DIR/bin/gsl-config``
-(if found) to aid in the discovery of GSL.
+  If this variable is not set, this module will use pkg-config and default paths
+  to find GSL.  If this variable is provided, then this module expects to find
+  libraries at ``${GSL_ROOT_DIR}/lib`` and the GSL headers at
+  ``${GSL_ROOT_DIR}/include/gsl``.
+
+  The library directory may optionally provide Release and Debug folders.  If
+  available, the libraries named ``gsld``, ``gslblasd`` or ``cblasd`` are
+  recognized as debug libraries.  For Unix-like systems, this module will also
+  use ``gsl-config`` (if found) to aid in the discovery of GSL.
 
 Cache Variables
 ^^^^^^^^^^^^^^^
 
 This module may set the following variables depending on platform and type
 of GSL installation discovered.  These variables may optionally be set to
-help this module find the correct files::
+help this module find the correct files:
 
- GSL_CBLAS_LIBRARY       - Location of the GSL CBLAS library.
- GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any).
- GSL_CONFIG_EXECUTABLE   - Location of the ``gsl-config`` script (if any).
- GSL_LIBRARY             - Location of the GSL library.
- GSL_LIBRARY_DEBUG       - Location of the debug GSL library (if any).
+``GSL_CBLAS_LIBRARY``
+  Location of the GSL CBLAS library.
+``GSL_CBLAS_LIBRARY_DEBUG``
+  Location of the debug GSL CBLAS library (if any).
+``GSL_CONFIG_EXECUTABLE``
+  Location of the ``gsl-config`` script (if any).
+``GSL_LIBRARY``
+  Location of the GSL library.
+``GSL_LIBRARY_DEBUG``
+  Location of the debug GSL library (if any).
 
+Examples
+^^^^^^^^
+
+Finding GSL and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(GSL)
+  target_link_libraries(project_target PRIVATE GSL::gsl)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index c10f0c8..6e39f5a 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -5,14 +5,64 @@
 FindGTK
 -------
 
-Find GTK, glib and GTKGLArea
+Finds GTK, glib and GTKGLArea.
 
-::
+GTK is a multi-platform toolkit for creating graphical user interfaces.
 
-  GTK_INCLUDE_DIR   - Directories to include to use GTK
-  GTK_LIBRARIES     - Files to link against to use GTK
-  GTK_FOUND         - GTK was found
-  GTK_GL_FOUND      - GTK's GL features were found
+.. note::
+
+  This module works only on Unix-like systems and was intended for early GTK
+  branch of 1.x, which is no longer maintained.  Use the latest supported GTK
+  version and :module:`FindPkgConfig` module to find GTK in CMake instead of
+  this module.  For example:
+
+  .. code-block:: cmake
+
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk4>=4.14)
+    target_link_libraries(example PRIVATE PkgConfig::GTK)
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``GTK_FOUND``
+  Boolean indicating whether GTK is found.
+``GTK_GL_FOUND``
+  Boolean indicating whether GTK's GL features are found.
+``GTK_INCLUDE_DIR``
+  Include directories containing headers needed to use GTK.
+``GTK_LIBRARIES``
+  Libraries needed to link against for using GTK.
+
+Examples
+^^^^^^^^
+
+Finding GTK 1.x and creating an interface :ref:`imported target
+<Imported Targets>` that encapsulates its usage requirements for linking to a
+project target:
+
+.. code-block:: cmake
+
+  find_package(GTK)
+
+  if(GTK_FOUND)
+    add_library(GTK::GTK INTERFACE IMPORTED)
+    set_target_properties(
+      GTK::GTK
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${GTK_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${GTK_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE GTK::GTK)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindGTK2` module to find GTK version 2.
 #]=======================================================================]
 
 # don't even bother under WIN32
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 7b1e8ab..9c5bc63 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -5,89 +5,151 @@
 FindGTK2
 --------
 
-Find the GTK2 widget libraries and several of its other optional components
-like ``gtkmm``, ``glade``, and ``glademm``.
+Finds the GTK widget libraries and several of its other optional components.
 
-Specify one or more of the following components as you call this find
-module.  See example below.
+GTK is a multi-platform toolkit for creating graphical user interfaces.
 
-* ``gtk``
-* ``gtkmm``
-* ``glade``
-* ``glademm``
+.. note::
+
+  This module is specifically for GTK version 2.x, which is obsolete and no
+  longer maintained.  Use the latest supported GTK version and
+  :module:`FindPkgConfig` module to find GTK in CMake instead of this module.
+  For example:
+
+  .. code-block:: cmake
+
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk4>=4.14)
+    target_link_libraries(example PRIVATE PkgConfig::GTK)
+
+Components
+^^^^^^^^^^
+
+This module supports optional components, which can be specified with the
+:command:`find_package` command:
+
+.. code-block:: cmake
+
+  find_package(GTK2 [COMPONENTS <components>...])
+
+Supported components include:
+
+.. hlist::
+
+  * ``atk``
+  * ``atkmm``
+  * ``cairo``
+  * ``cairomm``
+  * ``gdk_pixbuf``
+  * ``gdk``
+  * ``gdkmm``
+  * ``gio``
+  * ``giomm``
+  * ``glade``
+  * ``glademm``
+  * ``glib``
+  * ``glibmm``
+  * ``gmodule``
+  * ``gobject``
+  * ``gthread``
+  * ``gtk``
+  * ``gtkmm``
+  * ``pango``
+  * ``pangocairo``
+  * ``pangoft2``
+  * ``pangomm``
+  * ``pangoxft``
+  * ``sigc``
+
+* .. versionadded:: 3.16.7
+    ``harfbuzz``
+
+If no components are specified, module by default searches for the ``gtk``
+component.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module defines the following :prop_tgt:`IMPORTED` targets (subject to
+This module provides the following :ref:`Imported Targets` (subject to
 component selection):
 
-``GTK2::atk``, ``GTK2::atkmm``, ``GTK2::cairo``, ``GTK2::cairomm``,
-``GTK2::gdk_pixbuf``, ``GTK2::gdk``, ``GTK2::gdkmm``, ``GTK2::gio``,
-``GTK2::giomm``, ``GTK2::glade``, ``GTK2::glademm``, ``GTK2::glib``,
-``GTK2::glibmm``, ``GTK2::gmodule``, ``GTK2::gobject``, ``GTK2::gthread``,
-``GTK2::gtk``, ``GTK2::gtkmm``, ``GTK2::harfbuzz``, ``GTK2::pango``,
-``GTK2::pangocairo``, ``GTK2::pangoft2``, ``GTK2::pangomm``,
-``GTK2::pangoxft``, ``GTK2::sigc``.
+``GTK2::<component>``
+  Target encapsulating the specified GTK component usage requirements,
+  available if GTK and this component are found.  The ``<component>`` should
+  be written in the same case, as listed above.  For example, use
+  ``GTK2::gtk`` for the ``gtk`` component, or ``GTK2::gdk_pixbuf`` for the
+  ``gdk_pixbuf`` component, etc.
 
-.. versionadded:: 3.16.7
-  Added the ``GTK2::harfbuzz`` target.
+``GTK2::sigc++``
+  .. versionadded:: 3.5
+
+  Target encapsulating the usage requirements to enable c++11 on its dependents
+  when using sigc++ 2.5.1 or higher.  This target is automatically applied to
+  dependent targets as needed.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-The following variables will be defined for your use
+This module defines the following variables:
 
 ``GTK2_FOUND``
-  Were all of your specified components found?
+  Boolean indicating whether GTK and all specified components are found.
+``GTK2_VERSION``
+  The version of GTK found (x.y.z).
+``GTK2_MAJOR_VERSION``
+  The major version of GTK found.
+``GTK2_MINOR_VERSION``
+  The minor version of GTK found.
+``GTK2_PATCH_VERSION``
+  The patch version of GTK found.
 ``GTK2_INCLUDE_DIRS``
-  All include directories
+  Include directories containing headers needed to use GTK.
 ``GTK2_LIBRARIES``
-  All libraries
+  Libraries needed to link against to use GTK.
 ``GTK2_TARGETS``
   .. versionadded:: 3.5
-    All imported targets
-``GTK2_DEFINITIONS``
-  Additional compiler flags
-``GTK2_VERSION``
-  The version of GTK2 found (x.y.z)
-``GTK2_MAJOR_VERSION``
-  The major version of GTK2
-``GTK2_MINOR_VERSION``
-  The minor version of GTK2
-``GTK2_PATCH_VERSION``
-  The patch version of GTK2
 
-.. versionadded:: 3.5
-  When ``GTK2_USE_IMPORTED_TARGETS`` is set to ``TRUE``, ``GTK2_LIBRARIES``
-  will list imported targets instead of library paths.
+  A list of all defined imported targets.
+``GTK2_DEFINITIONS``
+  Additional compiler flags needed to use GTK.
 
 Input Variables
 ^^^^^^^^^^^^^^^
 
-Optional variables you can define prior to calling this module:
+This module accepts the following optional variables before calling the
+``find_package(GTK2)``:
 
 ``GTK2_DEBUG``
-  Enables verbose debugging of the module
+  Boolean variable that enables verbose debugging output of this module.
+
 ``GTK2_ADDITIONAL_SUFFIXES``
-  Allows defining additional directories to search for include files
+  A list of additional path suffixes to search for include files.
 
-Example Usage
-^^^^^^^^^^^^^
+``GTK2_USE_IMPORTED_TARGETS``
+  .. versionadded:: 3.5
 
-Call :command:`find_package` once.  Here are some examples to pick from:
+  When this variable is set to boolean true, ``GTK2_LIBRARIES`` variable will
+  contain a list imported targets instead of library paths.
+
+Examples
+^^^^^^^^
+
+Examples: Finding GTK version 2
+"""""""""""""""""""""""""""""""
+
+Call :command:`find_package` once.  Here are some examples to pick from.
 
 Require GTK 2.6 or later:
 
 .. code-block:: cmake
 
-  find_package(GTK2 2.6 REQUIRED gtk)
+  find_package(GTK2 2.6 REQUIRED COMPONENTS gtk)
 
-Require GTK 2.10 or later and Glade:
+Require GTK 2.10 or later and its Glade component:
 
 .. code-block:: cmake
 
-  find_package(GTK2 2.10 REQUIRED gtk glade)
+  find_package(GTK2 2.10 REQUIRED COMPONENTS gtk glade)
 
 Search for GTK/GTKMM 2.8 or later:
 
@@ -95,15 +157,32 @@
 
   find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
 
-Use the results:
+Finding GTK 2 and linking it to a project target:
 
 .. code-block:: cmake
 
-  if(GTK2_FOUND)
-    include_directories(${GTK2_INCLUDE_DIRS})
-    add_executable(mygui mygui.cc)
-    target_link_libraries(mygui ${GTK2_LIBRARIES})
-  endif()
+  find_package(GTK2)
+  add_executable(mygui mygui.cc)
+  target_link_libraries(mygui PRIVATE GTK2::gtk)
+
+Examples: Finding GTK version 3 or later
+""""""""""""""""""""""""""""""""""""""""
+
+Finding GTK 3 with :module:`FindPkgConfig` instead of this module:
+
+.. code-block:: cmake
+
+  find_package(PkgConfig REQUIRED)
+  pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0>=3.14)
+  target_link_libraries(example PRIVATE PkgConfig::GTK3)
+
+Or similarly to find GTK 4:
+
+.. code-block:: cmake
+
+  find_package(PkgConfig REQUIRED)
+  pkg_check_modules(GTK4 REQUIRED IMPORTED_TARGET gtk4>=4.14)
+  target_link_libraries(example PRIVATE PkgConfig::GTK4)
 #]=======================================================================]
 
 # Version 1.6 (CMake 3.0)
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 83fbe3a..3043768 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -5,98 +5,238 @@
 FindGTest
 ---------
 
-Locate the Google C++ Testing Framework.
+Finds GoogleTest, the Google C++ testing and mocking framework:
+
+.. code-block:: cmake
+
+  find_package(GTest [...])
+
+The GoogleTest framework also includes GoogleMock, a library for writing
+and using C++ mock classes.  On some systems, GoogleMock may be distributed
+as a separate package.
+
+When both debug and release (optimized) variants of the GoogleTest and
+GoogleMock libraries are available, this module selects the appropriate
+variants based on the current :ref:`Build Configuration <Build Configurations>`.
 
 .. versionadded:: 3.20
-  Upstream ``GTestConfig.cmake`` is used if possible.
+  If GoogleTest is built and installed using its CMake-based build system, it
+  provides a :ref:`package configuration file <Config File Packages>`
+  (``GTestConfig.cmake``) that can be used with :command:`find_package` in
+  :ref:`Config mode`.  By default, this module now searches for that
+  configuration file and, if found, returns the results without further
+  action.  If the upstream configuration file is not found, this module falls
+  back to :ref:`Module mode` and searches standard locations.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.20
-  This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``GTest::gtest``
-  The Google Test ``gtest`` library, if found; adds Thread::Thread
-  automatically
-``GTest::gtest_main``
-  The Google Test ``gtest_main`` library, if found
+  .. versionadded:: 3.20
 
-.. versionadded:: 3.23
+  Target encapsulating the usage requirements of the GoogleTest ``gtest``
+  library, available if GoogleTest is found.  The ``gtest`` library provides
+  the core GoogleTest testing framework functionality.
+
+``GTest::gtest_main``
+  .. versionadded:: 3.20
+
+  Target encapsulating the usage requirements of the GoogleTest ``gtest_main``
+  library, available if GoogleTest is found.  The ``gtest_main`` library
+  provides a ``main()`` function, allowing tests to be run without defining
+  one manually.
+
+  Only link to ``GTest::gtest_main`` if GoogleTest should supply the
+  ``main()`` function for the executable.  If the project is supplying its
+  own ``main()`` implementation, link only to ``GTest::gtest``.
 
 ``GTest::gmock``
-  The Google Mock ``gmock`` library, if found; adds Thread::Thread
-  automatically
+  .. versionadded:: 3.23
+
+  Target encapsulating the usage requirements of the GoogleMock ``gmock``
+  library, available if GoogleTest and its Mock library are found.  The
+  ``gmock`` library provides facilities for writing and using mock classes
+  in C++.
+
 ``GTest::gmock_main``
-  The Google Mock ``gmock_main`` library, if found
+  .. versionadded:: 3.23
 
-.. deprecated:: 3.20
-  For backwards compatibility, this module defines additionally the
-  following deprecated :prop_tgt:`IMPORTED` targets (available since 3.5):
+  Target encapsulating the usage requirements of the GoogleMock ``gmock_main``
+  library, available if GoogleTest and ``gmock_main`` are found.  The
+  ``gmock_main`` library provides a ``main()`` function, allowing GoogleMock
+  tests to be run without defining one manually.
 
-``GTest::GTest``
-  The Google Test ``gtest`` library, if found; adds Thread::Thread
-  automatically
-``GTest::Main``
-  The Google Test ``gtest_main`` library, if found
+  Only link to ``GTest::gmock_main`` if GoogleTest should supply the
+  ``main()`` function for the executable.  If project is supplying its own
+  ``main()`` implementation, link only to ``GTest::gmock``.
 
-Result variables
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``GTest_FOUND``
-  Found the Google Testing framework
-``GTEST_INCLUDE_DIRS``
-  the directory containing the Google Test headers
+  Boolean indicating whether GoogleTest is found.
 
-The library variables below are set as normal variables.  These
-contain debug/optimized keywords when a debugging library is found.
+Hints
+^^^^^
 
-``GTEST_LIBRARIES``
-  The Google Test ``gtest`` library; note it also requires linking
-  with an appropriate thread library
-``GTEST_MAIN_LIBRARIES``
-  The Google Test ``gtest_main`` library
-``GTEST_BOTH_LIBRARIES``
-  Both ``gtest`` and ``gtest_main``
-
-Cache variables
-^^^^^^^^^^^^^^^
-
-The following cache variables may also be set:
+This module accepts the following variables before calling
+``find_package(GTest)``:
 
 ``GTEST_ROOT``
-  The root directory of the Google Test installation (may also be
-  set as an environment variable)
+  The root directory of the GoogleTest installation (may also be set as an
+  environment variable).  This variable is used only when GoogleTest is found
+  in :ref:`Module mode`.
+
 ``GTEST_MSVC_SEARCH``
-  If compiling with MSVC, this variable can be set to ``MT`` or
-  ``MD`` (the default) to enable searching a GTest build tree
+  When compiling with MSVC, this variable controls which GoogleTest build
+  variant to search for, based on the runtime library linkage model.  This
+  variable is used only when GoogleTest is found in :ref:`Module mode` and
+  accepts one of the following values:
 
+  ``MD``
+    (Default) Searches for shared library variants of GoogleTest that are
+    built to link against the dynamic C runtime.  These libraries are
+    typically compiled with the MSVC runtime flags ``/MD`` or ``/MDd`` (for
+    Release or Debug, respectively).
 
-Example usage
-^^^^^^^^^^^^^
+  ``MT``
+    Searches for static library variants of GoogleTest that are built to
+    link against the static C runtime.  These libraries are typically
+    compiled with the MSVC runtime flags ``/MT`` or ``/MTd``.
+
+Deprecated Items
+^^^^^^^^^^^^^^^^
+
+Deprecated Variables
+""""""""""""""""""""
+
+The following variables are provided for backward compatibility:
+
+``GTEST_INCLUDE_DIRS``
+  .. deprecated:: 4.1
+    Use the ``GTest::gtest`` imported target instead, which exposes the
+    required include directories through its
+    :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target property.
+
+  Result variable that provides include directories containing headers
+  needed to use GoogleTest.  This variable is only guaranteed to be available
+  when GoogleTest is found in :ref:`Module mode`.
+
+``GTEST_LIBRARIES``
+  .. deprecated:: 4.1
+    Use the ``GTest::gtest`` imported target instead.
+
+  Result variable providing libraries needed to link against to use the
+  GoogleTest ``gtest`` library.  Note that projects are also responsible
+  for linking with an appropriate thread library in addition to the libraries
+  specified by this variable.
+
+``GTEST_MAIN_LIBRARIES``
+  .. deprecated:: 4.1
+    Use the ``GTest::gtest_main`` imported target instead.
+
+  Result variable providing libraries needed to link against to use the
+  GoogleTest ``gtest_main`` library.
+
+``GTEST_BOTH_LIBRARIES``
+  .. deprecated:: 4.1
+    Use the ``GTest::gtest`` and ``GTest::gtest_main`` imported targets
+    instead.
+
+  Result variable providing both ``gtest`` and ``gtest_main`` libraries
+  combined.
+
+Deprecated Imported Targets
+"""""""""""""""""""""""""""
+
+For backward compatibility, this module also provides the following imported
+targets (available since CMake 3.5):
+
+``GTest::GTest``
+  .. deprecated:: 3.20
+    Use the ``GTest::gtest`` imported target instead.
+
+  Imported target linking the ``GTest::gtest`` library.
+
+``GTest::Main``
+  .. deprecated:: 3.20
+    Use the ``GTest::gtest_main`` imported target instead.
+
+  Imported target linking the ``GTest::gtest_main`` library.
+
+Examples
+^^^^^^^^
+
+Examples: Finding GoogleTest
+""""""""""""""""""""""""""""
+
+Finding GoogleTest:
 
 .. code-block:: cmake
 
-    enable_testing()
-    find_package(GTest REQUIRED)
+  find_package(GoogleTest)
 
-    add_executable(foo foo.cc)
-    target_link_libraries(foo GTest::gtest GTest::gtest_main)
+Or, finding GoogleTest and making it required (if not found, processing stops
+with an error message):
 
-    add_test(AllTestsInFoo foo)
+.. code-block:: cmake
 
+  find_package(GoogleTest REQUIRED)
 
-Deeper integration with CTest
+Examples: Using Imported Targets
+""""""""""""""""""""""""""""""""
+
+In the following example, the ``GTest::gtest`` imported target is linked to
+a project target, which enables using the core GoogleTest testing framework:
+
+.. code-block:: cmake
+
+  find_package(GTest REQUIRED)
+
+  target_link_libraries(foo PRIVATE GTest::gtest)
+
+In the next example, the ``GTest::gtest_main`` imported target is also linked
+to the executable, and a test is registered.  The ``GTest::gtest_main`` library
+provides a ``main()`` function, so there is no need to write one manually.
+The ``GTest::gtest`` library is still linked because the test code directly
+uses things provided by ``GTest::gtest``, and good practice is to link directly
+to libraries used directly.
+
+.. code-block:: cmake
+
+  enable_testing()
+
+  find_package(GTest REQUIRED)
+
+  add_executable(foo foo.cc)
+  target_link_libraries(foo PRIVATE GTest::gtest GTest::gtest_main)
+
+  add_test(NAME AllTestsInFoo COMMAND foo)
+
+Deeper Integration With CTest
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-See :module:`GoogleTest` for information on the :command:`gtest_add_tests`
-and :command:`gtest_discover_tests` commands.
+This module is commonly used with the :module:`GoogleTest` module, which
+provides :command:`gtest_discover_tests` and :command:`gtest_add_tests`
+commands to help integrate GoogleTest infrastructure with CTest:
+
+.. code-block:: cmake
+
+  find_package(GTest)
+  target_link_libraries(example PRIVATE GTest::gtest GTest::gtest_main)
+
+  include(GoogleTest)
+  gtest_discover_tests(example)
+
+  # ...
 
 .. versionchanged:: 3.9
-  Previous CMake versions defined :command:`gtest_add_tests` macro in this
-  module.
+  Previous CMake versions defined the :command:`gtest_add_tests` command in
+  this module.
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/GoogleTest.cmake)
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 9aae486..71d41e0 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -5,83 +5,385 @@
 FindGettext
 -----------
 
-Find GNU gettext tools.
+Finds the GNU gettext tools and provides commands for producing multi-lingual
+messages:
 
-This module looks for the GNU gettext tools.
+.. code-block:: cmake
+
+  find_package(Gettext [<version>] ...)
+
+GNU gettext is a system for internationalization (i18n) and localization
+(l10n), consisting of command-line tools and a runtime library (``libintl``).
+This module finds the gettext tools (such as ``msgmerge`` and ``msgfmt``),
+while the runtime library can be found using the separate :module:`FindIntl`
+module, which abstracts ``libintl`` handling across various implementations.
+
+Common file types used with gettext:
+
+POT files
+  Portable Object Template (``.pot``) files used as the source template for
+  translations.
+
+PO files
+  Portable Object (``.po``) files containing human-readable translations.
+
+MO files
+  Machine Object (``.mo``) files compiled from ``.po`` files for runtime use.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``GETTEXT_FOUND``
-  True if gettext has been found.
+``Gettext_FOUND``
+  Boolean indicating whether (the requested version of) gettext is found.  For
+  backward compatibility, the ``GETTEXT_FOUND`` variable is also set to the same
+  value.
 
 ``GETTEXT_VERSION_STRING``
   The version of gettext found.
 
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
 ``GETTEXT_MSGMERGE_EXECUTABLE``
-  The full path to the msgmerge tool.
+  The full path to the ``msgmerge`` tool for merging message catalog and
+  template.
 
 ``GETTEXT_MSGFMT_EXECUTABLE``
-  The full path to the msgfmt tool.
+  The full path to the ``msgfmt`` tool for compiling message catalog to a binary
+  format.
 
-Functions
-^^^^^^^^^
+Commands
+^^^^^^^^
 
-This module provides several function.
-
-.. command:: gettext_create_translations
-
-  .. code-block:: cmake
-
-    gettext_create_translations(<mofile> [ALL] <file>...)
-
-  This will create a target "translations" which will convert the
-  given input .po files into the binary output .mo file. Options:
-
-  ``ALL``
-    The translations will be created when building the default target.
-
-.. command:: gettext_process_pot_file
-
-  .. code-block:: cmake
-
-      gettext_process_pot_file(<potfile> [ALL]
-                               [INSTALL_DESTINATION <destdir>]
-                               LANGUAGES <lang>...)
-
-  This function creates a custom target "potfile" which processes the given
-  .pot file to .mo files. Options:
-
-  ``ALL``
-    The .pot file will be processed when building the default target.
-
-  ``INSTALL_DESTINATION``
-    Install the results into the given directory (``share/locale/`` by
-    default). The language subdirectory will be taken into account.
+This module provides the following commands to work with gettext in CMake, if
+gettext is found:
 
 .. command:: gettext_process_po_files
 
+  Creates a build rule that processes one or more ``.po`` translation files
+  into binary ``.mo`` files for a specified translatable language locale:
+
   .. code-block:: cmake
 
-    gettext_process_po_files(<lang> [ALL]
-                             [INSTALL_DESTINATION <dir>]
-                             PO_FILES <pofile>...)
+    gettext_process_po_files(
+      <language>
+      [ALL]
+      [INSTALL_DESTINATION <destdir>]
+      PO_FILES <po-files>...
+    )
 
-  This function creates a custom target "pofiles", which processes the given
-  .po files to .mo files for the given language. Options:
+  This command defines a custom target that compiles the given ``<po-files>``
+  into ``.mo`` files for the specified ``<language>``.  On first invocation,
+  it also creates a global custom target named ``pofiles``, to which all
+  subsequent invocations contribute.  This target can be used to build all
+  translation files collectively or referenced in other CMake commands.
+
+  This command should be invoked separately for each language locale to
+  generate the appropriate ``.mo`` files per locale.
+
+  The arguments are:
+
+  ``<language>``
+    The target translatable language locale of the PO files.
+
+    This string is typically formatted as a locale identifier (e.g., ``de_DE``
+    for German as used in Germany, or ``de_AT`` for German as used in Austria,
+    etc.).  The part before the underscore specifies the language, and the
+    part after specifies the country or regional variant.  In some cases, a
+    shorter form using only the language code (e.g., ``de``) may also be used.
 
   ``ALL``
-    The .po files will be processed when building the default target.
+    This option adds the generated target to the default CMake build target so
+    that translations are built by default.
 
-  ``INSTALL_DESTINATION``
-    Install the results into the given directory (``share/locale/`` by
-    default). The language subdirectory will be taken into account .
+  ``INSTALL_DESTINATION <destdir>``
+    Specifies the installation directory for the generated ``.mo`` files at
+    the install phase.  If specified, files are installed to:
+    ``<destdir>/<language>/LC_MESSAGES/*.mo``.  If not specified, files are
+    not installed.
 
-.. versionadded:: 3.2
-  If you wish to use the Gettext runtime library (libintl), use
-  :module:`FindIntl`.
+  ``PO_FILES <po-files>...``
+    A list of one or more ``.po`` translation files to be compiled into
+    ``.mo`` files at build phase for the specified ``<language>``.  Relative
+    paths will be interpreted relative to the current source directory
+    (:variable:`CMAKE_CURRENT_SOURCE_DIR`).
+
+.. command:: gettext_process_pot_file
+
+  Creates a build rule that processes a gettext Portable Object Template
+  (``.pot``) file and associated ``.po`` files into compiled gettext Machine
+  Object (``.mo``) files:
+
+  .. code-block:: cmake
+
+    gettext_process_pot_file(
+      <pot-file>
+      [ALL]
+      [INSTALL_DESTINATION <destdir>]
+      LANGUAGES <languages>...
+    )
+
+  This command defines a custom target named ``potfiles`` that compiles the
+  given ``<pot-file>`` and language-specific ``.po`` files into binary ``.mo``
+  files for each specified language.  The corresponding ``<language>.po``
+  files must exist in the current binary directory
+  (:variable:`CMAKE_CURRENT_BINARY_DIR`) before this command is invoked.
+
+  The arguments are:
+
+  ``<pot-file>``
+    The path to the gettext Portable Object Template file (``.pot``) serving
+    as the source for translations.  If given as a relative path, it will be
+    interpreted relative to the current source directory
+    (:variable:`CMAKE_CURRENT_SOURCE_DIR`).
+
+  ``ALL``
+    Adds the generated target to the default CMake build target so that the
+    files are built by default.
+
+  ``INSTALL_DESTINATION <destdir>``
+    Specifies the installation directory for the generated ``.mo`` files at
+    the install phase.  If specified, files are installed to:
+    ``<destdir>/<language>/LC_MESSAGES/<pot-base-filename>.mo``.  If not
+    specified, files are not installed.
+
+  ``LANGUAGES <languages>...``
+    A list of one or more translatable language locales (e.g., ``en_US``,
+    ``fr``, ``de_DE``, ``zh_CN``, etc.).
+
+.. command:: gettext_create_translations
+
+  Creates a build rule that processes a given ``.pot`` template file and
+  associated ``.po`` translation files into compiled Machine Object (``.mo``)
+  files:
+
+  .. code-block:: cmake
+
+    gettext_create_translations(<pot-file> [ALL] <po-files>...)
+
+  This command defines a custom target named ``translations`` that compiles
+  the specified ``<pot-file>`` and ``<po-files>`` into binary ``.mo`` files.
+  It also automatically adds an install rule for the generated ``.mo`` files,
+  installing them into the default
+  ``share/locale/<language>/LC_MESSAGES/<pot-base-filename>.mo`` path during
+  the install phase.
+
+  The arguments are:
+
+  ``<pot-file>``
+    The path to the gettext Portable Object Template file (``.pot``) serving
+    as the source for translations.  If given as a relative path, it will be
+    interpreted relative to the current source directory
+    (:variable:`CMAKE_CURRENT_SOURCE_DIR`).
+
+  ``ALL``
+    Adds the generated target to the default CMake build target so that
+    translations are created by default during the build.
+
+  ``<po-files>...``
+    A list of one or more translation source files in ``.po`` format, whose
+    filenames must follow the format ``<language>.po``.  Relative paths will
+    be interpreted relative to the current source directory
+    (:variable:`CMAKE_CURRENT_SOURCE_DIR`).
+
+  .. note::
+    For better control over build and installation behavior, use
+    :command:`gettext_process_po_files` instead.
+
+Examples
+^^^^^^^^
+
+Examples: Finding gettext
+"""""""""""""""""""""""""
+
+Finding the GNU gettext tools:
+
+.. code-block:: cmake
+
+  find_package(Gettext)
+
+Or, finding gettext and specifying a minimum required version:
+
+.. code-block:: cmake
+
+  find_package(Gettext 0.21)
+
+Or, finding gettext and making it required (if not found, processing stops
+with an error message):
+
+.. code-block:: cmake
+
+  find_package(Gettext REQUIRED)
+
+Example: Working With gettext in CMake
+""""""""""""""""""""""""""""""""""""""
+
+When starting with gettext, ``.pot`` file is considered to be created manually.
+For example, using a ``xgettext`` tool on the provided ``main.cxx`` source
+code file:
+
+.. code-block:: c++
+  :caption: ``main.cxx``
+  :emphasize-lines: 18
+
+  #include <iostream>
+  #include <libintl.h>
+  #include <locale.h>
+
+  int main()
+  {
+    // Set locale from environment
+    setlocale(LC_ALL, "");
+
+    // Bind the text domain
+    const char* dir = std::getenv("TEXTDOMAINDIR");
+    if (!dir) {
+      dir = "/usr/local/share/locale";
+    }
+    bindtextdomain("MyApp", dir);
+    textdomain("MyApp");
+
+    std::cout << gettext("Hello, World") << std::endl;
+
+    return 0;
+  }
+
+The ``xgettext`` tool extracts all strings from ``gettext()`` calls in provided
+source code and creates translatable strings:
+
+.. code-block:: console
+
+  $ xgettext -o MyApp.pot main.cxx
+
+Translatable files can be initialized by the project manually using
+``msginit`` tool:
+
+.. code-block:: console
+
+  $ mkdir -p locale/de_DE
+  $ msginit -l de_DE.UTF8 -o locale/de_DE/MyApp.po -i MyApp.pot --no-translator
+
+which creates a human-readable file that can be translated into a desired
+language (adjust as needed):
+
+.. code-block:: po
+  :caption: ``locale/de_DE/MyApp.po``
+  :emphasize-lines: 9
+
+  msgid ""
+  msgstr ""
+  "Language: de\n"
+  "Content-Type: text/plain; charset=UTF-8\n"
+  "Content-Transfer-Encoding: 8bit\n"
+  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+  msgid "Hello, World"
+  msgstr "Hallo, Welt"
+
+In CMake, the :command:`gettext_process_po_files` command provided by this
+module automatically creates the needed ``.mo`` files that application loads
+at runtime depending on the system environment variables such as ``LANG``.
+In the following example, also the :module:`GNUInstallDirs` module is used
+to provide the ``CMAKE_INSTALL_LOCALEDIR`` variable:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+  :emphasize-lines: 9-14
+
+  cmake_minimum_required(VERSION 3.24)
+  project(GettextExample)
+  include(GNUInstallDirs)
+
+  find_package(Gettext)
+
+  if(Gettext_FOUND)
+    foreach(language IN ITEMS de_DE)
+      gettext_process_po_files(
+        ${language}
+        ALL
+        PO_FILES locale/${language}/MyApp.po
+        INSTALL_DESTINATION ${CMAKE_INSTALL_LOCALEDIR}
+      )
+    endforeach()
+  endif()
+
+  add_executable(example main.cxx)
+
+  # Find and link Intl library to use gettext() from libintl.h
+  find_package(Intl)
+  target_link_libraries(example PRIVATE Intl::Intl)
+
+  install(TARGETS example)
+
+.. code-block:: console
+
+  $ cmake -B build
+  $ cmake --build build
+  $ DESTDIR=$(pwd)/stage cmake --install build
+
+To utilize the translations, the ``de_DE`` locale needs to be enabled on the
+system (see ``locale -a``).  And then the localized output can be run:
+
+.. code-block:: console
+
+  $ LANG=de_DE.UTF-8 TEXTDOMAINDIR=./stage/usr/local/share/locale \
+    ./stage/usr/local/bin/example
+
+Example: Processing POT File
+""""""""""""""""""""""""""""
+
+The :command:`gettext_process_pot_file` command processes ``.po`` translation
+files located in the current binary directory into ``.mo`` files:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  find_package(Gettext)
+
+  if(Gettext_FOUND)
+    set(languages de_DE fr zh_CN)
+
+    foreach(language IN LISTS languages)
+      configure_file(locale/${language}.po ${language}.po COPYONLY)
+    endforeach()
+
+    gettext_process_pot_file(
+      MyApp.pot
+      ALL
+      INSTALL_DESTINATION ${CMAKE_INSTALL_LOCALEDIR}
+      LANGUAGES ${languages}
+    )
+  endif()
+
+Example: Creating Translations
+""""""""""""""""""""""""""""""
+
+Using a simplified :command:`gettext_create_translations` command to create
+``.mo`` files:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  find_package(Gettext)
+
+  if(Gettext_FOUND)
+    gettext_create_translations(
+      MyApp.pot
+      ALL
+      locale/de_DE.po
+      locale/fr.po
+      locale/zh_CN.po
+    )
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :module:`FindIntl` module to find the Gettext runtime library (libintl).
 #]=======================================================================]
 
 find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
@@ -95,7 +397,7 @@
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
   get_filename_component(msgmerge_name ${GETTEXT_MSGMERGE_EXECUTABLE} NAME)
   get_filename_component(msgmerge_namewe ${GETTEXT_MSGMERGE_EXECUTABLE} NAME_WE)
-  if (gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
+  if(gettext_version MATCHES "^(${msgmerge_name}|${msgmerge_namewe}) \\([^\\)]*\\) ([0-9\\.]+[^ \n]*)")
     set(GETTEXT_VERSION_STRING "${CMAKE_MATCH_2}")
   endif()
   unset(gettext_version)
@@ -116,7 +418,7 @@
   endif()
   set(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
   math(EXPR currentCounter "${currentCounter} + 1")
-  set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
+  set_property(GLOBAL PROPERTY ${propertyName} ${currentCounter})
 endfunction()
 
 macro(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
@@ -134,7 +436,7 @@
     set(_firstPoFile)
   endif()
 
-  foreach (_currentPoFile ${_firstPoFile} ${ARGN})
+  foreach(_currentPoFile ${_firstPoFile} ${ARGN})
     get_filename_component(_absFile ${_currentPoFile} ABSOLUTE)
     get_filename_component(_abs_PATH ${_absFile} PATH)
     get_filename_component(_lang ${_absFile} NAME_WE)
@@ -142,7 +444,7 @@
 
     add_custom_command(
       OUTPUT ${_gmoFile}
-      COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
+      COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none ${_absFile} ${_absPotFile}
       COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
       DEPENDS ${_absPotFile} ${_absFile}
     )
@@ -150,7 +452,7 @@
     install(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
     set(_gmoFiles ${_gmoFiles} ${_gmoFile})
 
-  endforeach ()
+  endforeach()
 
   if(NOT TARGET translations)
     add_custom_target(translations)
@@ -177,13 +479,13 @@
   string(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
   get_filename_component(_absPotFile ${_potFile} ABSOLUTE)
 
-  foreach (_lang ${_parsedArguments_LANGUAGES})
+  foreach(_lang ${_parsedArguments_LANGUAGES})
     set(_poFile  "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
     set(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
 
     add_custom_command(
       OUTPUT "${_poFile}"
-      COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
+      COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none ${_poFile} ${_absPotFile}
       DEPENDS ${_absPotFile}
     )
 
@@ -197,7 +499,7 @@
       install(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
     endif()
     list(APPEND _gmoFiles ${_gmoFile})
-  endforeach ()
+  endforeach()
 
   if(NOT TARGET potfiles)
     add_custom_target(potfiles)
@@ -245,7 +547,7 @@
     add_custom_target(pofiles)
   endif()
 
-  _GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
+  _GETTEXT_GET_UNIQUE_TARGET_NAME(pofiles uniqueTargetName)
 
   if(_parsedArguments_ALL)
     add_custom_target(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index f0caf4e..2b6187e 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -5,30 +5,61 @@
 FindGit
 -------
 
-The module defines the following variables:
+Finds the Git distributed version control system.
 
-``GIT_EXECUTABLE``
-  Path to Git command-line client.
-``Git_FOUND``, ``GIT_FOUND``
-  True if the Git command-line client was found.
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following :ref:`Imported Targets` when the
+:prop_gbl:`CMAKE_ROLE` is ``PROJECT``:
+
+``Git::Git``
+  .. versionadded:: 3.14
+
+  Target that encapsulates Git command-line client executable.  It can be used
+  in :manual:`generator expressions <cmake-generator-expressions(7)>`, and
+  commands like :command:`add_custom_target` and :command:`add_custom_command`.
+  This target is available only if Git is found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Git_FOUND``
+  Boolean indicating whether the Git was found.  For backward compatibility, the
+  ``GIT_FOUND`` variable is also set to the same value.
 ``GIT_VERSION_STRING``
   The version of Git found.
 
-.. versionadded:: 3.14
-  The module defines the following ``IMPORTED`` targets (when
-  :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
+Cache Variables
+^^^^^^^^^^^^^^^
 
-``Git::Git``
-  Executable of the Git command-line client.
+The following cache variables may also be set:
 
-Example usage:
+``GIT_EXECUTABLE``
+  Path to the ``git`` command-line client executable.
+
+Examples
+^^^^^^^^
+
+Finding Git and retrieving the latest commit from the project repository:
 
 .. code-block:: cmake
 
-   find_package(Git)
-   if(Git_FOUND)
-     message("Git found: ${GIT_EXECUTABLE}")
-   endif()
+  find_package(Git)
+  if(Git_FOUND)
+    execute_process(
+      COMMAND ${GIT_EXECUTABLE} --no-pager log -n 1 HEAD "--pretty=format:%h %s"
+      OUTPUT_VARIABLE output
+      RESULT_VARIABLE result
+      ERROR_QUIET
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    if(result EQUAL 0)
+      message(STATUS "Last Git commit: ${output}")
+    endif()
+  endif()
 #]=======================================================================]
 
 # Look for 'git'
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index 2f1033b..d9d8260 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -5,34 +5,81 @@
 FindGnuTLS
 ----------
 
-Find the GNU Transport Layer Security library (gnutls)
+Finds the GNU Transport Layer Security library (GnuTLS).  The GnuTLS
+package includes the main libraries (libgnutls and libdane), as well as the
+optional gnutls-openssl compatibility extra library.  They are all distributed
+as part of the same release.  This module checks for the presence of the main
+libgnutls library and provides usage requirements for integrating GnuTLS into
+CMake projects.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.16
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``GnuTLS::GnuTLS``, if
-gnutls has been found.
+``GnuTLS::GnuTLS``
+  .. versionadded:: 3.16
+
+  Target encapsulating the GnuTLS usage requirements, available if GnuTLS is
+  found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-``GNUTLS_FOUND``
-  System has gnutls
-``GNUTLS_INCLUDE_DIR``
-  The gnutls include directory
-``GNUTLS_LIBRARIES``
-  The libraries needed to use gnutls
-``GNUTLS_DEFINITIONS``
-  Compiler switches required for using gnutls
+This module defines the following variables:
+
+``GnuTLS_FOUND``
+  Boolean indicating whether the (requested version of) GnuTLS is found.  For
+  backward compatibility, the ``GNUTLS_FOUND`` variable is also set to the same
+  value.
+
 ``GNUTLS_VERSION``
-  version of gnutls.
+  .. versionadded:: 3.16
+
+  The version of GnuTLS found.
+
+``GNUTLS_INCLUDE_DIRS``
+  Include directories needed to use GnuTLS.
+
+``GNUTLS_LIBRARIES``
+  Libraries needed to link against to use GnuTLS.
+
+``GNUTLS_DEFINITIONS``
+  Compiler options required for using GnuTLS.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``GNUTLS_INCLUDE_DIR``
+  The directory containing the ``gnutls/gnutls.h`` header file.
+
+``GNUTLS_LIBRARY``
+  The path to the GnuTLS library.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
+
+These variables are provided for backward compatibility:
+
+``GNUTLS_VERSION_STRING``
+  .. deprecated:: 3.16
+    Superseded by ``GNUTLS_VERSION``.
+
+  The version of GnuTLS found.
+
+Examples
+^^^^^^^^
+
+Finding GnuTLS and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(GnuTLS)
+  target_link_libraries(project_target PRIVATE GnuTLS::GnuTLS)
 #]=======================================================================]
 
-# Note that this doesn't try to find the gnutls-extra package.
-
-
 if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY)
   # in cache already
   set(gnutls_FIND_QUIETLY TRUE)
@@ -71,7 +118,7 @@
                                   REQUIRED_VARS GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR
                                   VERSION_VAR GNUTLS_VERSION_STRING)
 
-if(GNUTLS_FOUND)
+if(GnuTLS_FOUND)
   set(GNUTLS_LIBRARIES    ${GNUTLS_LIBRARY})
   set(GNUTLS_INCLUDE_DIRS ${GNUTLS_INCLUDE_DIR})
 
diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index 851f193..abbb681 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -5,21 +5,42 @@
 FindGnuplot
 -----------
 
-This module looks for gnuplot.
+Finds the Gnuplot command-line graphing utility for generating two- and
+three-dimensional plots (``gnuplot``).
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-``GNUPLOT_FOUND``
-  System has Gnuplot.
+This module sets the following variables:
 
-``GNUPLOT_EXECUTABLE``
-  The Gnuplot executable.
+``Gnuplot_FOUND``
+  Boolean indicating whether Gnuplot has been found.  For backward
+  compatibility, the ``GNUPLOT_FOUND`` variable is also set to the same value.
 
 ``GNUPLOT_VERSION_STRING``
   The version of Gnuplot found.
 
-  .. note:: Version string detection will not work for old versions like 3.7.1.
+  .. note::
+
+    Version detection is available only for Gnuplot 4 and later.  Earlier
+    versions did not provide version output.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``GNUPLOT_EXECUTABLE``
+  Absolute path to the ``gnuplot`` executable.
+
+Examples
+^^^^^^^^
+
+Finding Gnuplot:
+
+.. code-block:: cmake
+
+  find_package(Gnuplot)
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 2f0c3c1..a49e994 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -5,153 +5,313 @@
 FindHDF5
 --------
 
-Find Hierarchical Data Format (HDF5), a library for reading and writing
-self describing array data.
+Finds Hierarchical Data Format (HDF5), a library for reading and writing
+self-describing array data:
 
+.. code-block:: cmake
 
-This module invokes the ``HDF5`` wrapper compiler that should be installed
-alongside ``HDF5``.  Depending upon the ``HDF5`` Configuration, the wrapper
-compiler is called either ``h5cc`` or ``h5pcc``.  If this succeeds, the module
-will then call the compiler with the show argument to see what flags
-are used when compiling an ``HDF5`` client application.
+  find_package(HDF5 [<version>] ... [COMPONENTS <components>...] ...)
 
-The module will optionally accept the ``COMPONENTS`` argument.  If no
-``COMPONENTS`` are specified, then the find module will default to finding
-only the ``HDF5`` C library.  If one or more ``COMPONENTS`` are specified, the
-module will attempt to find the language bindings for the specified
-components.  The valid components are ``C``, ``CXX``, ``Fortran``, ``HL``.
-``HL`` refers to the "high-level" HDF5 functions for C and Fortran.
-If the ``COMPONENTS`` argument is not given, the module will
-attempt to find only the C bindings.
-For example, to use Fortran HDF5 and HDF5-HL functions, do:
-``find_package(HDF5 COMPONENTS Fortran HL)``.
+If the HDF5 library is built using its CMake-based build system, it will as
+of HDF5 version 1.8.15 provide its own CMake Package Configuration file
+(``hdf5-config.cmake``) for use with the :command:`find_package` command in
+*config mode*.  By default, this module searches for this file and, if found,
+returns the results based on the found configuration.
 
-This module will read the variable
-``HDF5_USE_STATIC_LIBRARIES`` to determine whether or not to prefer a
-static link to a dynamic link for ``HDF5`` and all of it's dependencies.
-To use this feature, make sure that the ``HDF5_USE_STATIC_LIBRARIES``
-variable is set before the call to find_package.
+If the upstream configuration file is not found, this module falls back to
+*module mode* and invokes the HDF5 wrapper compiler typically installed
+with the HDF5 library.  Depending on the configuration, this wrapper
+compiler is named either ``h5cc`` (serial) or ``h5pcc`` (parallel).  If
+found, the wrapper is queried with the ``-show`` argument to determine the
+compiler and linker flags required for building an HDF5 client application.
+Both serial and parallel versions of the HDF5 wrapper are considered.  The
+first directory containing either is used.  If both versions are found in the
+same directory, the serial version is preferred by default.  To change this
+behavior, set the variable ``HDF5_PREFER_PARALLEL`` to ``TRUE``.
 
-.. versionadded:: 3.10
-  Support for ``HDF5_USE_STATIC_LIBRARIES`` on Windows.
+In addition to finding the include directories and libraries needed to compile
+an HDF5 application, this module also attempts to find additional tools
+provided by the HDF5 distribution, which can be useful for regression testing
+or development workflows.
 
-Both the serial and parallel ``HDF5`` wrappers are considered and the first
-directory to contain either one will be used.  In the event that both appear
-in the same directory the serial version is preferentially selected. This
-behavior can be reversed by setting the variable ``HDF5_PREFER_PARALLEL`` to
-``TRUE``.
+Components
+^^^^^^^^^^
 
-In addition to finding the includes and libraries required to compile
-an ``HDF5`` client application, this module also makes an effort to find
-tools that come with the ``HDF5`` distribution that may be useful for
-regression testing.
+This module supports optional components, which can be specified with the
+:command:`find_package` command:
+
+.. code-block:: cmake
+
+  find_package(HDF5 [COMPONENTS <components>...])
+
+Supported components include:
+
+``C``
+  Finds the ``HDF5`` C library (C bindings).
+
+``CXX``
+  Finds the ``HDF5`` C++ library (C++ bindings).
+
+``Fortran``
+  Finds the ``HDF5`` Fortran library (Fortran bindings).
+
+``HL``
+  This component can be used in combination with other components to find the
+  high-level (HL) HDF5 library variants for C, CXX, and/or Fortran, which
+  provide high-level functions.
+
+If no components are specified, then this module will by default search for the
+``C`` component.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module provides the following :ref:`Imported Targets`:
+
+``HDF5::HDF5``
+  .. versionadded:: 3.19
+
+  Target encapsulating the usage requirements for all found HDF5 libraries
+  (``HDF5_LIBRARIES``), available if HDF5 and all required components are found.
+
+``hdf5::hdf5``
+  .. versionadded:: 3.19
+
+  Target encapsulating the usage requirements for the HDF5 C library, available
+  if HDF5 library and its ``C`` component are found.
+
+``hdf5::hdf5_cpp``
+  .. versionadded:: 3.19
+
+  Target encapsulating the usage requirements for the HDF5 C and C++ libraries,
+  available if HDF5 library, and its ``C`` and ``CXX`` components are found.
+
+``hdf5::hdf5_fortran``
+  .. versionadded:: 3.19
+
+  Target encapsulating the usage requirements for the HDF5 Fortran library,
+  available if HDF5 library and its ``Fortran`` component are found.
+
+``hdf5::hdf5_hl``
+  .. versionadded:: 3.19
+
+  Target encapsulating the usage requirements for the HDF5 high-level C library,
+  available if HDF5 library and its ``C``, and ``HL`` components are found.
+
+``hdf5::hdf5_hl_cpp``
+  .. versionadded:: 3.19
+
+  High-level C++ library.
+
+  Target encapsulating the usage requirements for the HDF5 high-level C and
+  high-level C++ libraries, available if HDF5 library and its ``C``, ``CXX``,
+  and ``HL`` components are found.
+
+``hdf5::hdf5_hl_fortran``
+  .. versionadded:: 3.19
+
+  Target encapsulating the usage requirements for the HDF5 high-level Fortran
+  library, available if HDF5 library and its ``Fortran``, and ``HL`` components
+  are found.
+
+``hdf5::h5diff``
+  .. versionadded:: 3.19
+
+  Imported executable target encapsulating the usage requirements for the
+  ``h5diff`` executable, available if ``h5diff`` is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``HDF5_FOUND``
-  HDF5 was found on the system
+  Boolean indicating whether (the requested version of) HDF5 is found.
+
 ``HDF5_VERSION``
   .. versionadded:: 3.3
-    HDF5 library version
+
+  The version of HDF5 library found.
+
 ``HDF5_INCLUDE_DIRS``
-  Location of the HDF5 header files
+  Include directories containing header files needed to use HDF5.
+
 ``HDF5_DEFINITIONS``
-  Required compiler definitions for HDF5
+  Required compiler definitions for using HDF5.
+
 ``HDF5_LIBRARIES``
-  Required libraries for all requested bindings
+  Libraries of all requested bindings needed to link against to use HDF5.
+
 ``HDF5_HL_LIBRARIES``
-  Required libraries for the HDF5 high level API for all bindings,
-  if the ``HL`` component is enabled
-
-Available components are: ``C`` ``CXX`` ``Fortran`` and ``HL``.
-For each enabled language binding, a corresponding ``HDF5_${LANG}_LIBRARIES``
-variable, and potentially ``HDF5_${LANG}_DEFINITIONS``, will be defined.
-If the ``HL`` component is enabled, then an ``HDF5_${LANG}_HL_LIBRARIES`` will
-also be defined.  With all components enabled, the following variables will be defined:
-
-``HDF5_C_DEFINITIONS``
-  Required compiler definitions for HDF5 C bindings
-``HDF5_CXX_DEFINITIONS``
-  Required compiler definitions for HDF5 C++ bindings
-``HDF5_Fortran_DEFINITIONS``
-  Required compiler definitions for HDF5 Fortran bindings
-``HDF5_C_INCLUDE_DIRS``
-  Required include directories for HDF5 C bindings
-``HDF5_CXX_INCLUDE_DIRS``
-  Required include directories for HDF5 C++ bindings
-``HDF5_Fortran_INCLUDE_DIRS``
-  Required include directories for HDF5 Fortran bindings
-``HDF5_C_LIBRARIES``
-  Required libraries for the HDF5 C bindings
-``HDF5_CXX_LIBRARIES``
-  Required libraries for the HDF5 C++ bindings
-``HDF5_Fortran_LIBRARIES``
-  Required libraries for the HDF5 Fortran bindings
-``HDF5_C_HL_LIBRARIES``
-  Required libraries for the high level C bindings
-``HDF5_CXX_HL_LIBRARIES``
-  Required libraries for the high level C++ bindings
-``HDF5_Fortran_HL_LIBRARIES``
-  Required libraries for the high level Fortran bindings.
+  Required libraries for the HDF5 high-level API for all bindings,
+  if the ``HL`` component is enabled.
 
 ``HDF5_IS_PARALLEL``
-  HDF5 library has parallel IO support
+  Boolean indicating whether the HDF5 library has parallel IO support.
+
+For each enabled language binding component, a corresponding
+``HDF5_<LANG>_LIBRARIES`` variable, and potentially
+``HDF5_<LANG>_DEFINITIONS``, will be defined.  If the ``HL`` component is
+enabled, then ``HDF5_<LANG>_HL_LIBRARIES`` variables will also be defined:
+
+``HDF5_C_DEFINITIONS``
+  Required compiler definitions for HDF5 C bindings.
+
+``HDF5_CXX_DEFINITIONS``
+  Required compiler definitions for HDF5 C++ bindings.
+
+``HDF5_Fortran_DEFINITIONS``
+  Required compiler definitions for HDF5 Fortran bindings.
+
+``HDF5_C_INCLUDE_DIRS``
+  Required include directories for HDF5 C bindings.
+
+``HDF5_CXX_INCLUDE_DIRS``
+  Required include directories for HDF5 C++ bindings.
+
+``HDF5_Fortran_INCLUDE_DIRS``
+  Required include directories for HDF5 Fortran bindings.
+
+``HDF5_C_LIBRARIES``
+  Required libraries for the HDF5 C bindings.
+
+``HDF5_CXX_LIBRARIES``
+  Required libraries for the HDF5 C++ bindings.
+
+``HDF5_Fortran_LIBRARIES``
+  Required libraries for the HDF5 Fortran bindings.
+
+``HDF5_C_HL_LIBRARIES``
+  Required libraries for the high-level C bindings, if the ``HL`` component
+  is enabled.
+
+``HDF5_CXX_HL_LIBRARIES``
+  Required libraries for the high-level C++ bindings, if the ``HL``
+  component is enabled.
+
+``HDF5_Fortran_HL_LIBRARIES``
+  Required libraries for the high-level Fortran bindings, if the ``HL``
+  component is enabled.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
 ``HDF5_C_COMPILER_EXECUTABLE``
-  path to the HDF5 C wrapper compiler
+  The path to the HDF5 C wrapper compiler.
+
 ``HDF5_CXX_COMPILER_EXECUTABLE``
-  path to the HDF5 C++ wrapper compiler
+  The path to the HDF5 C++ wrapper compiler.
+
 ``HDF5_Fortran_COMPILER_EXECUTABLE``
-  path to the HDF5 Fortran wrapper compiler
+  The path to the HDF5 Fortran wrapper compiler.
+
 ``HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE``
-  path to the primary C compiler which is also the HDF5 wrapper
+  .. versionadded:: 3.6
+
+  The path to the primary C compiler which is also the HDF5 wrapper.
+  This variable is used only in *module mode*.
+
 ``HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE``
-  path to the primary C++ compiler which is also the HDF5 wrapper
+  .. versionadded:: 3.6
+
+  The path to the primary C++ compiler which is also the HDF5 wrapper.
+  This variable is used only in *module mode*.
+
 ``HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE``
-  path to the primary Fortran compiler which is also the HDF5 wrapper
+  .. versionadded:: 3.6
+
+  The path to the primary Fortran compiler which is also the HDF5 wrapper.
+  This variable is used only in *module mode*.
+
 ``HDF5_DIFF_EXECUTABLE``
-  path to the HDF5 dataset comparison tool
-
-With all components enabled, the following targets will be defined:
-
-``HDF5::HDF5``
-  All detected ``HDF5_LIBRARIES``.
-``hdf5::hdf5``
-  C library.
-``hdf5::hdf5_cpp``
-  C++ library.
-``hdf5::hdf5_fortran``
-  Fortran library.
-``hdf5::hdf5_hl``
-  High-level C library.
-``hdf5::hdf5_hl_cpp``
-  High-level C++ library.
-``hdf5::hdf5_hl_fortran``
-  High-level Fortran library.
-``hdf5::h5diff``
-  ``h5diff`` executable.
+  The path to the HDF5 dataset comparison tool (``h5diff``).
 
 Hints
 ^^^^^
 
-The following variables can be set to guide the search for HDF5 libraries and includes:
+The following variables can be set before calling the ``find_package(HDF5)``
+to guide the search for HDF5 library:
 
 ``HDF5_PREFER_PARALLEL``
   .. versionadded:: 3.4
 
-  set ``true`` to prefer parallel HDF5 (by default, serial is preferred)
+  Set this to boolean true to prefer parallel HDF5 (by default, serial is
+  preferred).  This variable is used only in *module mode*.
 
 ``HDF5_FIND_DEBUG``
   .. versionadded:: 3.9
 
-  Set ``true`` to get extra debugging output.
+  Set this to boolean true to get extra debugging output by this module.
 
 ``HDF5_NO_FIND_PACKAGE_CONFIG_FILE``
   .. versionadded:: 3.8
 
-  Set ``true`` to skip trying to find ``hdf5-config.cmake``.
+  Set this to boolean true to skip finding and using CMake package configuration
+  file (``hdf5-config.cmake``).
+
+``HDF5_USE_STATIC_LIBRARIES``
+  Set this to boolean value to determine whether or not to prefer a
+  static link to a dynamic link for ``HDF5`` and all of its dependencies.
+
+  .. versionadded:: 3.10
+    Support for ``HDF5_USE_STATIC_LIBRARIES`` on Windows.
+
+Examples
+^^^^^^^^
+
+Examples: Finding HDF5
+""""""""""""""""""""""
+
+Finding HDF5:
+
+.. code-block:: cmake
+
+  find_package(HDF5)
+
+Specifying a minimum required version of HDF5 to find:
+
+.. code-block:: cmake
+
+  find_package(HDF5 1.8.15)
+
+Finding HDF5 and making it required (if HDF5 is not found, processing stops with
+an error message):
+
+.. code-block:: cmake
+
+  find_package(HDF5 1.8.15 REQUIRED)
+
+Searching for static HDF5 libraries:
+
+.. code-block:: cmake
+
+  set(HDF5_USE_STATIC_LIBRARIES TRUE)
+  find_package(HDF5)
+
+Specifying components to find high-level C and C++ functions:
+
+.. code-block:: cmake
+
+  find_package(HDF5 COMPONENTS C CXX HL)
+
+Examples: Using HDF5
+""""""""""""""""""""
+
+Finding HDF5 and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(HDF5)
+  target_link_libraries(project_target PRIVATE HDF5::HDF5)
+
+Using Fortran HDF5 and HDF5-HL functions:
+
+.. code-block:: cmake
+
+  find_package(HDF5 COMPONENTS Fortran HL)
+  target_link_libraries(project_target PRIVATE HDF5::HDF5)
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
@@ -218,6 +378,13 @@
   set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc)
 endif()
 
+# Prefer h5hl<LANG> compilers if HDF5_FIND_HL is enabled
+if(HDF5_FIND_HL)
+  list(PREPEND HDF5_C_COMPILER_NAMES h5hlcc)
+  list(PREPEND HDF5_CXX_COMPILER_NAMES h5hlc++)
+  list(PREPEND HDF5_Fortran_COMPILER_NAMES h5hlfc)
+endif()
+
 # Test first if the current compilers automatically wrap HDF5
 function(_HDF5_test_regular_compiler_C success version is_parallel)
   if(NOT ${success} OR
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 8644ab7..f326f33 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -5,24 +5,40 @@
 FindHSPELL
 ----------
 
-Try to find Hebrew spell-checker (Hspell) and morphology engine.
+Finds Hebrew spell-checker (Hspell) and morphology engine.
 
-Once done this will define
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  HSPELL_FOUND - system has Hspell
-  HSPELL_INCLUDE_DIR - the Hspell include directory
-  HSPELL_LIBRARIES - The libraries needed to use Hspell
-  HSPELL_DEFINITIONS - Compiler switches required for using Hspell
+``HSPELL_FOUND``
+  Boolean indicating whether the Hspell is found.
+``HSPELL_VERSION_STRING``
+  The version of Hspell found (x.y).
+``HSPELL_MAJOR_VERSION``
+  The major version of Hspell.
+``HSPELL_MINOR_VERSION``
+  The minor version of Hspell.
 
+Cache Variables
+^^^^^^^^^^^^^^^
 
+The following cache variables may also be set:
 
-::
+``HSPELL_INCLUDE_DIR``
+  The Hspell include directory.
+``HSPELL_LIBRARIES``
+  The libraries needed to use Hspell.
 
-  HSPELL_VERSION_STRING - The version of Hspell found (x.y)
-  HSPELL_MAJOR_VERSION  - the major version of Hspell
-  HSPELL_MINOR_VERSION  - The minor version of Hspell
+Examples
+^^^^^^^^
+
+Finding Hspell:
+
+.. code-block:: cmake
+
+  find_package(HSPELL)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index c6ee4bc..76b3dcf 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -5,15 +5,39 @@
 FindHTMLHelp
 ------------
 
-This module looks for Microsoft HTML Help Compiler
+This module finds the Microsoft HTML Help Compiler and its API.  It is part of
+the HTML Help Workshop.
 
-It defines:
+.. note::
 
-::
+  HTML Help Workshop is in maintenance mode only and is considered deprecated.
+  For modern documentation, consider alternatives such as Microsoft Help Viewer
+  for producing ``.mshc`` files or web-based documentation tools.
 
-   HTML_HELP_COMPILER     : full path to the Compiler (hhc.exe)
-   HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
-   HTML_HELP_LIBRARY      : full path to the library (htmlhelp.lib)
+Cache Variables
+^^^^^^^^^^^^^^^
+
+This module may set the following cache variables:
+
+``HTML_HELP_COMPILER``
+  Full path to the HTML Help Compiler (``hhc.exe``), used to compile ``.chm``
+  files.
+``HTML_HELP_INCLUDE_PATH``
+  Directory containing ``htmlhelp.h``, required for applications integrating the
+  HTML Help API.
+``HTML_HELP_LIBRARY``
+  Full path to ``htmlhelp.lib`` library, required for linking applications that
+  use the HTML Help API.
+
+Examples
+^^^^^^^^
+
+Finding HTML Help Compiler:
+
+.. code-block:: cmake
+
+  find_package(HTMLHelp)
+  message(STATUS "HTML Help Compiler found at: ${HTML_HELP_COMPILER}")
 #]=======================================================================]
 
 if(WIN32)
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index a26e01f..f4f3074 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -5,42 +5,73 @@
 FindHg
 ------
 
-Extract information from a mercurial working copy.
-
-The module defines the following variables:
-
-::
-
-   HG_EXECUTABLE - path to mercurial command line client (hg)
-   HG_FOUND - true if the command line client was found
-   HG_VERSION_STRING - the version of mercurial found
-
-.. versionadded:: 3.1
-  If the command line client executable is found the following macro is defined:
+Finds the Mercurial command-line client executable (``hg``) and provides a
+command for extracting information from a Mercurial working copy:
 
 .. code-block:: cmake
 
-  HG_WC_INFO(<dir> <var-prefix>)
+  find_package(Hg [<version>] [...])
 
-Hg_WC_INFO extracts information of a mercurial working copy
-at a given location.  This macro defines the following variables:
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  <var-prefix>_WC_CHANGESET - current changeset
-  <var-prefix>_WC_REVISION - current revision
+``Hg_FOUND``
+  Boolean indicating whether (the requested version of) Mercurial client is
+  found.  For backward compatibility, the ``HG_FOUND`` variable is also set
+  to the same value.
 
-Example usage:
+``HG_VERSION_STRING``
+  The version of Mercurial found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``HG_EXECUTABLE``
+  Absolute path to the Mercurial command-line client (``hg``).
+
+Commands
+^^^^^^^^
+
+This module provides the following command when Mercurial client (``hg``) is
+found:
+
+.. command:: Hg_WC_INFO
+
+  .. versionadded:: 3.1
+
+  Extracts information of a Mercurial working copy:
+
+  .. code-block:: cmake
+
+    Hg_WC_INFO(<dir> <var-prefix>)
+
+  This command defines the following variables if running Mercurial client on
+  working copy located at a given location ``<dir>`` succeeds; otherwise a
+  ``SEND_ERROR`` message is generated:
+
+  ``<var-prefix>_WC_CHANGESET``
+    Current changeset.
+  ``<var-prefix>_WC_REVISION``
+    Current revision.
+
+Examples
+^^^^^^^^
+
+Finding the Mercurial client and retrieving information about the current
+project's working copy:
 
 .. code-block:: cmake
 
-   find_package(Hg)
-   if(HG_FOUND)
-     message("hg found: ${HG_EXECUTABLE}")
-     HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
-     message("Current revision is ${Project_WC_REVISION}")
-     message("Current changeset is ${Project_WC_CHANGESET}")
-   endif()
+  find_package(Hg)
+  if(Hg_FOUND)
+    Hg_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+    message("Current revision is ${Project_WC_REVISION}")
+    message("Current changeset is ${Project_WC_CHANGESET}")
+  endif()
 #]=======================================================================]
 
 find_program(HG_EXECUTABLE
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index a7b0569..942a0ae 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -7,82 +7,169 @@
 
 .. versionadded:: 3.7
 
-Find the International Components for Unicode (ICU) libraries and
-programs.
-
-This module supports multiple components.
-Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
-``lx``, ``test``, ``tu`` and ``uc``.
-
-Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
-``in``; any of the names may be used, and the appropriate
-platform-specific library name will be automatically selected.
+Finds the International Components for Unicode (ICU) libraries and programs.
 
 .. versionadded:: 3.11
-  Added support for static libraries on Windows.
+  Support for static libraries on Windows.
 
-This module reports information about the ICU installation in
-several variables.  General variables::
+Components
+^^^^^^^^^^
 
-  ICU_FOUND - true if the main programs and libraries were found
-  ICU_INCLUDE_DIRS - the directories containing the ICU headers
-  ICU_LIBRARIES - component libraries to be linked
-  ICU_VERSION - ICU release version
+This module supports the following components:
 
-Imported targets::
+``data``
+  Finds the ICU Data library.  On Windows, this library component is named
+  ``dt``, otherwise any of these component names may be used, and the
+  appropriate platform-specific library name will be automatically selected.
 
-  ICU::<C>
+``i18n``
+  Finds the ICU Internationalization library.  On Windows, this library
+  component is named ``in``, otherwise any of these component names may be used,
+  and the appropriate platform-specific library name will be automatically
+  selected.
 
-Where ``<C>`` is the name of an ICU component, for example
-``ICU::i18n``; ``<C>`` is lower-case.
+``io``
+  Finds the ICU Stream and I/O (Unicode stdio) library.
 
-ICU programs are reported in::
+``le``
+  Finds the deprecated ICU Layout Engine library, which has been removed as of
+  ICU version 58.
 
-  ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
-  ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
-  ICU_GENBRK_EXECUTABLE - path to genbrk executable
-  ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
-  ICU_GENRB_EXECUTABLE - path to genrb executable
-  ICU_GENDICT_EXECUTABLE - path to gendict executable
-  ICU_DERB_EXECUTABLE - path to derb executable
-  ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
-  ICU_UCONV_EXECUTABLE - path to uconv executable
-  ICU_GENCFU_EXECUTABLE - path to gencfu executable
-  ICU_MAKECONV_EXECUTABLE - path to makeconv executable
-  ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
-  ICU_GENCCODE_EXECUTABLE - path to genccode executable
-  ICU_GENSPREP_EXECUTABLE - path to gensprep executable
-  ICU_ICUPKG_EXECUTABLE - path to icupkg executable
-  ICU_GENCMN_EXECUTABLE - path to gencmn executable
+``lx``
+  Finds the ICU Layout Extensions Engine library, used for paragraph layout.
 
-ICU component libraries are reported in::
+``test``
+  Finds the ICU test suits.
 
-  ICU_<C>_FOUND - ON if component was found; ``<C>`` is upper-case.
-  ICU_<C>_LIBRARIES - libraries for component; ``<C>`` is upper-case.
+``tu``
+  Finds the ICU Tool Utility library.
 
-ICU datafiles are reported in::
+``uc``
+  Finds the base ICU Common and Data libraries.  This library is required by
+  all other ICU libraries and is recommended to include when working with ICU
+  components.
 
-  ICU_MAKEFILE_INC - Makefile.inc
-  ICU_PKGDATA_INC - pkgdata.inc
+At least one component should be specified for this module to successfully find
+ICU:
 
-This module reads hints about search results from::
+.. code-block:: cmake
 
-  ICU_ROOT - the root of the ICU installation
+  find_package(ICU COMPONENTS <components>...)
 
-The environment variable ``ICU_ROOT`` may also be used; the
-ICU_ROOT variable takes precedence.
+Imported Targets
+^^^^^^^^^^^^^^^^
 
-The following cache variables may also be set::
+This module provides the following :ref:`Imported Targets`:
 
-  ICU_<P>_EXECUTABLE - the path to executable <P>; ``<P>`` is upper-case.
-  ICU_INCLUDE_DIR - the directory containing the ICU headers
-  ICU_<C>_LIBRARY - the library for component <C>; ``<C>`` is upper-case.
+``ICU::<component>``
+
+  Target encapsulating the usage requirements for the specified ICU component,
+  available only if that component is found.  The ``<component>`` should be
+  written in lowercase, as listed above.  For example, use ``ICU::i18n`` for the
+  Internationalization library.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``ICU_FOUND``
+  Boolean indicating whether the main programs and libraries were found.
+``ICU_INCLUDE_DIRS``
+  The include directories containing the ICU headers.
+``ICU_LIBRARIES``
+  Component libraries to be linked.
+``ICU_VERSION``
+  The version of the ICU release found.
+
+ICU programs are defined in the following variables:
+
+``ICU_GENCNVAL_EXECUTABLE``
+  The path to the ``gencnval`` executable.
+``ICU_ICUINFO_EXECUTABLE``
+  The path to the ``icuinfo`` executable.
+``ICU_GENBRK_EXECUTABLE``
+  The path to the ``genbrk`` executable.
+``ICU_ICU-CONFIG_EXECUTABLE``
+  The path to the ``icu-config`` executable.
+``ICU_GENRB_EXECUTABLE``
+  The path to the ``genrb`` executable.
+``ICU_GENDICT_EXECUTABLE``
+  The path to the ``gendict`` executable.
+``ICU_DERB_EXECUTABLE``
+  The path to the ``derb`` executable.
+``ICU_PKGDATA_EXECUTABLE``
+  The path to the ``pkgdata`` executable.
+``ICU_UCONV_EXECUTABLE``
+  The path to the ``uconv`` executable.
+``ICU_GENCFU_EXECUTABLE``
+  The path to the ``gencfu`` executable.
+``ICU_MAKECONV_EXECUTABLE``
+  The path to the ``makeconv`` executable.
+``ICU_GENNORM2_EXECUTABLE``
+  The path to the ``gennorm2`` executable.
+``ICU_GENCCODE_EXECUTABLE``
+  The path to the ``genccode`` executable.
+``ICU_GENSPREP_EXECUTABLE``
+  The path to the ``gensprep`` executable.
+``ICU_ICUPKG_EXECUTABLE``
+  The path to the ``icupkg`` executable.
+``ICU_GENCMN_EXECUTABLE``
+  The path to the ``gencmn`` executable.
+
+ICU component libraries are defined in the following variables:
+
+``ICU_<COMPONENT>_FOUND``
+  Boolean indicating whether the ICU component was found; The ``<COMPONENT>``
+  should be written in uppercase.
+``ICU_<COMPONENT>_LIBRARIES``
+  Libraries for component; The ``<COMPONENT>`` should be written in uppercase.
+
+ICU datafiles are defined in the following variables:
+
+``ICU_MAKEFILE_INC``
+  The path to the ``Makefile.inc`` file.
+``ICU_PKGDATA_INC``
+  The path to the ``pkgdata.inc`` file.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``ICU_<PROGRAM>_EXECUTABLE``
+  The path to executable ``<PROGRAM>``; The ``<PROGRAM>`` should be written in
+  uppercase. These variables correspond to the ICU program result variables
+  listed above.
+``ICU_INCLUDE_DIR``
+  The directory containing the ICU headers.
+``ICU_<COMPONENT>_LIBRARY``
+  The library for the ICU component.  The ``<COMPONENT>`` should be written in
+  uppercase.
+
+Hints
+^^^^^
+
+This module reads hints about search results from:
+
+``ICU_ROOT``
+  The root of the ICU installation.  The environment variable ``ICU_ROOT`` may
+  also be used; the ``ICU_ROOT`` variable takes precedence.
 
 .. note::
 
-  In most cases none of the above variables will require setting,
-  unless multiple ICU versions are available and a specific version
-  is required.
+  In most cases, none of the above variables will need to be set, unless
+  multiple versions of ICU are available and a specific version is required.
+
+Examples
+^^^^^^^^
+
+Finding ICU components and linking them to a project target:
+
+.. code-block:: cmake
+
+  find_package(ICU COMPONENTS i18n io uc)
+  target_link_libraries(project_target PRIVATE ICU::i18n ICU::io ICU::uc)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
index a8bf311..8215674 100644
--- a/Modules/FindIce.cmake
+++ b/Modules/FindIce.cmake
@@ -7,156 +7,424 @@
 
 .. versionadded:: 3.1
 
-Find the ZeroC Internet Communication Engine (ICE) programs,
-libraries and datafiles.
-
-This module supports multiple components.
-Components can include any of: ``Freeze``, ``Glacier2``, ``Ice``,
-``IceBox``, ``IceDB``, ``IceDiscovery``, ``IceGrid``,
-``IceLocatorDiscovery``, ``IcePatch``, ``IceSSL``, ``IceStorm``,
-``IceUtil``, ``IceXML``, or ``Slice``.
-
-Ice 3.7 and later also include C++11-specific components:
-``Glacier2++11``, ``Ice++11``, ``IceBox++11``, ``IceDiscovery++11``
-``IceGrid``, ``IceLocatorDiscovery++11``, ``IceSSL++11``,
-``IceStorm++11``
-
-Note that the set of supported components is Ice version-specific.
+Finds the Internet Communication Engine (Ice) programs, libraries and datafiles.
+Ice is an open-source remote procedure call (RPC) framework developed by ZeroC
+and provides SDKs for various languages to develop network applications.
 
 .. versionadded:: 3.4
-  Imported targets for components and most ``EXECUTABLE`` variables.
+  Imported targets for components and many new ``*_EXECUTABLE`` variables.
 
 .. versionadded:: 3.7
-  Debug and Release variants are found separately.
+  Debug and Release library variants are found separately.
 
 .. versionadded:: 3.10
   Ice 3.7 support, including new components, programs and the Nuget package.
 
-This module reports information about the Ice installation in
-several variables.  General variables::
+Components
+^^^^^^^^^^
 
-  Ice_VERSION - Ice release version
-  Ice_FOUND - true if the main programs and libraries were found
-  Ice_LIBRARIES - component libraries to be linked
-  Ice_INCLUDE_DIRS - the directories containing the Ice headers
-  Ice_SLICE_DIRS - the directories containing the Ice slice interface
-                   definitions
+Ice consists of several libraries and programs (executables).  This find module
+supports components, which can be specified using the :command:`find_package`
+command, to select specific Ice libraries for use in a CMake project.
+Executables provided by Ice installation are always searched automatically,
+regardless of the specified components.
 
-Imported targets::
+The list of available components depends on the Ice version in use.  To
+successfully find Ice, at least one component must be specified:
 
-  Ice::<C>
+.. code-block:: cmake
 
-Where ``<C>`` is the name of an Ice component, for example
-``Ice::Glacier2`` or ``Ice++11``.
+  find_package(Ice COMPONENTS <components>...)
 
-Ice slice programs are reported in::
+Supported components include:
 
-  Ice_SLICE2CONFLUENCE_EXECUTABLE - path to slice2confluence executable
-  Ice_SLICE2CPP_EXECUTABLE - path to slice2cpp executable
-  Ice_SLICE2CS_EXECUTABLE - path to slice2cs executable
-  Ice_SLICE2FREEZEJ_EXECUTABLE - path to slice2freezej executable
-  Ice_SLICE2FREEZE_EXECUTABLE - path to slice2freeze executable
-  Ice_SLICE2HTML_EXECUTABLE - path to slice2html executable
-  Ice_SLICE2JAVA_EXECUTABLE - path to slice2java executable
-  Ice_SLICE2JS_EXECUTABLE - path to slice2js executable
-  Ice_SLICE2MATLAB_EXECUTABLE - path to slice2matlab executable
-  Ice_SLICE2OBJC_EXECUTABLE - path to slice2objc executable
-  Ice_SLICE2PHP_EXECUTABLE - path to slice2php executable
-  Ice_SLICE2PY_EXECUTABLE - path to slice2py executable
-  Ice_SLICE2RB_EXECUTABLE - path to slice2rb executable
+.. hlist::
 
-.. versionadded:: 3.14
-  Variables for ``slice2confluence`` and ``slice2matlab``.
+  - ``Freeze``
+  - ``Glacier2``
+  - ``Ice``
+  - ``IceBox``
+  - ``IceDB``
+  - ``IceDiscovery``
+  - ``IceGrid``
+  - ``IceLocatorDiscovery``
+  - ``IcePatch``
+  - ``IceSSL``
+  - ``IceStorm``
+  - ``IceUtil``
+  - ``IceXML``
+  - ``Slice``
 
-Ice programs are reported in::
+Ice 3.7 and later also include C++11-specific components:
 
-  Ice_GLACIER2ROUTER_EXECUTABLE - path to glacier2router executable
-  Ice_ICEBOX_EXECUTABLE - path to icebox executable
-  Ice_ICEBOXXX11_EXECUTABLE - path to icebox++11 executable
-  Ice_ICEBOXADMIN_EXECUTABLE - path to iceboxadmin executable
-  Ice_ICEBOXD_EXECUTABLE - path to iceboxd executable
-  Ice_ICEBOXNET_EXECUTABLE - path to iceboxnet executable
-  Ice_ICEBRIDGE_EXECUTABLE - path to icebridge executable
-  Ice_ICEGRIDADMIN_EXECUTABLE - path to icegridadmin executable
-  Ice_ICEGRIDDB_EXECUTABLE - path to icegriddb executable
-  Ice_ICEGRIDNODE_EXECUTABLE - path to icegridnode executable
-  Ice_ICEGRIDNODED_EXECUTABLE - path to icegridnoded executable
-  Ice_ICEGRIDREGISTRY_EXECUTABLE - path to icegridregistry executable
-  Ice_ICEGRIDREGISTRYD_EXECUTABLE - path to icegridregistryd executable
-  Ice_ICEPATCH2CALC_EXECUTABLE - path to icepatch2calc executable
-  Ice_ICEPATCH2CLIENT_EXECUTABLE - path to icepatch2client executable
-  Ice_ICEPATCH2SERVER_EXECUTABLE - path to icepatch2server executable
-  Ice_ICESERVICEINSTALL_EXECUTABLE - path to iceserviceinstall executable
-  Ice_ICESTORMADMIN_EXECUTABLE - path to icestormadmin executable
-  Ice_ICESTORMDB_EXECUTABLE - path to icestormdb executable
-  Ice_ICESTORMMIGRATE_EXECUTABLE - path to icestormmigrate executable
+.. hlist::
 
-Ice db programs (Windows only; standard system versions on all other
-platforms) are reported in::
+  - ``Glacier2++11``
+  - ``Ice++11``
+  - ``IceBox++11``
+  - ``IceDiscovery++11``
+  - ``IceGrid++11``
+  - ``IceLocatorDiscovery++11``
+  - ``IceSSL++11``
+  - ``IceStorm++11``
 
-  Ice_DB_ARCHIVE_EXECUTABLE - path to db_archive executable
-  Ice_DB_CHECKPOINT_EXECUTABLE - path to db_checkpoint executable
-  Ice_DB_DEADLOCK_EXECUTABLE - path to db_deadlock executable
-  Ice_DB_DUMP_EXECUTABLE - path to db_dump executable
-  Ice_DB_HOTBACKUP_EXECUTABLE - path to db_hotbackup executable
-  Ice_DB_LOAD_EXECUTABLE - path to db_load executable
-  Ice_DB_LOG_VERIFY_EXECUTABLE - path to db_log_verify executable
-  Ice_DB_PRINTLOG_EXECUTABLE - path to db_printlog executable
-  Ice_DB_RECOVER_EXECUTABLE - path to db_recover executable
-  Ice_DB_STAT_EXECUTABLE - path to db_stat executable
-  Ice_DB_TUNER_EXECUTABLE - path to db_tuner executable
-  Ice_DB_UPGRADE_EXECUTABLE - path to db_upgrade executable
-  Ice_DB_VERIFY_EXECUTABLE - path to db_verify executable
-  Ice_DUMPDB_EXECUTABLE - path to dumpdb executable
-  Ice_TRANSFORMDB_EXECUTABLE - path to transformdb executable
+Imported Targets
+^^^^^^^^^^^^^^^^
 
-Ice component libraries are reported in::
+This module provides the following :ref:`Imported Targets`:
 
-  Ice_<C>_FOUND - ON if component was found
-  Ice_<C>_LIBRARIES - libraries for component
+``Ice::<component>``
+  .. versionadded:: 3.4
 
-Note that ``<C>`` is the uppercased name of the component.
+  Target encapsulating the usage requirements for the specified Ice component
+  (library), available if that component is found.  The ``<component>`` should
+  be written in the same case, as listed above.  For example, use
+  ``Ice::Glacier2`` for the Ice Glacier2 library, or ``Ice::Ice++11`` for the
+  Ice++11 library, etc.
 
-This module reads hints about search results from::
+Result Variables
+^^^^^^^^^^^^^^^^
 
-  Ice_HOME - the root of the Ice installation
+This module defines the following variables:
 
-The environment variable ``ICE_HOME`` may also be used; the
-Ice_HOME variable takes precedence.
+``Ice_FOUND``
+  Boolean indicating whether the main programs, libraries and all requested
+  components for using Ice were found.
 
-.. note::
-  On Windows, Ice 3.7.0 and later provide libraries via the NuGet
-  package manager.  Appropriate NuGet packages will be searched for
-  using ``CMAKE_PREFIX_PATH``, or alternatively ``Ice_HOME`` may be
-  set to the location of a specific NuGet package to restrict the
-  search.
+``Ice_VERSION``
+  The version of Ice release found.
 
-The following cache variables may also be set::
+``Ice_INCLUDE_DIRS``
+  The include directories containing headers needed to use Ice.
 
-  Ice_<P>_EXECUTABLE - the path to executable <P>
-  Ice_INCLUDE_DIR - the directory containing the Ice headers
-  Ice_SLICE_DIR - the directory containing the Ice slice interface
-                  definitions
-  Ice_<C>_LIBRARY - the library for component <C>
+``Ice_LIBRARIES``
+  Component libraries needed to link against to use Ice.
+
+``Ice_SLICE_DIRS``
+  The data directories containing interface definitions (``*.ice`` files) for
+  Slice (Specification Language for Ice).
+
+Ice component libraries are stored in:
+
+``Ice_<COMPONENT>_FOUND``
+  Boolean indicating whether the specified Ice component is found.  The
+  ``<COMPONENT>`` should be written in uppercase.
+
+``Ice_<COMPONENT>_LIBRARIES``
+  Libraries provided by the specified Ice component.  The ``<COMPONENT>`` should
+  be written in uppercase.
+
+Slice programs are stored in:
+
+``Ice_SLICE2CONFLUENCE_EXECUTABLE``
+  .. versionadded:: 3.14
+
+  The path to the ``slice2confluence`` executable.
+
+``Ice_SLICE2CPP_EXECUTABLE``
+  The path to the ``slice2cpp`` executable.
+
+``Ice_SLICE2CS_EXECUTABLE``
+  The path to the ``slice2cs`` executable.
+
+``Ice_SLICE2FREEZEJ_EXECUTABLE``
+  The path to the ``slice2freezej`` executable.
+
+``Ice_SLICE2FREEZE_EXECUTABLE``
+  The path to the ``slice2freeze`` executable.
+
+``Ice_SLICE2HTML_EXECUTABLE``
+  The path to the ``slice2html`` executable.
+
+``Ice_SLICE2JAVA_EXECUTABLE``
+  The path to the ``slice2java`` executable.
+
+``Ice_SLICE2JS_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``slice2js`` executable.
+
+``Ice_SLICE2MATLAB_EXECUTABLE``
+  .. versionadded:: 3.14
+
+  The path to the ``slice2matlab`` executable.
+
+``Ice_SLICE2OBJC_EXECUTABLE``
+  .. versionadded:: 3.10
+
+  The path to the ``slice2objc`` executable.
+
+``Ice_SLICE2PHP_EXECUTABLE``
+  The path to the ``slice2php`` executable.
+
+``Ice_SLICE2PY_EXECUTABLE``
+  The path to the ``slice2py`` executable.
+
+``Ice_SLICE2RB_EXECUTABLE``
+  The path to the ``slice2rb`` executable.
+
+Ice programs are stored in:
+
+``Ice_GLACIER2ROUTER_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``glacier2router`` executable.
+
+``Ice_ICEBOX_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icebox`` executable.
+
+``Ice_ICEBOX++11_EXECUTABLE``
+  .. versionadded:: 3.10
+
+  The path to the ``icebox++11`` executable.
+
+``Ice_ICEBOXADMIN_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``iceboxadmin`` executable.
+
+``Ice_ICEBOXD_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``iceboxd`` executable.
+
+``Ice_ICEBOXNET_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``iceboxnet`` executable.
+
+``Ice_ICEBRIDGE_EXECUTABLE``
+  .. versionadded:: 3.10
+
+  The path to the ``icebridge`` executable.
+
+``Ice_ICEGRIDADMIN_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icegridadmin`` executable.
+
+``Ice_ICEGRIDDB_EXECUTABLE``
+  .. versionadded:: 3.10
+
+  The path to the ``icegriddb`` executable.
+
+``Ice_ICEGRIDNODE_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icegridnode`` executable.
+
+``Ice_ICEGRIDNODED_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icegridnoded`` executable.
+
+``Ice_ICEGRIDREGISTRY_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icegridregistry`` executable.
+
+``Ice_ICEGRIDREGISTRYD_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icegridregistryd`` executable.
+
+``Ice_ICEPATCH2CALC_EXECUTABLE``
+  The path to the ``icepatch2calc`` executable.
+
+``Ice_ICEPATCH2CLIENT_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icepatch2client`` executable.
+
+``Ice_ICEPATCH2SERVER_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icepatch2server`` executable.
+
+``Ice_ICESERVICEINSTALL_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``iceserviceinstall`` executable.
+
+``Ice_ICESTORMADMIN_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icestormadmin`` executable.
+
+``Ice_ICESTORMDB_EXECUTABLE``
+  .. versionadded:: 3.10
+
+  The path to the ``icestormdb`` executable.
+
+``Ice_ICESTORMMIGRATE_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``icestormmigrate`` executable.
+
+Ice database programs are stored in the following variables (on Windows, they
+are included with the Ice installation; on other platforms, they are usually
+available through standard Berkeley DB packages):
+
+``Ice_DB_ARCHIVE_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_archive`` executable.
+
+``Ice_DB_CHECKPOINT_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_checkpoint`` executable.
+
+``Ice_DB_DEADLOCK_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_deadlock`` executable.
+
+``Ice_DB_DUMP_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_dump`` executable.
+
+``Ice_DB_HOTBACKUP_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_hotbackup`` executable.
+
+``Ice_DB_LOAD_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_load`` executable.
+
+``Ice_DB_LOG_VERIFY_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_log_verify`` executable.
+
+``Ice_DB_PRINTLOG_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_printlog`` executable.
+
+``Ice_DB_RECOVER_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_recover`` executable.
+
+``Ice_DB_STAT_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_stat`` executable.
+
+``Ice_DB_TUNER_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_tuner`` executable.
+
+``Ice_DB_UPGRADE_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_upgrade`` executable.
+
+``Ice_DB_VERIFY_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``db_verify`` executable.
+
+``Ice_DUMPDB_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``dumpdb`` executable.
+
+``Ice_TRANSFORMDB_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The path to the ``transformdb`` executable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Ice_<PROGRAM>_EXECUTABLE``
+  The path to the specified ``<PROGRAM>`` executable;  The ``<PROGRAM>`` is the
+  uppercase name of the Ice program as listed in above result variables of
+  executables.
+
+``Ice_INCLUDE_DIR``
+  The directory containing Ice headers.
+
+``Ice_SLICE_DIR``
+  The data directory containing interface definitions for Slice.
+
+``Ice_<COMPONENT>_LIBRARY``
+  The path to the library for the specified component.  The ``<COMPONENT>``
+  should be written in uppercase.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``Ice_HOME``
+  Set this CMake variable to the root of the Ice installation in order to
+  search for Ice in a custom location.
+
+  .. note::
+
+    On Windows, Ice 3.7.0 and later provide libraries via the NuGet
+    package manager.  Appropriate NuGet packages will be searched for
+    using :variable:`CMAKE_PREFIX_PATH`, or alternatively ``Ice_HOME`` may be
+    set to the location of a specific NuGet package to restrict the search.
+
+``ICE_HOME``
+  Environment variable (uppercased) may also be set to the root of the Ice
+  installation;  The ``Ice_HOME`` CMake variable takes precedence.
+
+``Ice_DEBUG``
+  Set this variable to boolean true to enable debug output from this module.
 
 .. note::
 
-  In most cases none of the above variables will require setting,
-  unless multiple Ice versions are available and a specific version
-  is required.  On Windows, the most recent version of Ice will be
-  found through the registry.  On Unix, the programs, headers and
-  libraries will usually be in standard locations, but Ice_SLICE_DIRS
-  might not be automatically detected (commonly known locations are
-  searched).  All the other variables are defaulted using Ice_HOME,
-  if set.  It's possible to set Ice_HOME and selectively specify
-  alternative locations for the other components; this might be
-  required for e.g. newer versions of Visual Studio if the
-  heuristics are not sufficient to identify the correct programs and
-  libraries for the specific Visual Studio version.
+  In most cases, none of the above variables need to be set unless multiple Ice
+  versions are installed and a specific one is required.  On Windows, the most
+  recent version is typically found using the registry.  On Unix-like systems,
+  programs, headers, and libraries are usually found in standard locations,
+  although ``Ice_SLICE_DIRS`` might not be detected automatically (commonly
+  known locations are searched).  All other variables default based on the value
+  of ``Ice_HOME``, if set.
 
-Other variables one may set to control this module are::
+  It's also possible to set ``Ice_HOME`` while selectively overriding specific
+  locations for individual components;  This might be required, for example, in
+  newer versions of Visual Studio if the heuristics are not sufficient to
+  identify the correct programs and libraries for the specific Visual Studio
+  version.
 
-  Ice_DEBUG - Set to ON to enable debug output from FindIce.
+Examples
+^^^^^^^^
+
+Finding the Ice core library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Ice COMPONENTS Ice)
+  target_link_libraries(project_target PRIVATE Ice::Ice)
+
+Finding Ice core library and IceSSL library, and linking them to a project
+target:
+
+.. code-block:: cmake
+
+  find_package(Ice COMPONENTS Ice IceSSL)
+  target_link_libraries(project_target PRIVATE Ice::Ice Ice::IceSSL)
+
+Finding Ice core library as required component and Ice Freeze library as
+optional:
+
+.. code-block:: cmake
+
+  find_package(Ice COMPONENTS Ice OPTIONAL_COMPONENTS Freeze)
 #]=======================================================================]
 
 # Written by Roger Leigh <rleigh@codelibre.net>
diff --git a/Modules/FindIconv.cmake b/Modules/FindIconv.cmake
index 2c6e3b4..a11d746 100644
--- a/Modules/FindIconv.cmake
+++ b/Modules/FindIconv.cmake
@@ -7,72 +7,82 @@
 
 .. versionadded:: 3.11
 
-This module finds the ``iconv()`` POSIX.1 functions on the system.
-These functions might be provided in the regular C library or externally
-in the form of an additional library.
+This module finds the ``iconv()`` POSIX.1 functions on the system.  These
+functions might be provided in the standard C library or externally in the form
+of an additional library.
 
-The following variables are provided to indicate iconv support:
+Imported Targets
+^^^^^^^^^^^^^^^^
 
-.. variable:: Iconv_FOUND
+This module provides the following :ref:`Imported Targets`:
 
-  Variable indicating if the iconv support was found.
+``Iconv::Iconv``
+  Target encapsulating the iconv usage requirements, available only if iconv is
+  found.
 
-.. variable:: Iconv_INCLUDE_DIRS
+Result Variables
+^^^^^^^^^^^^^^^^
 
-  The directories containing the iconv headers.
+This module defines the following variables:
 
-.. variable:: Iconv_LIBRARIES
+``Iconv_FOUND``
+  Boolean indicating if the iconv support was found.
 
+``Iconv_INCLUDE_DIRS``
+  The include directories containing the iconv headers.
+
+``Iconv_LIBRARIES``
   The iconv libraries to be linked.
 
-.. variable:: Iconv_VERSION
-
+``Iconv_VERSION``
   .. versionadded:: 3.21
 
-  The version of iconv found (x.y)
+  The version of iconv found (x.y).
 
-.. variable:: Iconv_VERSION_MAJOR
+  .. note::
+    Some libiconv implementations don't embed the version in their header files.
+    In this case the variables ``Iconv_VERSION*`` will be empty.
 
+``Iconv_VERSION_MAJOR``
   .. versionadded:: 3.21
 
-  The major version of iconv
+  The major version of iconv.
 
-.. variable:: Iconv_VERSION_MINOR
-
+``Iconv_VERSION_MINOR``
   .. versionadded:: 3.21
 
-  The minor version of iconv
+  The minor version of iconv.
 
-.. variable:: Iconv_IS_BUILT_IN
+``Iconv_IS_BUILT_IN``
+  A boolean variable indicating whether iconv support is stemming from the C
+  standard library or not.  Even if the C library provides ``iconv()``, the
+  presence of an external ``libiconv`` implementation might lead to this being
+  false.
 
-  A variable indicating whether iconv support is stemming from the
-  C library or not. Even if the C library provides `iconv()`, the presence of
-  an external `libiconv` implementation might lead to this being false.
-
-Additionally, the following :prop_tgt:`IMPORTED` target is being provided:
-
-.. variable:: Iconv::Iconv
-
-  Imported target for using iconv.
+Cache Variables
+^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
-.. variable:: Iconv_INCLUDE_DIR
-
+``Iconv_INCLUDE_DIR``
   The directory containing the iconv headers.
 
-.. variable:: Iconv_LIBRARY
-
+``Iconv_LIBRARY``
   The iconv library (if not implicitly given in the C library).
 
 .. note::
   On POSIX platforms, iconv might be part of the C library and the cache
   variables ``Iconv_INCLUDE_DIR`` and ``Iconv_LIBRARY`` might be empty.
 
-.. note::
-  Some libiconv implementations don't embed the version number in their header files.
-  In this case the variables ``Iconv_VERSION*`` will be empty.
+Examples
+^^^^^^^^
 
+Finding iconv and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Iconv)
+  target_link_libraries(project_target PRIVATE Iconv::Iconv)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindIcotool.cmake b/Modules/FindIcotool.cmake
index 14c14da..92dfe7f 100644
--- a/Modules/FindIcotool.cmake
+++ b/Modules/FindIcotool.cmake
@@ -5,16 +5,43 @@
 FindIcotool
 -----------
 
-Find icotool
+Finds ``icotool``, command-line program for converting and creating Win32 icon
+and cursor files.
 
-This module looks for icotool. Convert and create Win32 icon and cursor files.
-This module defines the following values:
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  ICOTOOL_EXECUTABLE: the full path to the icotool tool.
-  ICOTOOL_FOUND: True if icotool has been found.
-  ICOTOOL_VERSION_STRING: the version of icotool found.
+``Icotool_FOUND``
+  True if ``icotool`` has been found.  For backward compatibility, the
+  ``ICOTOOL_FOUND`` variable is also set to the same value.
+``ICOTOOL_VERSION_STRING``
+  The version of ``icotool`` found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``ICOTOOL_EXECUTABLE``
+  The full path to the ``icotool`` tool.
+
+Examples
+^^^^^^^^
+
+Finding ``icotool`` and executing it in a process to create ``.ico`` icon from
+the source ``.png`` image located in the current source directory:
+
+.. code-block:: cmake
+
+  find_package(Icotool)
+  if(Icotool_FOUND)
+    execute_process(
+      COMMAND
+        ${ICOTOOL_EXECUTABLE} -c -o ${CMAKE_CURRENT_BINARY_DIR}/img.ico img.png
+    )
+  endif()
 #]=======================================================================]
 
 find_program(ICOTOOL_EXECUTABLE
diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
index ff0a6a6..8289d6d 100644
--- a/Modules/FindImageMagick.cmake
+++ b/Modules/FindImageMagick.cmake
@@ -5,17 +5,19 @@
 FindImageMagick
 ---------------
 
-Find ImageMagick, software suite for displaying, converting and
-manipulating raster images.
-
+Finds ImageMagick, a software suite for displaying, converting, and manipulating
+raster images.
 
 .. versionadded:: 3.9
-  Added support for ImageMagick 7.
+  Support for ImageMagick 7.
 
-This module will search for a set of ImageMagick tools specified as
-components in the :command:`find_package` call.  Typical components include,
-but are not limited to (future versions of ImageMagick might have
-additional components not listed here):
+Components
+^^^^^^^^^^
+
+This module supports components and searches for a set of ImageMagick tools.
+Typical components include the names of ImageMagick executables, but are not
+limited to the following (future versions of ImageMagick may provide additional
+components not listed here):
 
 * ``animate``
 * ``compare``
@@ -29,77 +31,107 @@
 * ``montage``
 * ``stream``
 
-If no component is specified in the :command:`find_package` call, then it only
-searches for the ImageMagick executable directory.
-
 There are also components for the following ImageMagick APIs:
 
-* ``Magick++``: ImageMagick C++ API, if found.
-* ``MagickWand``: ImageMagick MagickWand C API, if found.
-* ``MagickCore``: ImageMagick MagickCore low-level C API, if found.
+``Magick++``
+  Finds the ImageMagick C++ API.
+``MagickWand``
+  Finds the ImageMagick MagickWand C API.
+``MagickCore``
+  Finds the ImageMagick MagickCore low-level C API.
 
+Components can be specified using the :command:`find_package` command:
+
+.. code-block:: cmake
+
+  find_package(ImageMagick [COMPONENTS <components>...])
+
+If no components are specified, the module only searches for the ImageMagick
+executable directory.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.26
-
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``ImageMagick::Magick++``
-  ImageMagick C++ API, if found.
+  .. versionadded:: 3.26
+
+  Target encapsulating the ImageMagick C++ API usage requirements, available if
+  ImageMagick C++ is found.
 
 ``ImageMagick::MagickWand``
-  ImageMagick MagickWand C API, if found.
+  .. versionadded:: 3.26
+
+  Target encapsulating the ImageMagick MagickWand C API usage requirements,
+  available if MagickWand is found.
 
 ``ImageMagick::MagickCore``
-  ImageMagick MagickCore low-level C API, if found.
+  .. versionadded:: 3.26
 
+  Target encapsulating the ImageMagick MagickCore low-level C API usage
+  requirements, available if MagickCore is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
+
 ``ImageMagick_FOUND``
-  TRUE if all components are found.
-
-``ImageMagick_EXECUTABLE_DIR``
-  Full path to executables directory.
-
-``ImageMagick_INCLUDE_DIRS``
-  Full paths to all include dirs.
-
-``ImageMagick_LIBRARIES``
-  Full paths to all libraries.
-
-``ImageMagick_COMPILE_OPTIONS``
-  Compile options of all libraries.
+  Boolean indicating whether ImageMagick and all its requested components are
+  found.
 
 ``ImageMagick_VERSION_STRING``
-  The version of ImageMagick found (since CMake 2.8.8).
-  Will not work for old versions like 5.2.3.
+  The version of ImageMagick found.
+
+  .. note::
+
+    Version detection is available only for ImageMagick 6 and later.
+
+``ImageMagick_INCLUDE_DIRS``
+  All include directories needed to use ImageMagick.
+
+``ImageMagick_LIBRARIES``
+  Libraries needed to link against to use ImageMagick.
+
+``ImageMagick_COMPILE_OPTIONS``
+  .. versionadded:: 3.26
+
+  Compile options of all libraries.
 
 ``ImageMagick_<component>_FOUND``
-  TRUE if <component> is found.
+  Boolean indicating whether the ImageMagick ``<component>`` is found.
 
 ``ImageMagick_<component>_EXECUTABLE``
-  Full path to <component> executable.
+  The full path to ``<component>`` executable.
 
 ``ImageMagick_<component>_INCLUDE_DIRS``
-  Full path to <component> include dirs.
+  Include directories containing headers needed to use the ImageMagick
+  ``<component>``.
 
 ``ImageMagick_<component>_COMPILE_OPTIONS``
   .. versionadded:: 3.26
 
-  Compile options of <component>.
+  Compile options of the ImageMagick ``<component>``.
 
 ``ImageMagick_<component>_LIBRARIES``
   .. versionadded:: 3.31
 
-  Full path to <component> libraries.
+  Libraries needed to link against to use the ImageMagick ``<component>``.
 
+Cache Variables
+^^^^^^^^^^^^^^^
 
-Example Usage
-^^^^^^^^^^^^^
+The following cache variables may also be set:
+
+``ImageMagick_EXECUTABLE_DIR``
+  The full path to directory containing ImageMagick executables.
+
+Examples
+^^^^^^^^
+
+Finding ImageMagick with its component ``Magick++``  and linking it to a project
+target:
 
 .. code-block:: cmake
 
diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake
index 1c93dea..cdc6541 100644
--- a/Modules/FindIntl.cmake
+++ b/Modules/FindIntl.cmake
@@ -7,79 +7,97 @@
 
 .. versionadded:: 3.2
 
-Find the Gettext libintl headers and libraries.
+Finds internationalization support that includes message translation functions
+such as ``gettext()``.  These functions originate from the GNU ``libintl``
+library, which is part of the GNU gettext utilities, but may also be provided by
+the standard C library.
 
-This module reports information about the Gettext libintl
-installation in several variables.
+Imported Targets
+^^^^^^^^^^^^^^^^
 
-.. variable:: Intl_FOUND
+This module provides the following :ref:`Imported Targets`:
 
-  True if libintl is found.
+``Intl::Intl``
+  .. versionadded:: 3.20
 
-.. variable:: Intl_INCLUDE_DIRS
+  Target encapsulating the Intl usage requirements, available if Intl is found.
 
-  The directory containing the libintl headers.
+Result Variables
+^^^^^^^^^^^^^^^^
 
-.. variable:: Intl_LIBRARIES
+This module defines the following variables:
 
-  The intl libraries to be linked.
+``Intl_FOUND``
+  Boolean indicating whether the Intl is found.
 
-.. variable:: Intl_VERSION
+``Intl_INCLUDE_DIRS``
+  Include directories containing headers needed to use Intl.
 
+``Intl_LIBRARIES``
+  The libraries needed to link against to use Intl.
+
+``Intl_VERSION``
   .. versionadded:: 3.21
 
-  The version of intl found (x.y.z)
+  The version of the found Intl implementation or library, in the format
+  ``x.y.z``.
 
-.. variable:: Intl_VERSION_MAJOR
+  .. note::
+    Some Intl implementations don't embed the version in their header files.
+    In this case the variables ``Intl_VERSION*`` will be empty.
 
+``Intl_VERSION_MAJOR``
   .. versionadded:: 3.21
 
-  The major version of intl
+  The major version of Intl found.
 
-.. variable:: Intl_VERSION_MINOR
-
+``Intl_VERSION_MINOR``
   .. versionadded:: 3.21
 
-  The minor version of intl
+  The minor version of Intl found.
 
-.. variable:: Intl_VERSION_PATCH
-
+``Intl_VERSION_PATCH``
   .. versionadded:: 3.21
 
-  The patch version of intl
+  The patch version of Intl found.
 
-.. versionadded:: 3.20
-  This module defines :prop_tgt:`IMPORTED` target ``Intl::Intl``.
+Cache Variables
+^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
-.. variable:: Intl_INCLUDE_DIR
+``Intl_INCLUDE_DIR``
+  The directory containing the ``libintl.h`` header file.
 
-  The directory containing the libintl headers
+``Intl_LIBRARY``
+  The path to the Intl library (if any).
 
-.. variable:: Intl_LIBRARY
-
-  The libintl library (if any)
-
-.. variable:: Intl_IS_BUILT_IN
-
+``Intl_IS_BUILT_IN``
   .. versionadded:: 3.20
 
-  whether ``intl`` is a part of the C library.
+  Boolean indicating whether the found Intl functionality is provided by the
+  standard C library rather than a separate ``libintl`` library.
 
 .. note::
-  On some platforms, such as Linux with GNU libc, the gettext
-  functions are present in the C standard library and libintl
-  is not required.  ``Intl_LIBRARIES`` will be empty in this
-  case.
+  On some platforms, such as Linux with GNU libc, the gettext functions are
+  present in the C standard library and libintl is not required.  The
+  ``Intl_LIBRARY`` and ``Intl_INCLUDE_DIR`` will be empty in this case.
 
-.. note::
-  Some libintl implementations don't embed the version number in their header files.
-  In this case the variables ``Intl_VERSION*`` will be empty.
+Examples
+^^^^^^^^
 
-.. note::
-  If you wish to use the Gettext tools (``msgmerge``,
-  ``msgfmt``, etc.), use :module:`FindGettext`.
+Finding the Intl support and linking the imported target for use in a project:
+
+.. code-block:: cmake
+
+  find_package(Intl)
+  target_link_libraries(app PRIVATE Intl::Intl)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindGettext` module to find and use the GNU gettext tools
+  (``msgmerge``, ``msgfmt``, etc.).
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index 59c2634..10dcc51 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -5,7 +5,7 @@
 FindJNI
 -------
 
-Find Java Native Interface (JNI) headers and libraries.
+Finds the Java Native Interface (JNI) include directories and libraries.
 
 JNI enables Java code running in a Java Virtual Machine (JVM) or Dalvik Virtual
 Machine (DVM) on Android to call and be called by native applications and
@@ -13,14 +13,11 @@
 
 This module finds if Java is installed and determines where the
 include files and libraries are.  It also determines what the name of
-the library is.  The caller may set variable ``JAVA_HOME`` to specify a
-Java installation prefix explicitly.
+the library is.
 
 .. versionadded:: 3.24
 
-  Added imported targets, components ``AWT``, ``JVM``, and Android NDK support.
-  If no components are specified, the module defaults to an empty components
-  list while targeting Android, and all available components otherwise.
+  Imported targets, components, and Android NDK support.
 
   When using Android NDK, the corresponding package version is reported and a
   specific release can be requested. At Android API level 31 and above, the
@@ -28,74 +25,172 @@
   also exposed as an implicit dependency of the ``JVM`` component (only if this
   does not cause a conflict) which provides a uniform access to JVM functions.
 
+Components
+^^^^^^^^^^
+
+This module supports optional components, which can be specified with the
+:command:`find_package` command:
+
+.. code-block:: cmake
+
+  find_package(JNI [COMPONENTS <components>...])
+
+Supported components include:
+
+``AWT``
+  .. versionadded:: 3.24
+
+  Finds the Java Abstract Window Toolkit (AWT).
+
+``JVM``
+  .. versionadded:: 3.24
+
+  Finds the Java Virtual Machine (JVM).
+
+``NativeHelper``
+  .. versionadded:: 3.24
+
+  Finds the NativeHelper library on Android (``libnativehelper.so``), which
+  exposes JVM functions such as ``JNI_CreateJavaVM()``.
+
+If no components are specified, the module defaults are:
+
+* When targeting Android with API level 31 and above: module looks for the
+  ``NativeHelper`` component.  For other Android API levels, components are by
+  default not set.
+* When targeting other systems: module looks for ``AWT`` and ``JVM`` components.
+
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.24
+This module provides the following :ref:`Imported Targets`:
 
 ``JNI::JNI``
-  Main JNI target, defined only if ``jni.h`` was found.
+  .. versionadded:: 3.24
+
+  Main target encapsulating all JNI usage requirements, available if ``jni.h``
+  is found.
 
 ``JNI::AWT``
-  Java AWT Native Interface (JAWT) library, defined only if component ``AWT`` was
-  found.
+  .. versionadded:: 3.24
+
+  Target encapsulating the Java AWT Native Interface (JAWT) library usage
+  requirements, available if the ``AWT`` component is found.
 
 ``JNI::JVM``
-  Java Virtual Machine (JVM) library, defined only if component ``JVM`` was found.
+  .. versionadded:: 3.24
+
+  Target encapsulating the Java Virtual Machine (JVM) library usage
+  requirements, available if component ``JVM`` is found.
 
 ``JNI::NativeHelper``
-  When targeting Android API level 31 and above, the import target will provide
-  access to ``libnativehelper.so`` that exposes JVM functions such as
-  ``JNI_CreateJavaVM``.
+  .. versionadded:: 3.24
+
+  Target encapsulating the NativeHelper library usage requirements, available
+  when targeting Android API level 31 and above, and the library is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module sets the following result variables:
+This module defines the following variables:
 
-``JNI_INCLUDE_DIRS``
-  The include directories to use.
-``JNI_LIBRARIES``
-  The libraries to use (JAWT and JVM).
 ``JNI_FOUND``
-  ``TRUE`` if JNI headers and libraries were found.
+  Boolean indicating whether the JNI is found.
+
 ``JNI_<component>_FOUND``
   .. versionadded:: 3.24
 
-  ``TRUE`` if ``<component>`` was found.
+  Boolean indicating whether the ``<component>`` is found.
+
 ``JNI_VERSION``
   Full Android NDK package version (including suffixes such as ``-beta3`` and
   ``-rc1``) or undefined otherwise.
+
 ``JNI_VERSION_MAJOR``
   .. versionadded:: 3.24
 
   Android NDK major version or undefined otherwise.
+
 ``JNI_VERSION_MINOR``
   .. versionadded:: 3.24
 
   Android NDK minor version or undefined otherwise.
+
 ``JNI_VERSION_PATCH``
   .. versionadded:: 3.24
 
   Android NDK patch version or undefined otherwise.
 
+``JNI_INCLUDE_DIRS``
+  The include directories needed to use the JNI.
+
+``JNI_LIBRARIES``
+  The libraries (JAWT and JVM) needed to link against to use JNI.
+
 Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables are also available to set or use:
 
+``JAVA_INCLUDE_PATH``
+  The directory containing the ``jni.h`` header.
+
+``JAVA_INCLUDE_PATH2``
+  The directory containing machine-dependent headers ``jni_md.h`` and
+  ``jniport.h``.  This variable is defined only if ``jni.h`` depends on one of
+  these headers.  In contrast, Android NDK ``jni.h`` can be typically used
+  standalone.
+
+``JAVA_AWT_INCLUDE_PATH``
+  The directory containing the ``jawt.h`` header.
+
 ``JAVA_AWT_LIBRARY``
   The path to the Java AWT Native Interface (JAWT) library.
+
 ``JAVA_JVM_LIBRARY``
   The path to the Java Virtual Machine (JVM) library.
-``JAVA_INCLUDE_PATH``
-  The include path to ``jni.h``.
-``JAVA_INCLUDE_PATH2``
-  The include path to machine-dependent headers ``jni_md.h`` and ``jniport.h``.
-  The variable is defined only if ``jni.h`` depends on one of these headers. In
-  contrast, Android NDK ``jni.h`` can be typically used standalone.
-``JAVA_AWT_INCLUDE_PATH``
-  The include path to ``jawt.h``.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``JAVA_HOME``
+  The caller can set this variable to specify the installation directory of Java
+  explicitly.
+
+Examples
+^^^^^^^^
+
+Finding JNI and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(JNI)
+  target_link_libraries(project_target PRIVATE JNI::JNI)
+
+Finding JNI with AWT component specified and linking them to a project target:
+
+.. code-block:: cmake
+
+  find_package(JNI COMPONENTS AWT)
+  target_link_libraries(project_target PRIVATE JNI::JNI JNI::AWT)
+
+A more common way to use Java and JNI in CMake is to use a dedicated
+:module:`UseJava` module:
+
+.. code-block:: cmake
+
+  find_package(Java)
+  find_package(JNI)
+  include(UseJava)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindJava` module to find Java runtime tools and development
+  components.
+* The :module:`UseJava` module to use Java in CMake.
 #]=======================================================================]
 
 include(CheckSourceCompiles)
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index f12945b..9d43f58 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -5,53 +5,80 @@
 FindJPEG
 --------
 
-Find the Joint Photographic Experts Group (JPEG) library (``libjpeg``)
+Finds the Joint Photographic Experts Group (JPEG) library (``libjpeg``).
+
+.. versionchanged:: 3.12
+  Debug and Release JPEG library variants are now found separately.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.12
-
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``JPEG::JPEG``
-  The JPEG library, if found.
+  .. versionadded:: 3.12
 
-Result variables
+  Target encapsulating the JPEG library usage requirements.  It is available
+  only when JPEG is found.
+
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module sets the following variables:
 
 ``JPEG_FOUND``
-  If false, do not try to use JPEG.
+  Boolean indicating whether the JPEG is found.
+
 ``JPEG_INCLUDE_DIRS``
-  where to find jpeglib.h, etc.
+  Include directories containing headers needed to use JPEG.
+
 ``JPEG_LIBRARIES``
-  the libraries needed to use JPEG.
+  Libraries needed to link to JPEG.
+
 ``JPEG_VERSION``
   .. versionadded:: 3.12
-    the version of the JPEG library found
 
-Cache variables
+  The version of the JPEG library found.
+
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``JPEG_INCLUDE_DIR``
-  where to find jpeglib.h, etc.
+  Directory containing the ``jpeglib.h`` and related header files.
+
 ``JPEG_LIBRARY_RELEASE``
-  where to find the JPEG library (optimized).
+  .. versionadded:: 3.12
+
+  Path to the release (optimized) variant of the JPEG library.
+
 ``JPEG_LIBRARY_DEBUG``
-  where to find the JPEG library (debug).
+  .. versionadded:: 3.12
 
-.. versionadded:: 3.12
-  Debug and Release variand are found separately.
+  Path to the debug variant of the JPEG library.
 
-Obsolete variables
+Obsolete Variables
 ^^^^^^^^^^^^^^^^^^
 
+The following legacy variables are provided for backward compatibility:
+
 ``JPEG_LIBRARY``
-  where to find the JPEG library.
+  .. versionchanged:: 3.12
+    This variable has been superseded by the ``JPEG_LIBRARY_RELEASE`` and
+    ``JPEG_LIBRARY_DEBUG`` variables.
+
+  Path to the JPEG library.
+
+Examples
+^^^^^^^^
+
+Finding JPEG library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(JPEG)
+  target_link_libraries(project_target PRIVATE JPEG::JPEG)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index 2c2cbbf..3902f6d 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -5,41 +5,64 @@
 FindJasper
 ----------
 
-Find the Jasper JPEG2000 library.
+Finds the JasPer Image Coding Toolkit for handling image data in a variety of
+formats, such as the JPEG-2000.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
+This module provides the following :ref:`Imported Targets`:
+
 ``Jasper::Jasper``
-  The jasper library, if found.
+  .. versionadded:: 3.22
+
+  Target encapsulating the JasPer library usage requirements, available only if
+  the library is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``JASPER_FOUND``
-  system has Jasper
+``Jasper_FOUND``
+  Boolean indicating whether the JasPer is found.  For backward compatibility,
+  the ``JASPER_FOUND`` variable is also set to the same value.
+
 ``JASPER_INCLUDE_DIRS``
   .. versionadded:: 3.22
 
-  the Jasper include directory
-``JASPER_LIBRARIES``
-  the libraries needed to use Jasper
-``JASPER_VERSION_STRING``
-  the version of Jasper found
+  The include directories needed to use the JasPer library.
 
-Cache variables
+``JASPER_LIBRARIES``
+  The libraries needed to use JasPer.
+
+``JASPER_VERSION_STRING``
+  The version of JasPer found.
+
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``JASPER_INCLUDE_DIR``
-  where to find jasper/jasper.h, etc.
+  The directory containing the ``jasper/jasper.h`` and other headers needed to
+  use the JasPer library.
+
 ``JASPER_LIBRARY_RELEASE``
-  where to find the Jasper library (optimized).
-``JASPER_LIBARRY_DEBUG``
-  where to find the Jasper library (debug).
+  The path to the release (optimized) variant of the JasPer library.
+
+``JASPER_LIBRARY_DEBUG``
+  The path to the debug variant of the JasPer library.
+
+Examples
+^^^^^^^^
+
+Finding the JasPer library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Jasper)
+  target_link_libraries(project_target PRIVATE Jasper::Jasper)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -49,7 +72,7 @@
 mark_as_advanced(JASPER_INCLUDE_DIR)
 
 if(NOT JASPER_LIBRARIES)
-  find_package(JPEG)
+  find_package(JPEG QUIET)
   find_library(JASPER_LIBRARY_RELEASE NAMES jasper libjasper)
   find_library(JASPER_LIBRARY_DEBUG NAMES jasperd)
   include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
@@ -63,11 +86,14 @@
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Jasper
-                                  REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR JPEG_LIBRARIES
+                                  REQUIRED_VARS JASPER_LIBRARIES JASPER_INCLUDE_DIR
                                   VERSION_VAR JASPER_VERSION_STRING)
 
-if(JASPER_FOUND)
-  set(JASPER_LIBRARIES ${JASPER_LIBRARIES} ${JPEG_LIBRARIES})
+if(Jasper_FOUND)
+  set(JASPER_LIBRARIES ${JASPER_LIBRARIES})
+  if(JPEG_FOUND)
+    list(APPEND JASPER_LIBRARIES ${JPEG_LIBRARIES})
+  endif()
   set(JASPER_INCLUDE_DIRS ${JASPER_INCLUDE_DIR})
   if(NOT TARGET Jasper::Jasper)
     add_library(Jasper::Jasper UNKNOWN IMPORTED)
@@ -80,14 +106,14 @@
         IMPORTED_CONFIGURATIONS RELEASE)
       set_target_properties(Jasper::Jasper PROPERTIES
         IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
-        IMPORTED_LOCATION "${JASPER_LIBRARY_RELEASE}")
+        IMPORTED_LOCATION_RELEASE "${JASPER_LIBRARY_RELEASE}")
     endif()
     if(EXISTS "${JASPER_LIBRARY_DEBUG}")
       set_property(TARGET Jasper::Jasper APPEND PROPERTY
         IMPORTED_CONFIGURATIONS DEBUG)
       set_target_properties(Jasper::Jasper PROPERTIES
         IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
-        IMPORTED_LOCATION "${JASPER_LIBRARY_DEBUG}")
+        IMPORTED_LOCATION_DEBUG "${JASPER_LIBRARY_DEBUG}")
     endif()
   endif()
 endif()
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index 1413acd..1587ce6 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -5,80 +5,156 @@
 FindJava
 --------
 
-Find Java
-
-This module finds if Java is installed and determines where the
-include files and libraries are.  The caller may set variable ``JAVA_HOME``
-to specify a Java installation prefix explicitly.
-
-See also the :module:`FindJNI` module to find Java Native Interface (JNI).
+Finds the Java installation and determines its runtime tools and development
+components.
 
 .. versionadded:: 3.10
-  Added support for Java 9+ version parsing.
+  Support for Java 9+ version parsing.
 
-Specify one or more of the following components as you call this find module. See example below.
+Components
+^^^^^^^^^^
 
-::
+This module supports the following components:
 
-  Runtime     = Java Runtime Environment used to execute Java byte-compiled applications
-  Development = Development tools (java, javac, javah, jar and javadoc), includes Runtime component
-  IdlJ        = Interface Description Language (IDL) to Java compiler
-  JarSigner   = Signer and verifier tool for Java Archive (JAR) files
+``Runtime``
+  Finds the Java Runtime Environment used to execute Java byte-compiled
+  applications.
 
+``Development``
+  Finds development tools (``java``, ``javac``, ``javah``, ``jar``, and
+  ``javadoc``).  Specifying this component also implies the ``Runtime``
+  component.
 
-This module sets the following result variables:
+``IdlJ``
+  .. versionadded:: 3.4
 
-::
+  Finds the Interface Description Language (IDL) to Java compiler.
 
-  Java_JAVA_EXECUTABLE      = the full path to the Java runtime
-  Java_JAVAC_EXECUTABLE     = the full path to the Java compiler
-  Java_JAVAH_EXECUTABLE     = the full path to the Java header generator
-  Java_JAVADOC_EXECUTABLE   = the full path to the Java documentation generator
-  Java_IDLJ_EXECUTABLE      = the full path to the Java idl compiler
-  Java_JAR_EXECUTABLE       = the full path to the Java archiver
-  Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
-  Java_VERSION_STRING       = Version of java found, eg. 1.6.0_12
-  Java_VERSION_MAJOR        = The major version of the package found.
-  Java_VERSION_MINOR        = The minor version of the package found.
-  Java_VERSION_PATCH        = The patch version of the package found.
-  Java_VERSION_TWEAK        = The tweak version of the package found (after '_')
-  Java_VERSION              = This is set to: $major[.$minor[.$patch[.$tweak]]]
+``JarSigner``
+  .. versionadded:: 3.4
 
-.. versionadded:: 3.4
-  Added the ``Java_IDLJ_EXECUTABLE`` and ``Java_JARSIGNER_EXECUTABLE``
-  variables.
+  Finds the signer and verifier tool for Java Archive (JAR) files.
 
-The minimum required version of Java can be specified using the
-:command:`find_package` syntax, e.g.
+Components can optionally be specified using the standard syntax with:
+
+.. code-block:: cmake
+
+  find_package(Java [COMPONENTS <components>...])
+
+If no ``COMPONENTS`` are specified, the module searches for the ``Runtime``
+component by default.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Java_FOUND``
+  Boolean indicating whether Java with all specified components is found.
+
+``Java_<component>_FOUND``
+  Boolean indicating whether the ``<component>`` is found.
+
+``Java_VERSION``
+  Version of Java found.  This is set to:
+  ``<major>[.<minor>[.<patch>[.<tweak>]]]``.
+
+``Java_VERSION_MAJOR``
+  The major version of Java found.
+
+``Java_VERSION_MINOR``
+  The minor version of Java found.
+
+``Java_VERSION_PATCH``
+  The patch version of Java found.
+
+``Java_VERSION_TWEAK``
+  The tweak version of Java found (part after the underscore character ``_``).
+
+``Java_VERSION_STRING``
+  Version of Java found, e.g., ``1.6.0_12``.
+
+  .. note::
+
+    ``Java_VERSION`` and ``Java_VERSION_STRING`` are not guaranteed to be
+    identical.  For example, some Java versions may return:
+    ``Java_VERSION_STRING = 1.8.0_17`` and ``Java_VERSION = 1.8.0.17``.
+
+    Another example is the Java OEM, with ``Java_VERSION_STRING = 1.8.0-oem``
+    and ``Java_VERSION = 1.8.0``.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Java_JAVA_EXECUTABLE``
+  The full path to the Java runtime.
+
+``Java_JAVAC_EXECUTABLE``
+  The full path to the Java compiler.
+
+``Java_JAVAH_EXECUTABLE``
+  The full path to the Java header generator.
+
+``Java_JAVADOC_EXECUTABLE``
+  The full path to the Java documentation generator.
+
+``Java_IDLJ_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The full path to the Java idl compiler.
+
+``Java_JAR_EXECUTABLE``
+  The full path to the Java archiver.
+
+``Java_JARSIGNER_EXECUTABLE``
+  .. versionadded:: 3.4
+
+  The full path to the Java jar signer.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``JAVA_HOME``
+  The caller can set this variable to specify the installation directory of Java
+  explicitly.
+
+Examples
+^^^^^^^^
+
+Finding Java:
+
+.. code-block:: cmake
+
+  find_package(Java)
+
+Finding Java with at least the specified minimum version:
 
 .. code-block:: cmake
 
   find_package(Java 1.8)
 
-NOTE: ``${Java_VERSION}`` and ``${Java_VERSION_STRING}`` are not guaranteed to
-be identical.  For example some java version may return:
-``Java_VERSION_STRING = 1.8.0_17`` and ``Java_VERSION = 1.8.0.17``
-
-another example is the Java OEM, with: ``Java_VERSION_STRING = 1.8.0-oem``
-and ``Java_VERSION = 1.8.0``
-
-For these components the following variables are set:
-
-::
-
-  Java_FOUND                    - TRUE if all components are found.
-  Java_<component>_FOUND        - TRUE if <component> is found.
-
-
-
-Example Usages:
+Finding Java and making it required (if Java is not found, processing stops with
+an error message):
 
 .. code-block:: cmake
 
-  find_package(Java)
   find_package(Java 1.8 REQUIRED)
-  find_package(Java COMPONENTS Runtime)
-  find_package(Java COMPONENTS Development)
+
+Specifying the needed Java components to find:
+
+.. code-block:: cmake
+
+  find_package(Java COMPONENTS Development JarSigner)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindJNI` module to find Java Native Interface (JNI).
+* The :module:`UseJava` module to use Java in CMake.
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index a2e0219..ccfad5e 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -5,139 +5,202 @@
 FindKDE3
 --------
 
-Find the KDE3 include and library dirs, KDE preprocessors and define a some macros
+.. note::
 
+  This module is specifically intended for KDE version 3, which is obsolete and
+  no longer maintained.  For modern application development using KDE
+  technologies with CMake, use a newer version of KDE, and refer to the
+  `KDE documentation
+  <https://develop.kde.org/docs/getting-started/building/cmake-build/>`_.
 
+This module finds KDE 3 include directories, libraries, and KDE-specific
+preprocessor tools.  It provides usage requirements for building KDE 3 software
+and defines several helper commands to simplify working with KDE 3 in CMake.
+
+Result Variables
+^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``KDE3_DEFINITIONS``
-  compiler definitions required for compiling KDE software
-``KDE3_INCLUDE_DIR``
-  the KDE include directory
-``KDE3_INCLUDE_DIRS``
-  the KDE and the Qt include directory, for use with include_directories()
-``KDE3_LIB_DIR``
-  the directory where the KDE libraries are installed, for use with link_directories()
-``QT_AND_KDECORE_LIBS``
-  this contains both the Qt and the kdecore library
-``KDE3_DCOPIDL_EXECUTABLE``
-  the dcopidl executable
-``KDE3_DCOPIDL2CPP_EXECUTABLE``
-  the dcopidl2cpp executable
-``KDE3_KCFGC_EXECUTABLE``
-  the kconfig_compiler executable
 ``KDE3_FOUND``
-  set to TRUE if all of the above has been found
+  Boolean indicating whether KDE 3 is found.
+``KDE3_DEFINITIONS``
+  Compiler definitions required for compiling KDE 3 software.
+``KDE3_INCLUDE_DIRS``
+  The KDE and the Qt include directories, for use with the
+  :command:`target_include_directories` command.
+``KDE3_LIB_DIR``
+  The directory containing the installed KDE 3 libraries, for use with the
+  :command:`target_link_directories` command.
+``QT_AND_KDECORE_LIBS``
+  A list containing both the Qt and the kdecore library, typically used together
+  when linking KDE 3.
 
-The following user adjustable options are provided:
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``KDE3_INCLUDE_DIR``
+  The directory containing KDE 3 header files.
+``KDE3_DCOPIDL_EXECUTABLE``
+  The path to the ``dcopidl`` executable.
+``KDE3_DCOPIDL2CPP_EXECUTABLE``
+  The path to the ``dcopidl2cpp`` executable.
+``KDE3_KCFGC_EXECUTABLE``
+  The path to the ``kconfig_compiler`` executable.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
 
 ``KDE3_BUILD_TESTS``
-  enable this to build KDE testcases
+  Provided as a user adjustable option.  Set this variable to boolean true to
+  build KDE 3 testcases.
 
-It also adds the following macros (from ``KDE3Macros.cmake``) ``SRCS_VAR`` is
-always the variable which contains the list of source files for your
-application or library.
+Commands
+^^^^^^^^
 
-KDE3_AUTOMOC(file1 ...  fileN)
+This module provides the following commands to work with KDE 3 in CMake:
 
-::
+.. command:: kde3_automoc
 
-    Call this if you want to have automatic moc file handling.
-    This means if you include "foo.moc" in the source file foo.cpp
-    a moc file for the header foo.h will be created automatically.
-    You can set the property SKIP_AUTOMAKE using set_source_files_properties()
-    to exclude some files in the list from being processed.
+  Enables automatic processing with ``moc`` for the given source files:
 
+  .. code-block:: cmake
 
+    kde3_automoc(<sources>...)
 
-KDE3_ADD_MOC_FILES(SRCS_VAR file1 ...  fileN )
+  Call this command to enable automatic ``moc`` file handling.  For example,
+  if a source file (e.g., ``foo.cpp``) contains ``include "foo.moc"``, a
+  ``moc`` file for the corresponding header (``foo.h``) will be generated
+  automatically.  To skip processing for a specific source file, set the
+  :prop_sf:`SKIP_AUTOMOC` source file property.
 
-::
+.. command:: kde3_add_moc_files
 
-    If you don't use the KDE3_AUTOMOC() macro, for the files
-    listed here moc files will be created (named "foo.moc.cpp")
+  Processes header files with ``moc``:
 
+  .. code-block:: cmake
 
+    kde3_add_moc_files(<variable> <headers>...)
 
-KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ...  headerN.h )
+  If not using ``kde3_automoc()``, this command can be used to generate ``moc``
+  files for one or more ``<headers>`` files.  The generated files are named
+  ``<filename>.moc.cpp`` and the resulting list of these generated source files
+  is stored in the variable named ``<variable>`` for use in project targets.
 
-::
+.. command:: kde3_add_dcop_skels
 
-    Use this to generate DCOP skeletions from the listed headers.
+  Generates KIDL and DCOP skeletons:
 
+  .. code-block:: cmake
 
+    kde3_add_dcop_skels(<variable> <dcop-headers>...)
 
-KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ...  headerN.h )
+  This command generates ``.kidl`` and DCOP skeleton source files from the given
+  DCOP header files.  The resulting list of generated source files is stored in
+  the variable named ``<variable>`` for use in project targets.
 
-::
+.. command:: kde3_add_dcop_stubs
 
-     Use this to generate DCOP stubs from the listed headers.
+  Generates DCOP stubs:
 
+  .. code-block:: cmake
 
+    kde3_add_dcop_stubs(<variable> <headers>...)
 
-KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ...  fileN.ui )
+  Use this command to generate DCOP stubs from one or more given header files.
+  The resulting list of generated source files is stored in the variable named
+  ``<variable>`` for use in project targets.
 
-::
+.. command:: kde3_add_ui_files
 
-    Use this to add the Qt designer ui files to your application/library.
+  Adds Qt designer UI files:
 
+  .. code-block:: cmake
 
+    kde3_add_ui_files(<variable> <ui-files>...)
 
-KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ...  fileN.kcfgc )
+  This command creates the implementation files from the given Qt designer
+  ``.ui`` files.  The resulting list of generated files is stored in the
+  variable named ``<variable>`` for use in project targets.
 
-::
+.. command:: kde3_add_kcfg_files
 
-    Use this to add KDE kconfig compiler files to your application/library.
+  Adds KDE kconfig compiler files:
 
+  .. code-block:: cmake
 
+    kde3_add_kcfg_files(<variable> <kcfgc-files>...)
 
-KDE3_INSTALL_LIBTOOL_FILE(target)
+  Use this command to add KDE kconfig compiler files (``.kcfgc``) to the
+  application/library.  The resulting list of generated source files is stored
+  in the variable named ``<variable>`` for use in project targets.
 
-::
+.. command:: kde3_install_libtool_file
 
-    This will create and install a simple libtool file for the given target.
+  Creates and installs a libtool file:
 
+  .. code-block:: cmake
 
+    kde3_install_libtool_file(<target>)
 
-KDE3_ADD_EXECUTABLE(name file1 ...  fileN )
+  This command creates and installs a basic libtool file for the given target
+  ``<target>``.
 
-::
+.. command:: kde3_add_executable
 
-    Currently identical to add_executable(), may provide some advanced
-    features in the future.
+  Adds KDE executable:
 
+  .. code-block:: cmake
 
+    kde3_add_executable(<name> <sources>...)
 
-KDE3_ADD_KPART(name [WITH_PREFIX] file1 ...  fileN )
+  This command is functionally identical to the built-in
+  :command:`add_executable` command.  It was originally intended to support
+  additional features in future versions of this module.
 
-::
+.. command:: kde3_add_kpart
 
-    Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
-    If WITH_PREFIX is given, the resulting plugin will have the prefix "lib",
-    otherwise it won't.
-    It creates and installs an appropriate libtool la-file.
+  Creates a KDE plugin:
 
+  .. code-block:: cmake
 
+    kde3_add_kpart(<name> [WITH_PREFIX] <sources>...)
 
-KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ...  fileN )
+  This command creates a KDE plugin (KPart, kioslave, etc.) from one or more
+  source files ``<sources>``.  It also creates and installs an appropriate
+  libtool ``.la`` file.
 
-::
+  If the ``WITH_PREFIX`` option is given, the resulting plugin name will be
+  prefixed with ``lib``.  Otherwise, no prefix is added.
 
-    Create a KDE application in the form of a module loadable via kdeinit.
-    A library named kdeinit_<name> will be created and a small executable
-    which links to it.
+.. command:: kde3_add_kdeinit_executable
 
+  Creates a KDE application as a module loadable via kdeinit:
 
+  .. code-block:: cmake
 
-The option KDE3_ENABLE_FINAL to enable all-in-one compilation is no
-longer supported.
+    kde3_add_kdeinit_executable(<name> <sources>...)
 
+  This command creates a library named ``kdeinit_<name>`` from one or more
+  source files ``<sources>``.  It also builds a small executable linked against
+  this library.
 
+Examples
+^^^^^^^^
 
-Author: Alexander Neundorf <neundorf@kde.org>
+Finding KDE 3:
+
+.. code-block:: cmake
+
+  find_package(KDE3)
 #]=======================================================================]
 
+# Author: Alexander Neundorf <neundorf@kde.org>
+
 if(NOT UNIX AND KDE3_FIND_REQUIRED)
   message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
 endif()
@@ -270,7 +333,7 @@
 # set compiler flags only if KDE3 has actually been found
 if(KDE3_FOUND)
   set(_KDE3_USE_FLAGS FALSE)
-  if(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|LCC)$")
     set(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler
     execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
                     OUTPUT_VARIABLE out)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 86c438a..8bd5121 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -55,6 +55,21 @@
     Search for any BLAS/LAPACK.
     Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.
 
+``BLA_THREAD``
+  .. versionadded:: 4.1
+
+  Specify the BLAS/LAPACK threading model:
+
+  ``SEQ``
+    Sequential model
+  ``OMP``
+    OpenMP model
+  ``ANY``
+    Search for any BLAS/LAPACK, if both are available most likely ``OMP`` will
+    be found.
+
+  This is currently only supported by NVIDIA NVPL.
+
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
@@ -278,6 +293,16 @@
   message(FATAL_ERROR "BLA_SIZEOF_INTEGER can have only <no value>, ANY, 4, or 8 values")
 endif()
 
+if(NOT BLA_THREAD)
+  set(_lapack_thread "ANY")
+elseif((BLA_THREAD STREQUAL "ANY") OR
+       (BLA_THREAD STREQUAL "SEQ") OR
+       (BLA_THREAD STREQUAL "OMP"))
+  set(_lapack_thread ${BLA_THREAD})
+else()
+  message(FATAL_ERROR "BLA_THREAD can have only <no value>, ANY, SEQ, or OMP values")
+endif()
+
 # Load BLAS
 if(NOT LAPACK_NOT_FOUND_MESSAGE)
   _lapack_find_dependency(BLAS)
@@ -693,6 +718,51 @@
     endif()
   endif()
 
+  # nVidia NVPL? (https://developer.nvidia.com/nvpl)
+  if(NOT LAPACK_LIBRARIES
+      AND (BLA_VENDOR MATCHES "NVPL" OR BLA_VENDOR STREQUAL "All"))
+    # Prefer lp64 unless ilp64 is requested.
+    if((_lapack_sizeof_integer EQUAL 4) OR (_lapack_sizeof_integer STREQUAL "ANY"))
+      list(APPEND _lapack_nvpl_ints "_lp64")
+    endif()
+    if((_lapack_sizeof_integer EQUAL 8) OR (_lapack_sizeof_integer STREQUAL "ANY"))
+      list(APPEND _lapack_nvpl_ints "_ilp64")
+    endif()
+
+    # Prefer OMP if available
+    if((_lapack_thread STREQUAL "OMP") OR (_lapack_thread STREQUAL "ANY"))
+      list(APPEND _lapack_nvpl_threads "_omp")
+    endif()
+    if((_lapack_thread STREQUAL "SEQ") OR (_lapack_thread STREQUAL "ANY"))
+      list(APPEND _lapack_nvpl_threads "_seq")
+    endif()
+
+    find_package(nvpl QUIET)
+    if(nvpl_FOUND)
+      foreach(_nvpl_thread IN LISTS _lapack_nvpl_threads)
+        foreach(_nvpl_int IN LISTS _lapack_nvpl_ints)
+
+          set(_lapack_lib "nvpl::lapack${_nvpl_int}${_nvpl_thread}")
+
+          if(TARGET ${_lapack_lib})
+            set(LAPACK_LIBRARIES ${_lapack_lib})
+            break()
+          endif()
+
+        endforeach()
+
+        if(LAPACK_LIBRARIES)
+          break()
+        endif()
+
+      endforeach()
+    endif()
+
+    unset(_lapack_lib)
+    unset(_lapack_nvpl_ints)
+    unset(_lapack_nvpl_threads)
+  endif()
+
   # NVHPC Library?
 
   if(NOT LAPACK_LIBRARIES
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index c4b99ad..e272770 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -5,58 +5,162 @@
 FindLATEX
 ---------
 
-Find LaTeX
+Finds LaTeX compiler and Latex-related software like BibTeX.  LaTeX is a
+typesetting system for the production of technical and scientific documentation.
 
-This module finds an installed LaTeX and determines the location
-of the compiler.  Additionally the module looks for Latex-related
-software like BibTeX.
+Components
+^^^^^^^^^^
 
 .. versionadded:: 3.2
-  Component processing; support for htlatex, pdftops, Biber, xindy, XeLaTeX,
-  LuaLaTeX.
 
-This module sets the following result variables::
+Components can be optionally specified using a standard CMake syntax:
 
-  LATEX_FOUND:          whether found Latex and requested components
-  LATEX_<component>_FOUND:  whether found <component>
-  LATEX_COMPILER:       path to the LaTeX compiler
-  PDFLATEX_COMPILER:    path to the PdfLaTeX compiler
-  XELATEX_COMPILER:     path to the XeLaTeX compiler
-  LUALATEX_COMPILER:    path to the LuaLaTeX compiler
-  BIBTEX_COMPILER:      path to the BibTeX compiler
-  BIBER_COMPILER:       path to the Biber compiler
-  MAKEINDEX_COMPILER:   path to the MakeIndex compiler
-  XINDY_COMPILER:       path to the xindy compiler
-  DVIPS_CONVERTER:      path to the DVIPS converter
-  DVIPDF_CONVERTER:     path to the DVIPDF converter
-  PS2PDF_CONVERTER:     path to the PS2PDF converter
-  PDFTOPS_CONVERTER:    path to the pdftops converter
-  LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
-  HTLATEX_COMPILER:     path to the htlatex compiler
+.. code-block:: cmake
 
-Possible components are::
+  find_package(LATEX [COMPONENTS <component>...])
 
-  PDFLATEX
-  XELATEX
-  LUALATEX
-  BIBTEX
-  BIBER
-  MAKEINDEX
-  XINDY
-  DVIPS
-  DVIPDF
-  PS2PDF
-  PDFTOPS
-  LATEX2HTML
-  HTLATEX
+Supported components are:
 
-Example Usages:
+``PDFLATEX``
+  Finds the PdfLaTeX compiler.
+
+``XELATEX``
+  Finds the XeLaTeX compiler.
+
+``LUALATEX``
+  Finds the LuaLaTeX compiler.
+
+``BIBTEX``
+  Finds the BibTeX compiler.
+
+``BIBER``
+  Finds the Biber compiler.
+
+``MAKEINDEX``
+  Finds the MakeIndex compiler.
+
+``XINDY``
+  Find the xindy compiler.
+
+``DVIPS``
+  Finds the DVI-to-PostScript (DVIPS) converter.
+
+``DVIPDF``
+  Finds the DVIPDF converter.
+
+``PS2PDF``
+  Finds the the PS2PDF converter.
+
+``PDFTOPS``
+  Finds the PDF-to-PostScript converter.
+
+``LATEX2HTML``
+  Finds the converter for converting LaTeX documents to HTML.
+
+``HTLATEX``
+  Finds htlatex compiler.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``LATEX_FOUND``
+  Boolean indicating whether the LaTex compiler and all its required components
+  are found.
+
+``LATEX_<component>_FOUND``
+  Boolean indicating whether the LaTeX ``<component>`` is found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LATEX_COMPILER``
+  The path to the LaTeX compiler.
+
+``PDFLATEX_COMPILER``
+  The path to the PdfLaTeX compiler.
+
+``XELATEX_COMPILER``
+  .. versionadded: 3.2
+
+  The path to the XeLaTeX compiler.
+
+``LUALATEX_COMPILER``
+  .. versionadded: 3.2
+
+  The path to the LuaLaTeX compiler.
+
+``BIBTEX_COMPILER``
+  The path to the BibTeX compiler.
+
+``BIBER_COMPILER``
+  .. versionadded: 3.2
+
+  The path to the Biber compiler.
+
+``MAKEINDEX_COMPILER``
+  The path to the MakeIndex compiler.
+
+``XINDY_COMPILER``
+  .. versionadded: 3.2
+
+  The path to the xindy compiler.
+
+``DVIPS_CONVERTER``
+  The path to the DVIPS converter.
+
+``DVIPDF_CONVERTER``
+  The path to the DVIPDF converter.
+
+``PS2PDF_CONVERTER``
+  The path to the PS2PDF converter.
+
+``PDFTOPS_CONVERTER``
+  .. versionadded: 3.2
+
+  The path to the pdftops converter.
+
+``LATEX2HTML_CONVERTER``
+  The path to the LaTeX2Html converter.
+
+``HTLATEX_COMPILER``
+  .. versionadded: 3.2
+
+  The path to the htlatex compiler.
+
+Examples
+^^^^^^^^
+
+Finding LaTeX in a project:
 
 .. code-block:: cmake
 
   find_package(LATEX)
+
+Finding LaTeX compiler and specifying which additional LaTeX components are
+required for LaTeX to be considered found:
+
+.. code-block:: cmake
+
   find_package(LATEX COMPONENTS PDFLATEX)
+
+  if(LATEX_FOUND)
+    execute_process(COMMAND ${LATEX_COMPILER} ...)
+    execute_process(COMMAND ${PDFLATEX_COMPILER} ...)
+  endif()
+
+Or finding LaTeX compiler and specifying multiple components:
+
+.. code-block:: cmake
+
   find_package(LATEX COMPONENTS BIBTEX PS2PDF)
+
+  if(LATEXT_FOUND)
+    # ...
+  endif()
 #]=======================================================================]
 
 if (WIN32)
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake
index a5ee9a9..14aa766 100644
--- a/Modules/FindLTTngUST.cmake
+++ b/Modules/FindLTTngUST.cmake
@@ -7,34 +7,52 @@
 
 .. versionadded:: 3.6
 
-Find
-`Linux Trace Toolkit Next Generation (LTTng-UST) <https://lttng.org/>`__ library.
+Finds the `LTTng <https://lttng.org/>`_ (Linux Trace Toolkit: next generation)
+user space tracing library (LTTng-UST).
 
-Imported target
-^^^^^^^^^^^^^^^
-
-This module defines the following :prop_tgt:`IMPORTED` target:
-
-``LTTng::UST``
-  The LTTng-UST library, if found
-
-Result variables
+Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module sets the following
+This module defines the following :ref:`Imported Targets`:
 
-``LTTNGUST_FOUND``
-  ``TRUE`` if system has LTTng-UST
-``LTTNGUST_INCLUDE_DIRS``
-  The LTTng-UST include directories
-``LTTNGUST_LIBRARIES``
-  The libraries needed to use LTTng-UST
+``LTTng::UST``
+  Target providing the LTTng-UST library usage requirements.  This target is
+  available only when LTTng-UST is found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following variables:
+
+``LTTngUST_FOUND``
+  Boolean indicating whether the LTTng-UST library is found.  For backward
+  compatibility, the ``LTTNGUST_FOUND`` variable is also set to the same value.
 ``LTTNGUST_VERSION_STRING``
-  The LTTng-UST version
+  The LTTng-UST version.
 ``LTTNGUST_HAS_TRACEF``
-  ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST
+  ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST.
 ``LTTNGUST_HAS_TRACELOG``
-  ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
+  ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LTTNGUST_INCLUDE_DIRS``
+  The LTTng-UST include directories.
+``LTTNGUST_LIBRARIES``
+  The libraries needed to use LTTng-UST.
+
+Examples
+^^^^^^^^
+
+Finding the LTTng-UST library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(LTTugNST)
+  target_link_libraries(project_target PRIVATE LTTng::UST)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index 538b654..9072d95 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -5,30 +5,50 @@
 FindLibArchive
 --------------
 
-Find libarchive library and headers.
-Libarchive is multi-format archive and compression library.
+Finds the libarchive library and include directories.  Libarchive is a
+multi-format archive and compression library.
 
-The module defines the following variables:
+Import Targets
+^^^^^^^^^^^^^^
 
-::
+This module defines the following :ref:`Imported Targets`:
 
-  LibArchive_FOUND        - true if libarchive was found
-  LibArchive_INCLUDE_DIRS - include search path
-  LibArchive_LIBRARIES    - libraries to link
-  LibArchive_VERSION      - libarchive 3-component version number
+``LibArchive::LibArchive``
+  .. versionadded:: 3.17
 
-The module defines the following ``IMPORTED`` targets:
+  A target for linking against libarchive.
 
-::
+Result Variables
+^^^^^^^^^^^^^^^^
 
-  LibArchive::LibArchive  - target for linking against libarchive
+This module defines the following variables:
 
-.. versionadded:: 3.6
-  Support for new libarchive 3.2 version string format.
+``LibArchive_FOUND``
+  Boolean indicating whether libarchive was found.
+``LibArchive_INCLUDE_DIRS``
+  Include search path for using libarchive.
+``LibArchive_LIBRARIES``
+  Libraries to link against libarchive.
+``LibArchive_VERSION``
+  A 3-component version string (``major.minor.patch``) of libarchive found.
 
-.. versionadded:: 3.17
-  Provides an imported target.
+  .. versionadded:: 3.6
 
+    Support for a new libarchive version string format.  Starting from
+    libarchive version 3.2, a different preprocessor macro is used in the header
+    to define the version.  In CMake 3.5 and earlier, this variable will be set
+    only for libarchive versions 3.1 and earlier.  In CMake 3.6 and newer, this
+    variable will be set for all libarchive versions.
+
+Examples
+^^^^^^^^
+
+Finding LibArchive and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(LibArchive)
+  target_link_libraries(project_target PRIVATE LibArchive::LibArchive)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index f42dccd..3711214 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -5,39 +5,51 @@
 FindLibLZMA
 -----------
 
-Find LZMA compression algorithm headers and library.
-
+Finds the data compression library that implements the LZMA (Lempel–Ziv–Markov
+chain algorithm) - liblzma.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.14
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``LibLZMA::LibLZMA``, if
-liblzma has been found.
+``LibLZMA::LibLZMA``
+  .. versionadded:: 3.14
 
-Result variables
+  Target encapsulating the liblzma library usage requirements, available only if
+  liblzma is found.
+
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
-``LIBLZMA_FOUND``
-  True if liblzma headers and library were found.
+``LibLZMA_FOUND``
+  Boolean indicating whether the liblzma is found.  For backward compatibility,
+  the ``LIBLZMA_FOUND`` variable is also set to the same value.
 ``LIBLZMA_INCLUDE_DIRS``
-  Directory where liblzma headers are located.
+  Include directories containing headers needed to use liblzma.
 ``LIBLZMA_LIBRARIES``
-  Lzma libraries to link against.
-``LIBLZMA_HAS_AUTO_DECODER``
-  True if lzma_auto_decoder() is found (required).
-``LIBLZMA_HAS_EASY_ENCODER``
-  True if lzma_easy_encoder() is found (required).
-``LIBLZMA_HAS_LZMA_PRESET``
-  True if lzma_lzma_preset() is found (required).
+  Libraries needed to link against to use liblzma.
 ``LIBLZMA_VERSION``
   .. versionadded:: 3.26
-    the version of LZMA found.
 
-  See also legacy variable ``LIBLZMA_VERSION_STRING``.
+  The version of liblzma found (available as a string, for example, ``5.0.3``).
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LIBLZMA_HAS_AUTO_DECODER``
+  Boolean sanity check result indicating whether the ``lzma_auto_decoder()``
+  function (automatic decoder functionality) is found in liblzma (required).
+``LIBLZMA_HAS_EASY_ENCODER``
+  Boolean sanity check result indicating whether the ``lzma_easy_encoder()``
+  function (basic encoder API) is found in liblzma (required).
+``LIBLZMA_HAS_LZMA_PRESET``
+  Boolean sanity check result indicating whether the ``lzma_lzma_preset()``
+  function (preset compression configuration) is found in liblzma (required).
 
 Legacy Variables
 ^^^^^^^^^^^^^^^^
@@ -45,17 +57,26 @@
 The following variables are provided for backward compatibility:
 
 ``LIBLZMA_VERSION_MAJOR``
-  The major version of lzma
+  The major version of liblzma found.
 ``LIBLZMA_VERSION_MINOR``
-  The minor version of lzma
+  The minor version of liblzma found.
 ``LIBLZMA_VERSION_PATCH``
-  The patch version of lzma
+  The patch version of liblzma found.
 ``LIBLZMA_VERSION_STRING``
-  version number as a string (ex: "5.0.3")
+  The version of liblzma found.
 
   .. versionchanged:: 3.26
     Superseded by ``LIBLZMA_VERSION``.
 
+Examples
+^^^^^^^^
+
+Finding the liblzma library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(LibLZMA)
+  target_link_libraries(project_target PRIVATE LibLZMA::LibLZMA)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -114,7 +135,7 @@
                                  )
 mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
 
-if (LIBLZMA_FOUND)
+if (LibLZMA_FOUND)
     set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
     set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
     if(NOT TARGET LibLZMA::LibLZMA)
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index befed4f..f453021 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -5,51 +5,62 @@
 FindLibXml2
 -----------
 
-Find the XML processing library (libxml2).
+Finds the XML processing library (libxml2).
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.12
-
-The following :prop_tgt:`IMPORTED` targets may be defined:
+This module provides the following :ref:`Imported Targets`:
 
 ``LibXml2::LibXml2``
-  libxml2 library.
+  .. versionadded:: 3.12
+
+  Target encapsulating the libxml2 library usage requirements, available only if
+  library is found.
+
 ``LibXml2::xmllint``
   .. versionadded:: 3.17
 
-  xmllint command-line executable.
+  Target encapsulating the xmllint command-line executable, available only if
+  xmllint executable is found.
 
-Result variables
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``LibXml2_FOUND``
-  true if libxml2 headers and libraries were found
-``LIBXML2_INCLUDE_DIR``
-  the directory containing LibXml2 headers
+  Boolean indicating whether the libxml2 library is found.
 ``LIBXML2_INCLUDE_DIRS``
-  list of the include directories needed to use LibXml2
+  Include directories needed to use the libxml2 library.
 ``LIBXML2_LIBRARIES``
-  LibXml2 libraries to be linked
+  Libraries needed to link against to use the libxml2 library.
 ``LIBXML2_DEFINITIONS``
-  the compiler switches required for using LibXml2
-``LIBXML2_XMLLINT_EXECUTABLE``
-  path to the XML checking tool xmllint coming with LibXml2
+  The compiler switches required for using libxml2.
 ``LIBXML2_VERSION_STRING``
-  the version of LibXml2 found (since CMake 2.8.8)
+  The version of the libxml2 found.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``LIBXML2_INCLUDE_DIR``
-  the directory containing LibXml2 headers
+  The include directory containing libxml2 headers.
 ``LIBXML2_LIBRARY``
-  path to the LibXml2 library
+  The path to the libxml2 library.
+``LIBXML2_XMLLINT_EXECUTABLE``
+  The path to the XML checking tool ``xmllint`` coming with libxml2.
+
+Examples
+^^^^^^^^
+
+Finding the libxml2 library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(LibXml2)
+  target_link_libraries(project_target PRIVATE LibXml2::LibXml2)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index f9f1dad..d612c7d 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -5,44 +5,102 @@
 FindLibXslt
 -----------
 
-Find the XSL Transformations, Extensible Stylesheet Language
-Transformations (XSLT) library (LibXslt)
+Finds the XSL Transformations, Extensible Stylesheet Language Transformations
+(XSLT) library (libxslt).
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
 .. versionadded:: 3.18
 
-The following :prop_tgt:`IMPORTED` targets may be defined:
+This module provides the following :ref:`Imported Targets`:
 
 ``LibXslt::LibXslt``
-  If the libxslt library has been found
-``LibXslt::LibExslt``
-  If the libexslt library has been found
-``LibXslt::xsltproc``
-  If the xsltproc command-line executable has been found
+  Target encapsulating the usage requirements of the libxslt library.  This
+  target is available only if libxslt is found.
 
-Result variables
+``LibXslt::LibExslt``
+  Target encapsulating the usage requirements for the libexslt library. Part of
+  the libxslt package, libexslt provides optional extensions to XSLT on top of
+  libxslt.  This target is available only if the main libxslt library is found.
+
+``LibXslt::xsltproc``
+  Target encapsulating the command-line XSLT processor (``xsltproc``).  This
+  tool, part of the libxslt package, applies XSLT stylesheets to XML documents
+  as a command-line alternative to the libxslt library.  This target is
+  available only if the ``xsltproc`` executable is found.
+
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module sets the following variables:
 
-  LIBXSLT_FOUND - system has LibXslt
-  LIBXSLT_INCLUDE_DIR - the LibXslt include directory
-  LIBXSLT_LIBRARIES - Link these to LibXslt
-  LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
-  LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
+``LibXslt_FOUND``
+  Boolean indicating whether the libxslt is found.  For backward compatibility,
+  the ``LIBXSLT_FOUND`` variable is also set to the same value.
 
-Additionally, the following two variables are set (but not required
-for using xslt):
+``LIBXSLT_LIBRARIES``
+  Libraries needed to link to libxslt.
+
+``LIBXSLT_DEFINITIONS``
+  Compiler switches required for using libxslt.
+
+``LIBXSLT_VERSION_STRING``
+  Version of libxslt found.
+
+``LIBXSLT_EXSLT_LIBRARIES``
+  Libraries needed when linking against the exslt library.  These are available
+  and needed only when using exslt library.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LIBXSLT_INCLUDE_DIR``
+  Directory containing ``libxslt/xslt.h`` and other libxslt header files.
 
 ``LIBXSLT_EXSLT_INCLUDE_DIR``
   .. versionadded:: 3.18
-    The include directory for exslt.
-``LIBXSLT_EXSLT_LIBRARIES``
-  Link to these if you need to link against the exslt library.
+
+  Directory containing ``libexslt/exslt.h`` and other exslt-related headers.
+  These are needed only when using exslt (extensions to XSLT).
+
 ``LIBXSLT_XSLTPROC_EXECUTABLE``
-  Contains the full path to the xsltproc executable if found.
+  Full path to the XSLT processor executable ``xsltproc`` if found.  This path
+  is optional.
+
+Examples
+^^^^^^^^
+
+Finding libxslt library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(LibXslt)
+  target_link_libraries(foo PRIVATE LibXslt::LibXslt)
+
+When project also needs the extensions to XSLT (exslt) library, both targets
+should be linked:
+
+.. code-block:: cmake
+
+  find_package(LibXslt)
+  target_link_libraries(foo PRIVATE LibXslt::LibXslt LibXslt::LibExslt)
+
+Example, how to use XSLT processor in a custom command build rule:
+
+.. code-block:: cmake
+
+  find_package(LibXslt)
+
+  if(TARGET LibXslt::xsltproc)
+    # Executed when some build rule depends on example.html.
+    add_custom_command(
+      OUTPUT example.html
+      COMMAND LibXslt::xsltproc -o example.html transform.xslt example.xml
+    )
+  endif()
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -122,14 +180,14 @@
                  LIBXSLT_EXSLT_LIBRARY
                  LIBXSLT_XSLTPROC_EXECUTABLE)
 
-if(LIBXSLT_FOUND AND NOT TARGET LibXslt::LibXslt)
+if(LibXslt_FOUND AND NOT TARGET LibXslt::LibXslt)
   add_library(LibXslt::LibXslt UNKNOWN IMPORTED)
   set_target_properties(LibXslt::LibXslt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXSLT_INCLUDE_DIR}")
   set_target_properties(LibXslt::LibXslt PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXSLT_DEFINITIONS}")
   set_property(TARGET LibXslt::LibXslt APPEND PROPERTY IMPORTED_LOCATION "${LIBXSLT_LIBRARY}")
 endif()
 
-if(LIBXSLT_FOUND AND NOT TARGET LibXslt::LibExslt)
+if(LibXslt_FOUND AND NOT TARGET LibXslt::LibExslt)
   add_library(LibXslt::LibExslt UNKNOWN IMPORTED)
   set_target_properties(LibXslt::LibExslt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXSLT_EXSLT_INCLUDE_DIR}")
   set_target_properties(LibXslt::LibExslt PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXSLT_EXSLT_DEFINITIONS}")
diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake
index 68208c2..f3e66af 100644
--- a/Modules/FindLibinput.cmake
+++ b/Modules/FindLibinput.cmake
@@ -7,31 +7,46 @@
 
 .. versionadded:: 3.14
 
-Find libinput headers and library.
+Finds the libinput library which handles input devices in Wayland compositors
+and provides a generic X.Org input driver.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
+This module provides the following :ref:`Imported Targets`:
+
 ``Libinput::Libinput``
-  The libinput library, if found.
+  Target encapsulating the libinput library usage requirements, available only
+  if library is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This will define the following variables in your project:
+This module defines the following variables:
 
 ``Libinput_FOUND``
-  true if (the requested version of) libinput is available.
+  Boolean indicating whether the (requested version of) libinput library is
+  found.
 ``Libinput_VERSION``
-  the version of libinput.
+  The version of the libinput found.
 ``Libinput_LIBRARIES``
-  the libraries to link against to use libinput.
+  The libraries to link against to use the libinput library.
 ``Libinput_INCLUDE_DIRS``
-  where to find the libinput headers.
+  The include directories containing headers needed to use the libinput library.
 ``Libinput_COMPILE_OPTIONS``
-  this should be passed to target_compile_options(), if the
-  target is not used for linking
+  Compile options needed to use the libinput library.  These can be passed to
+  the :command:`target_compile_options` command, when not using the
+  ``Libinput::Libinput`` imported target.
 
+Examples
+^^^^^^^^
+
+Finding the libinput library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Libinput)
+  target_link_libraries(project_target PRIVATE Libinput::Libinput)
 #]=======================================================================]
 
 
diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index 396e7d1..50f37f6 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -5,42 +5,79 @@
 FindLua
 -------
 
-Locate Lua library.
+Finds the Lua library.  Lua is a embeddable scripting language.
 
 .. versionadded:: 3.18
   Support for Lua 5.4.
 
-This module defines:
-
-``LUA_FOUND``
-  if false, do not try to link to Lua
-``LUA_LIBRARIES``
-  both lua and lualib
-``LUA_INCLUDE_DIR``
-  where to find lua.h
-``LUA_VERSION_STRING``
-  the version of Lua found
-``LUA_VERSION_MAJOR``
-  the major version of Lua
-``LUA_VERSION_MINOR``
-  the minor version of Lua
-``LUA_VERSION_PATCH``
-  the patch version of Lua
-
-Note that the expected include convention is
+When working with Lua, its library headers are intended to be included in
+project source code as:
 
 .. code-block:: c
 
-  #include "lua.h"
+  #include <lua.h>
 
-and not
+and not:
 
 .. code-block:: c
 
   #include <lua/lua.h>
 
-This is because, the lua location is not standardized and may exist in
-locations other than lua/
+This is because, the location of Lua headers may differ across platforms and may
+exist in locations other than ``lua/``.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Lua_FOUND``
+  Boolean indicating whether (the requested version of) Lua is found.  For
+  backward compatibility, the ``LUA_FOUND`` variable is also set to the same
+  value.
+``LUA_VERSION_STRING``
+  The version of Lua found.
+``LUA_VERSION_MAJOR``
+  The major version of Lua found.
+``LUA_VERSION_MINOR``
+  The minor version of Lua found.
+``LUA_VERSION_PATCH``
+  The patch version of Lua found.
+``LUA_LIBRARIES``
+  Libraries needed to link against to use Lua.  This list includes both ``lua``
+  and ``lualib`` libraries.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LUA_INCLUDE_DIR``
+  The directory containing the Lua header files, such as ``lua.h``,
+  ``lualib.h``, and ``lauxlib.h``, needed to use Lua.
+
+Examples
+^^^^^^^^
+
+Finding the Lua library and creating an interface :ref:`imported target
+<Imported Targets>` that encapsulates its usage requirements for linking to a
+project target:
+
+.. code-block:: cmake
+
+  find_package(Lua)
+
+  if(Lua_FOUND AND NOT TARGET Lua::Lua)
+    add_library(Lua::Lua INTERFACE IMPORTED)
+    set_target_properties(
+      Lua::Lua
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE Lua::Lua)
 #]=======================================================================]
 
 cmake_policy(PUSH)  # Policies apply to functions at definition-time
@@ -231,8 +268,6 @@
 endif ()
 
 include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
-# all listed variables are TRUE
 find_package_handle_standard_args(Lua
                                   REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
                                   VERSION_VAR LUA_VERSION_STRING)
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index e440b98..ac36c86 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -5,19 +5,20 @@
 FindLua50
 ---------
 
-Locate Lua library.
+.. note::
 
-This module defines::
+  This module is specifically for Lua version branch 5.0, which is obsolete and
+  not maintained anymore.  In new code use the latest supported Lua version and
+  the version-agnostic module :module:`FindLua` instead.
 
-  LUA50_FOUND, if false, do not try to link to Lua
-  LUA_LIBRARIES, both lua and lualib
-  LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
+Finds the Lua library.  Lua is a embeddable scripting language.
 
-Note that the expected include convention is:
+When working with Lua, its library headers are intended to be included in
+project source code as:
 
 .. code-block:: c
 
-  #include "lua.h"
+  #include <lua.h>
 
 and not:
 
@@ -25,14 +26,64 @@
 
   #include <lua/lua.h>
 
-This is because, the lua location is not standardized and may exist in
-locations other than lua/
+This is because, the location of Lua headers may differ across platforms and may
+exist in locations other than ``lua/``.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Lua50_FOUND``
+  Boolean indicating whether Lua is found.  For backward compatibility, the
+  ``LUA50_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LUA_INCLUDE_DIR``
+  The directory containing the Lua header files, such as ``lua.h``,
+  ``lualib.h``, and ``lauxlib.h``, needed to use Lua.
+
+``LUA_LIBRARIES``
+  Libraries needed to link against to use Lua.  This list includes both ``lua``
+  and ``lualib`` libraries.
+
+Examples
+^^^^^^^^
+
+Finding the Lua 5.0 library and creating an interface :ref:`imported target
+<Imported Targets>` that encapsulates its usage requirements for linking to a
+project target:
+
+.. code-block:: cmake
+
+  find_package(Lua50)
+
+  if(Lua50_FOUND AND NOT TARGET Lua50::Lua50)
+    add_library(Lua50::Lua50 INTERFACE IMPORTED)
+    set_target_properties(
+      Lua50::Lua50
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE Lua50::Lua50)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindLua` module to find Lua in version-agnostic way.
 #]=======================================================================]
 
 find_path(LUA_INCLUDE_DIR lua.h
   HINTS
     ENV LUA_DIR
-  PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include
+  PATH_SUFFIXES lua50 lua5.0 lua5 lua
   PATHS
   ~/Library/Frameworks
   /Library/Frameworks
@@ -76,10 +127,7 @@
   endif()
 endif()
 
-
 include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
-# all listed variables are TRUE
 find_package_handle_standard_args(Lua50  DEFAULT_MSG  LUA_LIBRARIES LUA_INCLUDE_DIR)
 
 mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES)
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index b6c66f3..cba30e4 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -5,20 +5,20 @@
 FindLua51
 ---------
 
-Locate Lua library.
-This module defines::
+.. note::
 
-  LUA51_FOUND, if false, do not try to link to Lua
-  LUA_LIBRARIES
-  LUA_INCLUDE_DIR, where to find lua.h
-  LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
+  This module is specifically for Lua version branch 5.1, which is obsolete and
+  not maintained anymore.  In new code use the latest supported Lua version and
+  the version-agnostic module :module:`FindLua` instead.
 
+Finds the Lua library.  Lua is a embeddable scripting language.
 
-Note that the expected include convention is:
+When working with Lua, its library headers are intended to be included in
+project source code as:
 
 .. code-block:: c
 
-  #include "lua.h"
+  #include <lua.h>
 
 and not:
 
@@ -26,8 +26,58 @@
 
   #include <lua/lua.h>
 
-This is because, the lua location is not standardized and may exist in
-locations other than lua/
+This is because, the location of Lua headers may differ across platforms and may
+exist in locations other than ``lua/``.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Lua51_FOUND``
+  Boolean indicating whether Lua is found.  For backward compatibility, the
+  ``LUA51_FOUND`` variable is also set to the same value.
+``LUA_VERSION_STRING``
+  The version of Lua found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LUA_INCLUDE_DIR``
+  The directory containing the Lua header files, such as ``lua.h``,
+  ``lualib.h``, and ``lauxlib.h``, needed to use Lua.
+``LUA_LIBRARIES``
+  Libraries needed to link against to use Lua.
+
+Examples
+^^^^^^^^
+
+Finding the Lua 5.1 library and creating an interface :ref:`imported target
+<Imported Targets>` that encapsulates its usage requirements for linking to a
+project target:
+
+.. code-block:: cmake
+
+  find_package(Lua51)
+
+  if(Lua51_FOUND AND NOT TARGET Lua51::Lua51)
+    add_library(Lua51::Lua51 INTERFACE IMPORTED)
+    set_target_properties(
+      Lua51::Lua51
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE Lua51::Lua51)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindLua` module to find Lua in version-agnostic way.
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -36,7 +86,7 @@
 find_path(LUA_INCLUDE_DIR lua.h
   HINTS
     ENV LUA_DIR
-  PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include
+  PATH_SUFFIXES lua51 lua5.1 lua-5.1 lua
   PATHS
   ~/Library/Frameworks
   /Library/Frameworks
@@ -73,8 +123,6 @@
 endif()
 
 include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
-# all listed variables are TRUE
 find_package_handle_standard_args(Lua51
                                   REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
                                   VERSION_VAR LUA_VERSION_STRING)
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index f34c328..27c5458 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -5,16 +5,45 @@
 FindMFC
 -------
 
-Find Microsoft Foundation Class Library (MFC) on Windows
+Finds the native Microsoft Foundation Class Library (MFC) for developing MFC
+applications on Windows.
 
-Find the native MFC - i.e.  decide if an application can link to the
-MFC libraries.
+.. note::
 
-::
+  MFC is an optional component in Visual Studio and must be installed
+  separately for this module to succeed.
 
-  MFC_FOUND - Was MFC support found
+Once the MFC libraries and headers are found, no additional manual linking is
+needed, as they are part of the development environment.
 
-You don't need to include anything or link anything to use it.
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``MFC_FOUND``
+  Boolean indicating whether MFC support is found.
+
+Examples
+^^^^^^^^
+
+Using this module to check if the application can link to the MFC libraries:
+
+.. code-block:: cmake
+
+  find_package(MFC)
+
+  if(MFC_FOUND)
+    # Example logic when MFC is available...
+    set(CMAKE_MFC_FLAG 2)
+    add_executable(app WIN32 main.cpp)
+    target_compile_definitions(app PRIVATE _AFXDLL)
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :variable:`CMAKE_MFC_FLAG` variable.
 #]=======================================================================]
 
 # Assume no MFC support
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index 26f8be4..6c49702 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -5,22 +5,63 @@
 FindMPEG
 --------
 
-Find the native MPEG includes and library
+Finds the native MPEG library (libmpeg2).
 
-This module defines
+.. note::
 
-::
+  This module is functionally identical to the :module:`FindMPEG2` module, which
+  also finds the libmpeg2 library.  Both modules were introduced in the past to
+  provide flexibility in handling potential differences in future versions of
+  the MPEG library and to maintain backward compatibility across CMake releases.
 
-  MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
-  MPEG_LIBRARIES, the libraries required to use MPEG.
-  MPEG_FOUND, If false, do not try to use MPEG.
+  The ``FindMPEG2`` module additionally checks for the SDL dependency and
+  includes it in its usage requirements.  For working with libmpeg2, it is
+  recommended to use the :module:`FindMPEG2` module instead of this one.
 
-also defined, but not for general use are
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  MPEG_mpeg2_LIBRARY, where to find the MPEG library.
-  MPEG_vo_LIBRARY, where to find the vo library.
+``MPEG_FOUND``
+  Boolean indicating whether the libmpeg2 library is found.
+``MPEG_LIBRARIES``
+  Libraries needed to link against to use libmpeg2.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may be also set:
+
+``MPEG_INCLUDE_DIR``
+  The directory containing the ``mpeg2.h`` and related headers needed to use
+  libmpeg2 library.
+``MPEG_mpeg2_LIBRARY``
+  The path to the libmpeg2 library.
+``MPEG_vo_LIBRARY``
+  The path to the vo (Video Out) library.
+
+Examples
+^^^^^^^^
+
+Finding libmpeg2 library and creating an imported interface target for linking
+it to a project target:
+
+.. code-block:: cmake
+
+  find_package(MPEG)
+
+  if(MPEG_FOUND AND NOT TARGET MPEG::MPEG)
+    add_library(MPEG::MPEG INTERFACE IMPORTED)
+    set_target_properties(
+      MPEG::MPEG
+      PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${MPEG_LIBRARIES}"
+        INTERFACE_INCLUDE_DIRECTORIES "${MPEG_INCLUDE_DIR}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE MPEG::MPEG)
 #]=======================================================================]
 
 find_path(MPEG_INCLUDE_DIR
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index 66a0ed0..103f2c4 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -5,22 +5,58 @@
 FindMPEG2
 ---------
 
-Find the native MPEG2 includes and library
+Finds the native MPEG2 library (libmpeg2).
 
-This module defines
+.. note::
 
-::
+  Depending on how the native libmpeg2 library is built and installed, it may
+  depend on the SDL (Simple DirectMedia Layer) library.  If SDL is found, this
+  module includes it in its usage requirements when used.
 
-  MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
-  MPEG2_LIBRARIES, the libraries required to use MPEG2.
-  MPEG2_FOUND, If false, do not try to use MPEG2.
+Result Variables
+^^^^^^^^^^^^^^^^
 
-also defined, but not for general use are
+This module defines the following variables:
 
-::
+``MPEG2_FOUND``
+  Boolean indicating whether the libmpeg2 library is found.
+``MPEG2_LIBRARIES``
+  Libraries needed to link against to use libmpeg2.
 
-  MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
-  MPEG2_vo_LIBRARY, where to find the vo library.
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may be also set:
+
+``MPEG2_INCLUDE_DIR``
+  The directory containing the ``mpeg2.h`` and related headers needed to use
+  libmpeg2 library.
+``MPEG2_mpeg2_LIBRARY``
+  The path to the libmpeg2 library.
+``MPEG2_vo_LIBRARY``
+  The path to the vo (Video Out) library.
+
+Examples
+^^^^^^^^
+
+Finding libmpeg2 library and creating an imported interface target for linking
+it to a project target:
+
+.. code-block:: cmake
+
+  find_package(MPEG2)
+
+  if(MPEG2_FOUND AND NOT TARGET MPEG2::MPEG2)
+    add_library(MPEG2::MPEG2 INTERFACE IMPORTED)
+    set_target_properties(
+      MPEG2::MPEG2
+      PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${MPEG2_LIBRARIES}"
+        INTERFACE_INCLUDE_DIRECTORIES "${MPEG2_INCLUDE_DIR}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE MPEG2::MPEG2)
 #]=======================================================================]
 
 find_path(MPEG2_INCLUDE_DIR
@@ -39,8 +75,7 @@
     list(APPEND MPEG2_LIBRARIES ${MPEG2_vo_LIBRARY})
   endif()
 
-  #some native mpeg2 installations will depend
-  #on libSDL, if found, add it in.
+  # Some native mpeg2 installations will depend on libSDL. If found, add it in.
   find_package(SDL)
   if(SDL_FOUND)
     set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index c6a25a7..78b1c5c 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -536,7 +536,7 @@
     # It has to be called as "compchk.sh <arch> <compiler>". Here, <arch> is one out of 32 (i686), 64 (ia64) or 32e (x86_64).
     # The compiler is identified by filename, and can be either the MPI compiler or the underlying compiler.
     # NOTE: It is vital to run this script while the environment variables are set up, otherwise it can check the wrong compiler.
-    if(MPI_COMPILE_CMDLINE MATCHES "^([^\" ]+/compchk.sh|\"[^\"]+/compchk.sh\") +([^ ]+)")
+    if(MPI_COMPILE_CMDLINE MATCHES "^([^\"\n ]+/compchk.sh|\"[^\"]+/compchk.sh\") +([^ ]+)")
       # Now CMAKE_MATCH_1 contains the path to the compchk.sh file and CMAKE_MATCH_2 the architecture flag.
       unset(COMPILER_CHECKER_OUTPUT)
       execute_process(
@@ -551,7 +551,7 @@
         endif()
       else()
         # Since the check passed, we can remove the compchk.sh script.
-        string(REGEX REPLACE "^([^\" ]+|\"[^\"]+\")/compchk.sh.*\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
+        string(REGEX REPLACE "^([^\"\n ]+|\"[^\"]+\")/compchk.sh.*\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
       endif()
     endif()
   endif()
@@ -624,10 +624,10 @@
       # Especially with M(VA)PICH-1, this appears to happen erroneously, and therefore we should translate
       # this output into an additional include directory and then drop it from the output.
       # noqa: spellcheck on
-      if(MPI_COMPILE_CMDLINE MATCHES "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h")
+      if(MPI_COMPILE_CMDLINE MATCHES "^ln -s ([^\"\n ]+|\"[^\"]+\") mpif.h")
         get_filename_component(MPI_INCLUDE_DIRS_WORK "${CMAKE_MATCH_1}" DIRECTORY)
-        string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
-        string(REGEX REPLACE "^ln -s ([^\" ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}")
+        string(REGEX REPLACE "^ln -s ([^\"\n ]+|\"[^\"]+\") mpif.h\n" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
+        string(REGEX REPLACE "^ln -s ([^\"\n ]+|\"[^\"]+\") mpif.h\n" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}")
         string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_COMPILE_CMDLINE "${MPI_COMPILE_CMDLINE}")
         string(REGEX REPLACE "\nrm -f mpif.h$" "" MPI_LINK_CMDLINE "${MPI_LINK_CMDLINE}")
       endif()
@@ -645,7 +645,7 @@
   # on Windows seems to require any specific ones, either.
   if(NOT MSVC)
     # Extract compile options from the compile command line.
-    string(REGEX MATCHALL "(^| )-f([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}")
+    string(REGEX MATCHALL "(^| )-f([^\"\n ]+|\"[^\"]+\")" MPI_ALL_COMPILE_OPTIONS "${MPI_COMPILE_CMDLINE}")
 
     foreach(_MPI_COMPILE_OPTION IN LISTS MPI_ALL_COMPILE_OPTIONS)
       string(REGEX REPLACE "^ " "" _MPI_COMPILE_OPTION "${_MPI_COMPILE_OPTION}")
@@ -673,7 +673,7 @@
   endif()
 
   # Same deal as above, for the definitions.
-  string(REGEX MATCHALL "(^| )${_MPI_PREPROCESSOR_FLAG_REGEX}-D *([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}")
+  string(REGEX MATCHALL "(^| )${_MPI_PREPROCESSOR_FLAG_REGEX}-D *([^\"\n ]+|\"[^\"]+\")" MPI_ALL_COMPILE_DEFINITIONS "${MPI_COMPILE_CMDLINE}")
 
   foreach(_MPI_COMPILE_DEFINITION IN LISTS MPI_ALL_COMPILE_DEFINITIONS)
     string(REGEX REPLACE "^ ?${_MPI_PREPROCESSOR_FLAG_REGEX}-D *" "" _MPI_COMPILE_DEFINITION "${_MPI_COMPILE_DEFINITION}")
@@ -684,7 +684,7 @@
   endforeach()
 
   # Extract include paths from compile command line
-  string(REGEX MATCHALL "(^|\n| )${_MPI_PREPROCESSOR_FLAG_REGEX}${CMAKE_INCLUDE_FLAG_${LANG}} *([^\" ]+|\"[^\"]+\")"
+  string(REGEX MATCHALL "(^|\n| )${_MPI_PREPROCESSOR_FLAG_REGEX}${CMAKE_INCLUDE_FLAG_${LANG}} *([^\"\n ]+|\"[^\"]+\")"
     MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
 
   # If extracting failed to work, we'll try using -showme:incdirs.
@@ -707,7 +707,7 @@
   endforeach()
 
   # The next step are linker flags and library directories. Here, we first take the flags given in raw -L or -LIBPATH: syntax.
-  string(REGEX MATCHALL "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\" ]+|\"[^\"]+\")" MPI_DIRECT_LINK_PATHS "${MPI_LINK_CMDLINE}")
+  string(REGEX MATCHALL "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\"\n ]+|\"[^\"]+\")" MPI_DIRECT_LINK_PATHS "${MPI_LINK_CMDLINE}")
   foreach(_MPI_LPATH IN LISTS MPI_DIRECT_LINK_PATHS)
     string(REGEX REPLACE "(^| )${CMAKE_LIBRARY_PATH_FLAG} *" "" _MPI_LPATH "${_MPI_LPATH}")
     list(APPEND MPI_ALL_LINK_PATHS "${_MPI_LPATH}")
@@ -715,7 +715,7 @@
 
   # If the link commandline hasn't been filtered (e.g. when using MSVC and /link), we need to extract the relevant parts first.
   if(NOT _MPI_FILTERED_LINK_INFORMATION)
-    string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\" ]+|\"[^\"]+\")" MPI_LINK_FLAGS "${MPI_LINK_CMDLINE}")
+    string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\"\n ]+|\"[^\"]+\")" MPI_LINK_FLAGS "${MPI_LINK_CMDLINE}")
 
     # In this case, we could also find some indirectly given linker paths, e.g. prefixed by -Xlinker or -Wl,
     # Since syntaxes like -Wl,-L -Wl,/my/path/to/lib are also valid, we parse these paths by first removing -Wl, and -Xlinker
@@ -724,7 +724,7 @@
 
     # Now we can parse the leftover output. Note that spaces can now be handled since the above example would reduce to
     # -L /my/path/to/lib and can be extracted correctly.
-    string(REGEX MATCHALL "^(${CMAKE_LIBRARY_PATH_FLAG},? *|--library-path=)([^\" ]+|\"[^\"]+\")"
+    string(REGEX MATCHALL "^(${CMAKE_LIBRARY_PATH_FLAG},? *|--library-path=)([^\"\n ]+|\"[^\"]+\")"
       MPI_INDIRECT_LINK_PATHS "${MPI_LINK_FLAGS_RAW}")
 
     foreach(_MPI_LPATH IN LISTS MPI_INDIRECT_LINK_PATHS)
@@ -733,7 +733,7 @@
     endforeach()
 
     # We need to remove the flags we extracted from the linker flag list now.
-    string(REGEX REPLACE "(^| )(-Wl,|-Xlinker +)(${CMAKE_LIBRARY_PATH_FLAG},? *(-Wl,|-Xlinker +)?|--library-path=)([^\" ]+|\"[^\"]+\")" ""
+    string(REGEX REPLACE "(^| )(-Wl,|-Xlinker +)(${CMAKE_LIBRARY_PATH_FLAG},? *(-Wl,|-Xlinker +)?|--library-path=)([^\"\n ]+|\"[^\"]+\")" ""
       MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE}")
 
     # Some MPI implementations pass on options they themselves were built with. Since -z,noexecstack is a common
@@ -742,7 +742,7 @@
     string(REGEX REPLACE "(^| )-Xlinker +-z +-Xlinker +[^ ]+" "" MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE_FILTERED}")
 
     # We only consider options of the form -Wl or -Xlinker:
-    string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE_FILTERED}")
+    string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker +)([^\"\n ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE_FILTERED}")
 
     # As a next step, we assemble the linker flags extracted in a preliminary flags string
     foreach(_MPI_LINK_FLAG IN LISTS MPI_ALL_LINK_FLAGS)
@@ -755,7 +755,7 @@
     endforeach()
   else()
     # In the filtered case, we obtain the link time flags by just stripping the library paths.
-    string(REGEX REPLACE "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\" ]+|\"[^\"]+\")" "" MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE}")
+    string(REGEX REPLACE "(^| )${CMAKE_LIBRARY_PATH_FLAG} *([^\"\n ]+|\"[^\"]+\")" "" MPI_LINK_CMDLINE_FILTERED "${MPI_LINK_CMDLINE}")
   endif()
 
   # If we failed to extract any linker paths, we'll try using the -showme:libdirs option with the MPI compiler.
@@ -777,7 +777,7 @@
   # Extract the set of libraries to link against from the link command line
   # This only makes sense if CMAKE_LINK_LIBRARY_FLAG is defined, i.e. a -lxxxx syntax is supported by the compiler.
   if(CMAKE_LINK_LIBRARY_FLAG)
-    string(REGEX MATCHALL "(^| )${CMAKE_LINK_LIBRARY_FLAG}([^\" ]+|\"[^\"]+\")"
+    string(REGEX MATCHALL "(^| )${CMAKE_LINK_LIBRARY_FLAG}([^\"\n ]+|\"[^\"]+\")"
       MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
 
     foreach(_MPI_LIB_NAME IN LISTS MPI_LIBNAMES)
@@ -800,7 +800,7 @@
   else()
     string(APPEND _MPI_LIB_SUFFIX_REGEX "|${CMAKE_SHARED_LIBRARY_SUFFIX}")
   endif()
-  set(_MPI_LIB_NAME_REGEX "(([^\" ]+(${_MPI_LIB_SUFFIX_REGEX}))|(\"[^\"]+(${_MPI_LIB_SUFFIX_REGEX})\"))( +|$)")
+  set(_MPI_LIB_NAME_REGEX "(([^\"\n ]+(${_MPI_LIB_SUFFIX_REGEX}))|(\"[^\"]+(${_MPI_LIB_SUFFIX_REGEX})\"))( +|$)")
   string(REPLACE "." "\\." _MPI_LIB_NAME_REGEX "${_MPI_LIB_NAME_REGEX}")
 
   string(REGEX MATCHALL "${_MPI_LIB_NAME_REGEX}" MPI_LIBNAMES "${MPI_LINK_CMDLINE}")
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index d7927a4..8a7bd80 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -323,6 +323,7 @@
 endif()
 
 set(MATLAB_VERSIONS_MAPPING
+  "R2025a=25.1"
   "R2024b=24.2"
   "R2024a=24.1"
   "R2023b=23.2"
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index 44edfcd..d72b193 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -5,19 +5,37 @@
 FindMotif
 ---------
 
-Try to find Motif (or lesstif)
+Finds Motif (or LessTif) graphical user interface toolkit.
 
-Once done this will define:
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  MOTIF_FOUND        - system has MOTIF
-  MOTIF_INCLUDE_DIR  - include paths to use Motif
-  MOTIF_LIBRARIES    - Link these to use Motif
+``Motif_FOUND``
+  Boolean indicating whether the Motif was found.  For backward compatibility,
+  the ``MOTIF_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``MOTIF_LIBRARIES``
+  Libraries needed to link to Motif.
+``MOTIF_INCLUDE_DIR``
+  Include directories needed to use Motif.
+
+Examples
+^^^^^^^^
+
+Finding Motif:
+
+.. code-block:: cmake
+
+  find_package(Motif)
 #]=======================================================================]
 
-set(MOTIF_FOUND 0)
-
 if(UNIX)
   find_path(MOTIF_INCLUDE_DIR
     Xm/Xm.h
diff --git a/Modules/FindMsys.cmake b/Modules/FindMsys.cmake
index 58155ba..0d78c9b 100644
--- a/Modules/FindMsys.cmake
+++ b/Modules/FindMsys.cmake
@@ -7,8 +7,43 @@
 
 .. versionadded:: 3.21
 
-Find MSYS, a POSIX-compatible environment that runs natively
-on Microsoft Windows
+Finds MSYS, a POSIX-compatible environment that runs natively on Microsoft
+Windows.
+
+.. note::
+
+  This module is primarily intended for use in other :ref:`Find Modules` to help
+  locate programs when using the ``find_*()`` commands, such as
+  :command:`find_program`.  In most cases, direct use of those commands is
+  sufficient.  Use this module only if a specific program is known to be
+  installed via MSYS and is usable from Windows.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``MSYS_INSTALL_PATH``
+  The path to the MSYS root installation directory.
+
+Examples
+^^^^^^^^
+
+Finding the MSYS installation and using its path in a custom find module:
+
+.. code-block:: cmake
+  :caption: FindFoo.cmake
+
+  find_package(Msys)
+  find_program(Foo_EXECUTABLE NAMES foo PATHS ${MSYS_INSTALL_PATH}/usr/bin)
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(Foo REQUIRED_VARS Foo_EXECUTABLE)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindCygwin` module to find Cygwin path in a similar way.
 #]=======================================================================]
 
 if (WIN32)
diff --git a/Modules/FindODBC.cmake b/Modules/FindODBC.cmake
index 982a005..6e103d2 100644
--- a/Modules/FindODBC.cmake
+++ b/Modules/FindODBC.cmake
@@ -7,83 +7,123 @@
 
 .. versionadded:: 3.12
 
-Find an Open Database Connectivity (ODBC) include directory and library.
+Finds the Open Database Connectivity (ODBC) library, which implements a standard
+API for accessing database systems.  ODBC enables applications to communicate
+with different database management systems (DBMS) using a common set of
+functions.  Communication with a specific database is handled through ODBC
+drivers, which the library loads at runtime.
 
 On Windows, when building with Visual Studio, this module assumes the ODBC
 library is provided by the available Windows SDK.
 
-On Unix, this module allows to search for ODBC library provided by
-unixODBC or iODBC implementations of ODBC API.
-This module reads hint about location of the config program:
-
-.. variable:: ODBC_CONFIG
-
-  Location of odbc_config or iodbc-config program
-
-Otherwise, this module tries to find the config program,
-first from unixODBC, then from iODBC.
-If no config program found, this module searches for ODBC header
-and library in list of known locations.
+On Unix-like systems, this module searches for ODBC library provided by unixODBC
+or iODBC implementations of ODBC API.  By default, this module looks for the
+ODBC config program to determine the ODBC library and include directory, first
+from unixODBC, then from iODBC.  If no config program is found, it searches for
+ODBC header and library in standard locations.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
-.. variable:: ODBC::ODBC
+``ODBC::ODBC``
+  Target encapsulating the ODBC usage requirements, available if ODBC is found.
 
-  Imported target for using the ODBC library, if found.
-
-Result variables
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-.. variable:: ODBC_FOUND
+This module defines the following variables:
 
-  Set to true if ODBC library found, otherwise false or undefined.
+``ODBC_FOUND``
+  Boolean indicating whether ODBC is found.
 
-.. variable:: ODBC_INCLUDE_DIRS
+``ODBC_INCLUDE_DIRS``
+  Include directories containing headers needed to use ODBC.
 
-  Paths to include directories listed in one variable for use by ODBC client.
-  May be empty on Windows, where the include directory corresponding to the
-  expected Windows SDK is already available in the compilation environment.
+``ODBC_LIBRARIES``
+  Libraries needed to link against to use ODBC.
 
-.. variable:: ODBC_LIBRARIES
-
-  Paths to libraries to linked against to use ODBC.
-  May just a library name on Windows, where the library directory corresponding
-  to the expected Windows SDK is already available in the compilation environment.
-
-.. variable:: ODBC_CONFIG
-
-  Path to unixODBC or iODBC config program, if found or specified.
-
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
-For users who wish to edit and control the module behavior, this module
-reads hints about search locations from the following variables:
+The following cache variables may also be set:
 
-.. variable:: ODBC_INCLUDE_DIR
+``ODBC_INCLUDE_DIR``
+  The path to the directory containing ``sql.h`` and other ODBC headers.  May be
+  empty on Windows, where the include directory corresponding to the expected
+  Windows SDK is already available in the compilation environment.
 
-  Path to ODBC include directory with ``sql.h`` header.
+``ODBC_LIBRARY``
+  The path to the ODBC library or a library name.  On Windows, this may be only
+  a library name, because the library directory corresponding to the expected
+  Windows SDK is already available in the compilation environment.
 
-.. variable:: ODBC_LIBRARY
-
-  Path to ODBC library to be linked.
-
-These variables should not be used directly by project code.
+``ODBC_CONFIG``
+  The path to the ODBC config program if found or specified.  For example,
+  ``odbc_config`` for unixODBC, or ``iodbc-config`` for iODBC.
 
 Limitations
 ^^^^^^^^^^^
 
-On Windows, this module does not search for iODBC.
-On Unix, there is no way to prefer unixODBC over iODBC, or vice versa,
-other than providing the config program location using the ``ODBC_CONFIG``.
-This module does not allow to search for a specific ODBC driver.
+* On Windows, this module does not search for iODBC.
+* On Unix-like systems, there is no built-in mechanism to prefer unixODBC over
+  iODBC, or vice versa.  To bypass this limitation, explicitly set the
+  ``ODBC_CONFIG`` variable to the path of the desired ODBC config program.
+* This module does not support searching for or selecting a specific ODBC
+  driver.
 
+Examples
+^^^^^^^^
+
+Finding and using ODBC
+""""""""""""""""""""""
+
+Finding ODBC and linking it to a project target:
+
+.. code-block:: cmake
+  :caption: CMakeLists.txt
+
+  find_package(ODBC)
+  target_link_libraries(project_target PRIVATE ODBC::ODBC)
+
+Finding a custom ODBC installation on Unix-like systems
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The following examples are for Unix-like systems and demonstrate how to set hint
+and cache variables during the CMake configuration phase to help this module
+find a custom ODBC implementation (e.g. one not supported by default).
+
+To specify the installation prefix using :variable:`CMAKE_PREFIX_PATH`:
+
+.. code-block:: console
+
+  $ cmake -D CMAKE_PREFIX_PATH=/path/to/odbc-installation -B build
+
+Or using the dedicated :variable:`ODBC_ROOT <<PackageName>_ROOT>` variable:
+
+.. code-block:: console
+
+  $ cmake -D ODBC_ROOT=/path/to/odbc-installation -B build
+
+To manually specify the ODBC config program, if available, so that the ODBC
+installation can be automatically determined based on the config tool:
+
+.. code-block:: console
+
+  $ cmake -D ODBC_CONFIG=/path/to/odbc/bin/odbc-config -B build
+
+To manually specify the ODBC library and include directory:
+
+.. code-block:: console
+
+  $ cmake \
+      -D ODBC_LIBRARY=/path/to/odbc/lib/libodbc.so \
+      -D ODBC_INCLUDE_DIR=/path/to/odbc/include \
+      -B build
 #]=======================================================================]
 
-# Define lists used internally
+# Define internal variables
 set(_odbc_include_paths)
 set(_odbc_lib_paths)
 set(_odbc_lib_names)
@@ -175,7 +215,7 @@
   foreach(_lib IN LISTS _odbc_required_libs_names)
     find_library(_lib_path
       NAMES ${_lib}
-      PATHS ${_odbc_lib_paths} # system parths or collected from ODBC_CONFIG
+      PATHS ${_odbc_lib_paths} # system paths or collected from ODBC_CONFIG
       PATH_SUFFIXES odbc)
     if(_lib_path)
       list(APPEND _odbc_required_libs_paths ${_lib_path})
@@ -184,7 +224,7 @@
   endforeach()
 endif()
 
-# Unset internal lists as no longer used
+# Unset internal variables as no longer used
 unset(_odbc_include_paths)
 unset(_odbc_lib_paths)
 unset(_odbc_lib_names)
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index 0466b9c..dad9ada 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -5,53 +5,79 @@
 FindOpenAL
 ----------
 
-Finds Open Audio Library (OpenAL).
+Finds the Open Audio Library (OpenAL).
 
-Projects using this module should use ``#include "al.h"`` to include the OpenAL
-header file, **not** ``#include <AL/al.h>``.  The reason for this is that the
-latter is not entirely portable.  Windows/Creative Labs does not by default put
-their headers in ``AL/`` and macOS uses the convention ``<OpenAL/al.h>``.
+OpenAL is a cross-platform 3D audio API designed for efficient rendering of
+multichannel three-dimensional positional audio.  It is commonly used in games
+and multimedia applications to provide immersive and spatialized sound.
 
-Hints
-^^^^^
-
-Environment variable ``$OPENALDIR`` can be used to set the prefix of OpenAL
-installation to be found.
-
-By default on macOS, system framework is search first.  In other words,
-OpenAL is searched in the following order:
-
-1. System framework: ``/System/Library/Frameworks``, whose priority can be
-   changed via setting the :variable:`CMAKE_FIND_FRAMEWORK` variable.
-2. Environment variable ``$OPENALDIR``.
-3. System paths.
-4. User-compiled framework: ``~/Library/Frameworks``.
-5. Manually compiled framework: ``/Library/Frameworks``.
-6. Add-on package: ``/opt``.
+Projects using this module should include the OpenAL header file using
+``#include <al.h>``, and **not** ``#include <AL/al.h>``.  The reason for this is
+that the latter is not portable.  For example, Windows/Creative Labs does not by
+default put OpenAL headers in ``AL/`` and macOS uses the convention of
+``<OpenAL/al.h>``.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.25
-
-This module defines the :prop_tgt:`IMPORTED` target:
+This module provides the following :ref:`Imported Targets`:
 
 ``OpenAL::OpenAL``
-  The OpenAL library, if found.
+  .. versionadded:: 3.25
+
+  Target encapsulating the OpenAL library usage requirements, available only if
+  the OpenAL library is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``OPENAL_FOUND``
-  If false, do not try to link to OpenAL
-``OPENAL_INCLUDE_DIR``
-  OpenAL include directory
-``OPENAL_LIBRARY``
-  Path to the OpenAL library
+``OpenAL_FOUND``
+  Boolean indicating whether the OpenAL is found.  For backward compatibility,
+  the ``OPENAL_FOUND`` variable is also set to the same value.
 ``OPENAL_VERSION_STRING``
-  Human-readable string containing the version of OpenAL
+  Human-readable string containing the version of OpenAL found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OPENAL_INCLUDE_DIR``
+  The include directory containing headers needed to use the OpenAL library.
+``OPENAL_LIBRARY``
+  The path to the OpenAL library.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``OPENALDIR``
+  Environment variable which can be used to set the installation prefix of
+  OpenAL to be found in non-standard locations.
+
+  OpenAL is searched in the following order:
+
+  1. By default on macOS, system framework is searched first:
+     ``/System/Library/Frameworks``, whose priority can be changed by setting
+     the :variable:`CMAKE_FIND_FRAMEWORK` variable.
+  2. Environment variable ``ENV{OPENALDIR}``.
+  3. System paths.
+  4. User-compiled framework: ``~/Library/Frameworks``.
+  5. Manually compiled framework: ``/Library/Frameworks``.
+  6. Add-on package: ``/opt``.
+
+Examples
+^^^^^^^^
+
+Finding the OpenAL library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(OpenAL)
+  target_link_libraries(project_target PRIVATE OpenAL::OpenAL)
 #]=======================================================================]
 
 # For Windows, Creative Labs seems to have added a registry key for their
@@ -105,7 +131,7 @@
 
 mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
 
-if(OPENAL_FOUND AND NOT TARGET OpenAL::OpenAL)
+if(OpenAL_FOUND AND NOT TARGET OpenAL::OpenAL)
   add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
   set_target_properties(OpenAL::OpenAL PROPERTIES
     IMPORTED_LOCATION "${OPENAL_LIBRARY}")
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index e896e97..3be945b 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -7,7 +7,7 @@
 
 .. versionadded:: 3.1
 
-Finds Open Computing Language (OpenCL)
+Finds Open Computing Language (OpenCL).
 
 .. versionadded:: 3.10
   Detection of OpenCL 2.1 and 2.2.
@@ -17,26 +17,49 @@
 
 .. versionadded:: 3.7
 
-This module defines :prop_tgt:`IMPORTED` target ``OpenCL::OpenCL``, if
-OpenCL has been found.
+This module provides the following :ref:`Imported Targets`, if OpenCL has been
+found:
+
+``OpenCL::OpenCL``
+  Target providing OpenCL usage requirements.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module defines the following variables::
+This module defines the following variables:
 
-  OpenCL_FOUND          - True if OpenCL was found
-  OpenCL_INCLUDE_DIRS   - include directories for OpenCL
-  OpenCL_LIBRARIES      - link against this library to use OpenCL
-  OpenCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
-  OpenCL_VERSION_MAJOR  - The major version of the OpenCL implementation
-  OpenCL_VERSION_MINOR  - The minor version of the OpenCL implementation
+``OpenCL_FOUND``
+  True if OpenCL was found.
+``OpenCL_INCLUDE_DIRS``
+  Include directories needed to use OpenCL.
+``OpenCL_LIBRARIES``
+  Libraries needed to link to OpenCL.
+``OpenCL_VERSION_STRING``
+  Highest supported OpenCL version (e.g., ``1.2``).
+``OpenCL_VERSION_MAJOR``
+  The major version of the OpenCL implementation.
+``OpenCL_VERSION_MINOR``
+  The minor version of the OpenCL implementation.
 
-The module will also define two cache variables::
+Cache Variables
+^^^^^^^^^^^^^^^
 
-  OpenCL_INCLUDE_DIR    - the OpenCL include directory
-  OpenCL_LIBRARY        - the path to the OpenCL library
+The following cache variables may also be set:
 
+``OpenCL_INCLUDE_DIR``
+  The OpenCL include directory.
+``OpenCL_LIBRARY``
+  The path to the OpenCL library.
+
+Examples
+^^^^^^^^
+
+Finding OpenCL and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(OpenCL)
+  target_link_libraries(project_target PRIVATE OpenCL::OpenCL)
 #]=======================================================================]
 
 set(_OPENCL_x86 "(x86)")
@@ -53,12 +76,12 @@
     if(EXISTS ${OpenCL_INCLUDE_DIR}/Headers/cl.h)
       check_symbol_exists(
         CL_VERSION_${VERSION}
-        "${OpenCL_INCLUDE_DIR}/Headers/cl.h"
+        "Headers/cl.h"
         OPENCL_VERSION_${VERSION})
     else()
       check_symbol_exists(
         CL_VERSION_${VERSION}
-        "${OpenCL_INCLUDE_DIR}/CL/cl.h"
+        "CL/cl.h"
         OPENCL_VERSION_${VERSION})
     endif()
 
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index 99c6765..c1141c7 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -152,6 +152,7 @@
     set(OMP_FLAG_XL "-qsmp=omp")
     # Cray compiler activate OpenMP with -h omp, which is enabled by default.
     set(OMP_FLAG_Cray " " "-h omp")
+    set(OMP_FLAG_CrayClang "-fopenmp")
     set(OMP_FLAG_Fujitsu "-Kopenmp" "-KOMP")
     set(OMP_FLAG_FujitsuClang "-fopenmp" "-Kopenmp")
 
@@ -677,7 +678,8 @@
         set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
           INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:SHELL:${OpenMP_${LANG}_FLAGS}>")
         if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu"
-          OR ${CMAKE_${LANG}_COMPILER_ID} STREQUAL "IntelLLVM")
+          OR ${CMAKE_${LANG}_COMPILER_ID} STREQUAL "IntelLLVM"
+          OR CMAKE_${LANG}_COMPILER_ID MATCHES "^(Cray|CrayClang)$")
           set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY
             INTERFACE_LINK_OPTIONS "SHELL:${OpenMP_${LANG}_FLAGS}")
         endif()
diff --git a/Modules/FindOpenSP.cmake b/Modules/FindOpenSP.cmake
index 605c294..3ff6a99 100644
--- a/Modules/FindOpenSP.cmake
+++ b/Modules/FindOpenSP.cmake
@@ -7,60 +7,73 @@
 
 .. versionadded:: 3.25
 
-Try to find the OpenSP library.
-
-Result Variables
-^^^^^^^^^^^^^^^^
-
-This will define the following variables:
-
-``OpenSP_FOUND``
-  True if (the requested version of) ``OpenSP`` is available
-
-``OpenSP_VERSION``
-  The version of ``OpenSP``
-
-``OpenSP_VERSION_MAJOR``
-  The major version of ``OpenSP``
-
-``OpenSP_VERSION_MINOR``
-  The minor version of ``OpenSP``
-
-``OpenSP_VERSION_PATCH``
-  The patch version of ``OpenSP``
-
-``OpenSP_INCLUDE_DIRS``
-  The include dirs of ``OpenSP`` with its headers
-
-``OpenSP_LIBRARIES``
-  The OpenSP library for use with target_link_libraries().
-  This can be passed to target_link_libraries() instead of
-  the :prop_tgt:`IMPORTED` ``OpenSP::OpenSP`` target
-
-``OpenSP_MULTI_BYTE``
-  True if ``SP_MULTI_BYTE`` was found to be defined in OpenSP's ``config.h``
-  header file, which indicates that the ``OpenSP`` library was compiled with
-  support for multi-byte characters. The consuming target needs to define the
-  ``SP_MULTI_BYTE`` to match this value in order to avoid issues with character
-  decoding.
+Finds the OpenSP library.  OpenSP is an open-source implementation of the SGML
+(Standard Generalized Markup Language) parser.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module defines the :prop_tgt:`IMPORTED` target ``OpenSP::OpenSP``, if
-OpenSP has been found.
+This module provides the following :ref:`Imported Targets`:
 
-Cache variables
+``OpenSP::OpenSP``
+  Target encapsulating the OpenSP library usage requirements, available only if
+  the OpenSP is found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``OpenSP_FOUND``
+  Boolean indicating whether the (requested version of) OpenSP is available.
+
+``OpenSP_VERSION``
+  The version of found OpenSP.
+
+``OpenSP_VERSION_MAJOR``
+  The major version of OpenSP.
+
+``OpenSP_VERSION_MINOR``
+  The minor version of OpenSP.
+
+``OpenSP_VERSION_PATCH``
+  The patch version of OpenSP.
+
+``OpenSP_INCLUDE_DIRS``
+  The include directories containing headers needed to use the OpenSP library.
+
+``OpenSP_LIBRARIES``
+  Libraries required to link against to use OpenSP.  These can be passed to the
+  :command:`target_link_libraries` command when not using the ``OpenSP::OpenSP``
+  imported target.
+
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``OpenSP_INCLUDE_DIR``
-  the OpenSP include directory
+  The OpenSP include directory.
 
 ``OpenSP_LIBRARY``
-  the absolute path of the osp library
+  The absolute path of the ``osp`` library.
 
+``OpenSP_MULTI_BYTE``
+  True if ``SP_MULTI_BYTE`` was found to be defined in OpenSP's ``config.h``
+  header file, which indicates that the OpenSP library was compiled with support
+  for multi-byte characters.  The consuming target needs to define the
+  ``SP_MULTI_BYTE`` preprocessor macro to match this value in order to avoid
+  issues with character decoding.
+
+Examples
+^^^^^^^^
+
+Finding the OpenSP library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(OpenSP)
+  target_link_libraries(project_target PRIVATE OpenSP::OpenSP)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -157,7 +170,7 @@
 
 include(FeatureSummary)
 set_package_properties(OpenSP PROPERTIES
-  URL "http://openjade.sourceforge.net/doc/index.htm"
+  URL "https://openjade.sourceforge.net/doc/index.htm"
   DESCRIPTION "An SGML System Conforming to International Standard ISO 8879"
   )
 
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 033460b..af137d4 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -5,110 +5,162 @@
 FindOpenSSL
 -----------
 
-Find the OpenSSL encryption library.
+Finds the installed OpenSSL encryption library and determines its version.
 
-This module finds an installed OpenSSL library and determines its version.
-
-.. versionadded:: 3.19
-  When a version is requested, it can be specified as a simple value or as a
-  range. For a detailed description of version range usage and capabilities,
-  refer to the :command:`find_package` command.
+.. versionadded:: 3.20
+  Support for specifying version range when calling the :command:`find_package`
+  command.  When a version is requested, it can be specified as a single value
+  as before, and now also a version range can be used.  For a detailed
+  description of version range usage and capabilities, refer to the
+  :command:`find_package` command.
 
 .. versionadded:: 3.18
   Support for OpenSSL 3.0.
 
-Optional COMPONENTS
-^^^^^^^^^^^^^^^^^^^
+Components
+^^^^^^^^^^
 
-.. versionadded:: 3.12
+This module supports the following optional components:
 
-This module supports two optional COMPONENTS: ``Crypto`` and ``SSL``.  Both
-components have associated imported targets, as described below.
+``Crypto``
+  .. versionadded:: 3.12
+
+  Ensures that the OpenSSL ``crypto`` library is found.
+
+``SSL``
+  .. versionadded:: 3.12
+
+  Ensures that the OpenSSL ``ssl`` library is found.
+
+Components can be optionally specified using a standard syntax:
+
+.. code-block:: cmake
+
+  find_package(OpenSSL [COMPONENTS <components>...])
+
+If no components are requested, module by default searches for the ``Crypto``
+as required and ``SSL`` as optional component.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.4
+This module provides the following :ref:`Imported Targets`:
 
-This module defines the following :prop_tgt:`IMPORTED` targets:
+``OpenSSL::Crypto``
+  .. versionadded:: 3.4
+
+  Target encapsulating the OpenSSL ``crypto`` library usage requirements,
+  available only if the ``crypto`` library is found.
 
 ``OpenSSL::SSL``
-  The OpenSSL ``ssl`` library, if found.
-``OpenSSL::Crypto``
-  The OpenSSL ``crypto`` library, if found.
+  .. versionadded:: 3.4
+
+  Target encapsulating the OpenSSL ``ssl`` library usage requirements, available
+  only if the ``ssl`` library is found.  For convenience, this target also links
+  ``OpenSSL::Crypto``, since the ``ssl`` library depends on the ``crypto``
+  library.
+
 ``OpenSSL::applink``
   .. versionadded:: 3.18
 
-  The OpenSSL ``applink`` components that might be need to be compiled into
-  projects under MSVC. This target is available only if found OpenSSL version
-  is not less than 0.9.8. By linking this target the above OpenSSL targets can
-  be linked even if the project has different MSVC runtime configurations with
-  the above OpenSSL targets. This target has no effect on platforms other than
-  MSVC.
+  Target encapsulating the OpenSSL application-side interface
+  (``openssl/applink.c``) usage requirements, available only if OpenSSL is found
+  and its version is at least 0.9.8.
 
-NOTE: Due to how ``INTERFACE_SOURCES`` are consumed by the consuming target,
-unless you certainly know what you are doing, it is always preferred to link
-``OpenSSL::applink`` target as ``PRIVATE`` and to make sure that this target is
-linked at most once for the whole dependency graph of any library or
-executable:
+  This interface provides a glue between OpenSSL BIO layer and the Windows
+  compiler runtime environment and may need to be compiled into projects when
+  using MSVC.  By linking this target, the other OpenSSL imported targets can be
+  linked even if the project uses different MSVC runtime configuration.  Linking
+  this target on platforms other than MSVC has no effect.
 
-.. code-block:: cmake
+  .. note::
 
-   target_link_libraries(myTarget PRIVATE OpenSSL::applink)
+    The interface file is added using the :prop_tgt:`INTERFACE_SOURCES` target
+    property.  Due to how interface sources are propagated in CMake, it is
+    recommended to link the ``OpenSSL::applink`` target as
+    :ref:`PRIVATE <Target Command Scope>` to ensure that it is linked only once
+    in the entire dependency graph of any library or executable:
 
-Otherwise you would probably encounter unexpected random problems when building
-and linking, as both the ISO C and the ISO C++ standard claims almost nothing
-about what a link process should be.
+    .. code-block:: cmake
+
+      target_link_libraries(project_target PRIVATE OpenSSL::applink)
+
+    Using other scopes for this target specifically can lead to unexpected
+    issues during the build or link process, as both the ISO C and ISO C++
+    standards place very few requirements on how linking should behave.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
-``OPENSSL_FOUND``
-  System has the OpenSSL library. If no components are requested it only
-  requires the crypto library.
+``OpenSSL_FOUND``
+  Boolean indicating whether the OpenSSL library has been found.  For backward
+  compatibility, the ``OPENSSL_FOUND`` variable is also set to the same value.
 ``OPENSSL_INCLUDE_DIR``
   The OpenSSL include directory.
 ``OPENSSL_CRYPTO_LIBRARY``
-  The OpenSSL crypto library.
+  The OpenSSL ``crypto`` library.
 ``OPENSSL_CRYPTO_LIBRARIES``
-  The OpenSSL crypto library and its dependencies.
+  The OpenSSL ``crypto`` library and its dependencies.
 ``OPENSSL_SSL_LIBRARY``
-  The OpenSSL SSL library.
+  The OpenSSL ``ssl`` library.
 ``OPENSSL_SSL_LIBRARIES``
-  The OpenSSL SSL library and its dependencies.
+  The OpenSSL ``ssl`` library and its dependencies.
 ``OPENSSL_LIBRARIES``
   All OpenSSL libraries and their dependencies.
 ``OPENSSL_VERSION``
-  This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``).
+  The OpenSSL version found.  This is set to
+  ``<major>.<minor>.<revision><patch>`` (e.g. ``0.9.8s``).
 ``OPENSSL_APPLINK_SOURCE``
-  The sources in the target ``OpenSSL::applink`` that is mentioned above. This
-  variable shall always be undefined if found openssl version is less than
-  0.9.8 or if platform is not MSVC.
+  The sources in the target ``OpenSSL::applink`` mentioned above.  This variable
+  is only defined if found OpenSSL version is at least 0.9.8 and the platform is
+  MSVC.
 
 Hints
 ^^^^^
 
-The following variables may be set to control search behavior:
+This module accepts the following variables to control the search behavior:
 
 ``OPENSSL_ROOT_DIR``
-  Set to the root directory of an OpenSSL installation.
+  Set to the root directory of an OpenSSL installation to search for the OpenSSL
+  libraries in custom locations.
 
 ``OPENSSL_USE_STATIC_LIBS``
   .. versionadded:: 3.4
 
-  Set to ``TRUE`` to look for static libraries.
+  Set to ``TRUE`` to prefer static OpenSSL libraries over shared ones.
 
 ``OPENSSL_MSVC_STATIC_RT``
   .. versionadded:: 3.5
 
-  Set to ``TRUE`` to choose the MT version of the lib.
+  Set to ``TRUE`` to search for the OpenSSL libraries built with the MSVC static
+  runtime (MT).
 
 ``ENV{PKG_CONFIG_PATH}``
-  On UNIX-like systems, ``pkg-config`` is used to locate the system OpenSSL.
-  Set the ``PKG_CONFIG_PATH`` environment variable to look in alternate
-  locations.  Useful on multi-lib systems.
+  On UNIX-like systems, ``pkg-config`` is used to locate OpenSSL.  Set the
+  ``PKG_CONFIG_PATH`` environment variable to specify alternate locations, which
+  is useful on systems with multiple library installations.
+
+Examples
+^^^^^^^^
+
+Finding the OpenSSL ``crypto`` library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(OpenSSL)
+  target_link_libraries(project_target PRIVATE OpenSSL::Crypto)
+
+The following example shows how to find the OpenSSL ``crypto`` and ``ssl``
+libraries and link them to a project target.  The ``SSL`` component is
+explicitly specified to ensure that the find module reports an error if the
+``ssl`` library is not found:
+
+.. code-block:: cmake
+
+  find_package(OpenSSL COMPONENTS SSL)
+  target_link_libraries(project_target PRIVATE OpenSSL::SSL)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -244,9 +296,13 @@
     HINTS
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL for ARM (64-bit)_is1;Inno Setup: App Path]"
     )
 
-  if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+  if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
+    set(_arch "Win64-ARM")
+    file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
+  elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
     set(_arch "Win64")
     file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles)
   else()
@@ -313,12 +369,14 @@
     endif ()
 
     # Since OpenSSL 1.1, lib names are like libcrypto32MTd.lib and libssl32MTd.lib
-    if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
+    if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
+        set(_OPENSSL_MSVC_FOLDER_SUFFIX "arm64")
+    elseif( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
         set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
-        set(_OPENSSL_MSVC_FOLDER_SUFFIX "64")
+        set(_OPENSSL_MSVC_FOLDER_SUFFIX "x64")
     else()
         set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
-        set(_OPENSSL_MSVC_FOLDER_SUFFIX "86")
+        set(_OPENSSL_MSVC_FOLDER_SUFFIX "x86")
     endif()
 
     if(OPENSSL_USE_STATIC_LIBS)
@@ -326,13 +384,13 @@
         "_static"
       )
       set(_OPENSSL_PATH_SUFFIXES_DEBUG
-        "lib/VC/x${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}d"
+        "lib/VC/${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}d"
         "lib/VC/static"
         "VC/static"
         "lib"
         )
       set(_OPENSSL_PATH_SUFFIXES_RELEASE
-        "lib/VC/x${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}"
+        "lib/VC/${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}"
         "lib/VC/static"
         "VC/static"
         "lib"
@@ -342,13 +400,13 @@
         ""
       )
       set(_OPENSSL_PATH_SUFFIXES_DEBUG
-        "lib/VC/x${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}d"
+        "lib/VC/${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}d"
         "lib/VC"
         "VC"
         "lib"
         )
       set(_OPENSSL_PATH_SUFFIXES_RELEASE
-        "lib/VC/x${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}"
+        "lib/VC/${_OPENSSL_MSVC_FOLDER_SUFFIX}/${_OPENSSL_MSVC_RT_MODE}"
         "lib/VC"
         "VC"
         "lib"
@@ -669,7 +727,7 @@
 
 mark_as_advanced(OPENSSL_INCLUDE_DIR)
 
-if(OPENSSL_FOUND)
+if(OpenSSL_FOUND)
   if(NOT TARGET OpenSSL::Crypto AND
       (EXISTS "${OPENSSL_CRYPTO_LIBRARY}" OR
         EXISTS "${LIB_EAY_LIBRARY_DEBUG}" OR
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index d4ffa10..26f406d 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -5,112 +5,258 @@
 FindOpenSceneGraph
 ------------------
 
-Find OpenSceneGraph (3D graphics application programming interface)
+Finds `OpenSceneGraph`_ (OSG), a 3D graphics application programming interface.
 
-This module searches for the OpenSceneGraph core "osg" library as well
-as :module:`FindOpenThreads`, and whatever additional ``COMPONENTS``
-(nodekits) that you specify.
+.. note::
 
-::
+  OpenSceneGraph development has largely transitioned to its successor project,
+  VulkanSceneGraph, which should be preferred for new code.  Refer to the
+  upstream documentation for guidance on using VulkanSceneGraph with CMake.
 
-    See http://www.openscenegraph.org
+This module searches for the OpenSceneGraph core osg library, its dependency
+OpenThreads, and additional OpenSceneGraph libraries, some of which are also
+known as *NodeKits*, if specified.
 
+When working with OpenSceneGraph, its core library headers are intended to be
+included in C++ project source code as:
 
+.. code-block:: c++
+  :caption: ``example.cxx``
 
-NOTE: To use this module effectively you must either require ``CMake >=
-2.6.3`` with  :command:`cmake_minimum_required(VERSION 2.6.3)` or download
-and place :module:`FindOpenThreads`, :module:`Findosg` functions,
-:module:`Findosg` and ``Find<etc>.cmake`` files into your
-:variable:`CMAKE_MODULE_PATH`.
+  #include <osg/PositionAttitudeTransform>
 
-==================================
+Headers for the OpenSceneGraph libraries and NodeKits follow a similar inclusion
+structure, for example:
 
-This module accepts the following variables (note mixed case)
+.. code-block:: c++
+  :caption: ``example.cxx``
 
-::
+  #include <osgAnimation/Animation>
+  #include <osgDB/DatabasePager>
+  #include <osgFX/BumpMapping>
+  // ...
 
-    OpenSceneGraph_DEBUG - Enable debugging output
+.. _`OpenSceneGraph`: https://openscenegraph.github.io/openscenegraph.io/
 
+Components
+^^^^^^^^^^
 
+OpenSceneGraph toolkit consists of the core library osg, and additional
+libraries, which can be optionally specified as components with the
+:command:`find_package` command:
 
-::
+.. code-block:: cmake
 
-    OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
-                                      automatically
+  find_package(OpenSceneGraph [COMPONENTS <components>...])
 
+Supported components include:
 
+``osg``
+  Finds the core osg library (``libosg``), required to use OpenSceneGraph.
+  This component is always automatically implied.
 
-The following environment variables are also respected for finding the
-OSG and it's various components.  :variable:`CMAKE_PREFIX_PATH` can also be
-used for this (see :command:`find_library` CMake documentation).
+``OpenThreads``
+  Finds the dependent OpenThreads library (``libOpenThreads``) via the
+  :module:`FindOpenThreads` module.  This component is always automatically
+  implied as it is required to use OpenSceneGraph.
 
-``<MODULE>_DIR``
-  (where ``MODULE`` is of the form "OSGVOLUME" and there is
-  a :module:`FindosgVolume`.cmake` file)
+``osgAnimation``
+  Finds the osgAnimation library, which provides general purpose utility classes
+  for animation.
+
+``osgDB``
+  Finds the osgDB library for reading and writing scene graphs support.
+
+``osgFX``
+  Finds the osgFX NodeKit, which provides a framework for implementing special
+  effects.
+
+``osgGA``
+  Finds the osgGA (GUI Abstraction) library, which provides facilities to work
+  with varying window systems.
+
+``osgIntrospection``
+  Finds the osgIntrospection library, which provides a reflection framework for
+  accessing and invoking class properties and methods at runtime without
+  modifying the classes.
+
+  .. note::
+    The osgIntrospection library has been removed from the OpenSceneGraph
+    toolkit as of OpenSceneGraph version 3.0.
+
+``osgManipulator``
+  Finds the osgManipulator NodeKit, which provides support for 3D interactive
+  manipulators.
+
+``osgParticle``
+  Finds the osgParticle NodeKit, which provides support for particle effects.
+
+``osgPresentation``
+  Finds the osgPresentation NodeKit, which provides support for 3D scene graph
+  based presentations.
+
+  .. note::
+    This NodeKit has been added in OpenSceneGraph 3.0.0.
+
+``osgProducer``
+  Finds the osgProducer utility library, which provides functionality for window
+  management and event handling.
+
+  .. note::
+    The osgProducer has been removed from early versions of OpenSceneGraph
+    toolkit 1.x, and has been superseded by the osgViewer library.
+
+``osgQt``
+  Finds the osgQt utility library, which provides various classes to aid the
+  integration of Qt.
+
+  .. note::
+    As of OpenSceneGraph version 3.6, this library has been moved to its own
+    repository.
+
+``osgShadow``
+  Finds the osgShadow NodeKit, which provides support for a range of shadow
+  techniques.
+
+``osgSim``
+  Finds the osgSim NodeKit, which adds support for simulation features like
+  navigation lights and OpenFlight-style movement controls.
+
+``osgTerrain``
+  Finds the osgTerrain NodeKit, which provides geospecifc terrain rendering
+  support.
+
+``osgText``
+  Finds the osgText NodeKit, which provides high quality text support.
+
+``osgUtil``
+  Finds the osgUtil library, which provides general-purpose utilities like
+  update, cull, and draw traversals, as well as scene graph tools such as
+  optimization, triangle stripping, and tessellation.
+
+``osgViewer``
+  Finds the osgViewer library, which provides high level viewer functionality.
+
+``osgVolume``
+  Finds the osgVolume NodeKit, which provides volume rendering support.
+
+``osgWidget``
+  Finds the osgWidget NodeKit, which provides support for 2D and 3D GUI widget
+  sets.
+
+If no components are specified, this module searches for the ``osg`` and
+``OpenThreads`` components by default.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``OpenSceneGraph_FOUND``
+  Boolean indicating whether the (requested version of) OpenSceneGraph with all
+  specified components is found.  For backward compatibility, the
+  ``OPENSCENEGRAPH_FOUND`` variable is also set to the same value.
+
+``OPENSCENEGRAPH_VERSION``
+  The version of the OSG which was found.
+
+``OPENSCENEGRAPH_INCLUDE_DIRS``
+  Include directories containing headers needed to use OpenSceneGraph.
+
+``OPENSCENEGRAPH_LIBRARIES``
+  Libraries needed to link against to use OpenSceneGraph.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``OpenSceneGraph_DEBUG``
+  Set this variable to boolean true to enable debugging output by this module.
+
+``OpenSceneGraph_MARK_AS_ADVANCED``
+  Set this variable to boolean true to mark cache variables of this module as
+  advanced automatically.
+
+To help this module find OpenSceneGraph and its various components installed in
+custom location, :variable:`CMAKE_PREFIX_PATH` variable can be used.
+Additionally, the following variables are also respected:
+
+``<COMPONENT>_DIR``
+  Environment or CMake variable that can be set to the root of the OSG common
+  installation, where ``<COMPONENT>`` is the uppercase form of component listed
+  above.  For example, ``OSGVOLUME_DIR`` to find the ``osgVolume`` component.
+
 ``OSG_DIR``
-  ..
+  Environment or CMake variable that can be set to influence detection of
+  OpenSceneGraph installation root location as a whole.
+
 ``OSGDIR``
-  ..
+  Environment variable treated the same as ``OSG_DIR``.
+
 ``OSG_ROOT``
-  ..
+  Environment variable treated the same as ``OSG_DIR``.
 
+Examples
+^^^^^^^^
 
-[CMake 2.8.10]: The CMake variable ``OSG_DIR`` can now be used as well to
-influence detection, instead of needing to specify an environment
-variable.
-
-This module defines the following output variables:
-
-::
-
-    OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
-
-
-
-::
-
-    OPENSCENEGRAPH_VERSION - The version of the OSG which was found
-
-
-
-::
-
-    OPENSCENEGRAPH_INCLUDE_DIRS - Where to find the headers
-
-
-
-::
-
-    OPENSCENEGRAPH_LIBRARIES - The OSG libraries
-
-
-
-================================== Example Usage:
+Finding the OpenSceneGraph with ``osgDB`` and ``osgUtil`` libraries specified as
+components and creating an interface :ref:`imported target <Imported Targets>`
+that encapsulates its usage requirements for linking to a project target:
 
 .. code-block:: cmake
 
-  find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgUtil)
-      # libOpenThreads & libosg automatically searched
-  include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
+  find_package(OpenSceneGraph 2.0.0 REQUIRED COMPONENTS osgDB osgUtil)
 
+  if(OpenSceneGraph_FOUND AND NOT TARGET OpenSceneGraph::OpenSceneGraph)
+    add_library(OpenSceneGraph::OpenSceneGraph INTERFACE IMPORTED)
+    set_target_properties(
+      OpenSceneGraph::OpenSceneGraph
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OPENSCENEGRAPH_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${OPENSCENEGRAPH_LIBRARIES}"
+    )
+  endif()
 
+  add_executable(example example.cxx)
 
-.. code-block:: cmake
+  target_link_libraries(example PRIVATE OpenSceneGraph::OpenSceneGraph)
 
-  add_executable(foo foo.cc)
-  target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
+See Also
+^^^^^^^^
+
+The following OpenSceneGraph-related helper find modules are used internally by
+this module when finding specific OpenSceneGraph components.  These modules are
+not intended to be included or invoked directly by project code during typical
+use of ``find_package(OpenSceneGraph)``.  However, they can be useful for
+advanced scenarios where finer control over component detection is needed.  For
+example, to find them explicitly and override or bypass detection of specific
+OpenSceneGraph components:
+
+* The :module:`Findosg` module to find the core osg library.
+* The :module:`FindosgAnimation` module to find osgAnimation.
+* The :module:`FindosgDB` module to find osgDB.
+* The :module:`FindosgFX` module to find osgDB.
+* The :module:`FindosgGA` module to find osgGA.
+* The :module:`FindosgIntrospection` module to find osgIntrospection.
+* The :module:`FindosgManipulator` module to find osgManipulator.
+* The :module:`FindosgParticle` module to find osgParticle.
+* The :module:`FindosgPresentation` module to find osgPresentation.
+* The :module:`FindosgProducer` module to find osgProducer.
+* The :module:`FindosgQt` module to find osgQt.
+* The :module:`FindosgShadow` module to find osgShadow.
+* The :module:`FindosgSim` module to find osgSim.
+* The :module:`FindosgTerrain` module to find osgTerrain.
+* The :module:`FindosgText` module to find osgText.
+* The :module:`FindosgUtil` module to find osgUtil.
+* The :module:`FindosgViewer` module to find osgViewer.
+* The :module:`FindosgVolume` module to find osgVolume.
+* The :module:`FindosgWidget` module to find osgWidget.
 #]=======================================================================]
 
 cmake_policy(PUSH)
 cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_<n>
 
-#
-# Naming convention:
-#  Local variables of the form _osg_foo
-#  Input variables of the form OpenSceneGraph_FOO
-#  Output variables of the form OPENSCENEGRAPH_FOO
-#
-
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 
 set(_osg_modules_to_process)
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index d91dc05..2e7c84f 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -5,55 +5,92 @@
 FindOpenThreads
 ---------------
 
-OpenThreads is a C++ based threading library.  Its largest userbase
-seems to OpenSceneGraph so you might notice I accept OSGDIR as an
-environment path.  I consider this part of the ``Findosg*`` suite used to
-find OpenSceneGraph components.  Each component is separate and you
-must opt in to each module.
+Finds the OpenThreads C++ based threading library.
 
-This module defines:
+OpenThreads header files are intended to be included as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <OpenThreads/Thread>
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``OpenThreads_FOUND``
+  Boolean indicating whether OpenThreads library is found.  For backward
+  compatibility, the ``OPENTHREADS_FOUND`` variable is also set to the same
+  value.
 
 ``OPENTHREADS_LIBRARY``
+  Libraries needed to link against to use OpenThreads.  This provides either
+  release (optimized) or debug library variant, which are found separately
+  depending on the project's :ref:`Build Configurations`.
 
-``OPENTHREADS_FOUND``
-  if false, do not try to link to OpenThreads
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
 ``OPENTHREADS_INCLUDE_DIR``
-  where to find the headers
+  The directory containing the header files needed to use OpenThreads.
 
-``$OPENTHREADS_DIR`` is an environment variable that would correspond to the::
+Hints
+^^^^^
 
-  ./configure --prefix=$OPENTHREADS_DIR
+This module accepts the following variables:
 
-used in building osg.
+``OPENTHREADS_DIR``
+  An environment or CMake variable that can be set to help find an OpenThreads
+  library installed in a custom location.  It should point to the installation
+  destination that was used when configuring, building, and installing
+  OpenThreads library: ``./configure --prefix=$OPENTHREADS_DIR``.
 
-.. versionadded:: 2.8.10
+This module was originally introduced to support the
+:module:`FindOpenSceneGraph` module and its components.  To simplify one-step
+automated configuration and builds when the OpenSceneGraph package is developed
+and distributed upstream, this module supports additional environment variables
+to find dependencies in specific locations.  This approach is used by upstream
+package over specifying ``-DVAR=value`` on the command line because it offers
+better isolation from internal changes to the module and allows more flexibility
+when specifying individual OSG components independently of the ``CMAKE_*_PATH``
+variables.  Explicit ``-DVAR=value`` arguments can still override these settings
+if needed.  Since OpenThreads is an optional standalone dependency of
+OpenSceneGraph, this module also honors the following variables for convenience:
 
-  The CMake variables ``OPENTHREADS_DIR`` or ``OSG_DIR`` can now
-  be used as well to influence detection, instead of needing to specify
-  an environment variable.
+``OSG_DIR``
+  May be set as an environment or CMake variable. Treated the same as
+  ``OPENTHREADS_DIR``.
+
+``OSGDIR``
+  Environment variable treated the same as ``OPENTHREADS_DIR``.
+
+Examples
+^^^^^^^^
+
+Finding the OpenThreads library and creating an interface :ref:`imported target
+<Imported Targets>` that encapsulates its usage requirements for linking to a
+project target:
+
+.. code-block:: cmake
+
+  find_package(OpenThreads)
+
+  if(OpenThreads_FOUND AND NOT TARGET OpenThreads::OpenThreads)
+    add_library(OpenThreads::OpenThreads INTERFACE IMPORTED)
+    set_target_properties(
+      OpenThreads::OpenThreads
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OPENTHREADS_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OPENTHREADS_LIBRARY}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE OpenThreads::OpenThreads)
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <OpenThreads/Thread>
-
-# To make it easier for one-step automated configuration/builds,
-# we leverage environmental paths. This is preferable
-# to the -DVAR=value switches because it insulates the
-# users from changes we may make in this script.
-# It also offers a little more flexibility than setting
-# the CMAKE_*_PATH since we can target specific components.
-# However, the default CMake behavior will search system paths
-# before anything else. This is problematic in the cases
-# where you have an older (stable) version installed, but
-# are trying to build a newer version.
-# CMake doesn't offer a nice way to globally control this behavior
-# so we have to do a nasty "double FIND_" in this module.
-# The first FIND disables the CMAKE_ search paths and only checks
-# the environmental paths.
-# If nothing is found, then the second find will search the
-# standard install paths.
-# Explicit -DVAR=value arguments should still be able to override everything.
-
 include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
 
 find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
@@ -70,7 +107,6 @@
     PATH_SUFFIXES include
 )
 
-
 find_library(OPENTHREADS_LIBRARY_RELEASE
     NAMES OpenThreads OpenThreadsWin32
     HINTS
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index a5d9707..edef791 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -5,16 +5,34 @@
 FindPHP4
 --------
 
-Find PHP4
+Finds PHP version 4, a general-purpose scripting language.
 
-This module finds if PHP4 is installed and determines where the
-include files and libraries are.  It also determines what the name of
-the library is.  This code sets the following variables:
+.. note::
 
-::
+  This module is specifically for PHP version 4, which is obsolete and no longer
+  supported.  For modern development, use a newer PHP version.
 
-  PHP4_INCLUDE_PATH       = path to where php.h can be found
-  PHP4_EXECUTABLE         = full path to the php4 binary
+This module checks if PHP 4 is installed and determines the locations of the
+include directories and the PHP command-line interpreter.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``PHP4_INCLUDE_PATH``
+  The directory containing ``php.h`` and other headers needed to use PHP.
+``PHP4_EXECUTABLE``
+  The full path to the ``php`` command-line interpreter executable.
+
+Examples
+^^^^^^^^
+
+Finding PHP:
+
+.. code-block:: cmake
+
+  find_package(PHP4)
 #]=======================================================================]
 
 set(PHP4_POSSIBLE_INCLUDE_PATHS
@@ -48,7 +66,7 @@
   )
 
 if(APPLE)
-# this is a hack for now
+  # this is a hack for now
   string(APPEND CMAKE_SHARED_MODULE_CREATE_C_FLAGS
    " -Wl,-flat_namespace")
   foreach(symbol
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 52d137f..1a72f7d 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -5,47 +5,60 @@
 FindPNG
 -------
 
-Find libpng, the official reference library for the PNG image format.
+Finds libpng, the official reference library for the PNG image format.
+
+.. note::
+
+  The PNG library depends on the ZLib compression library, which must be found
+  for this module to succeed.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
 .. versionadded:: 3.5
 
-This module defines the following :prop_tgt:`IMPORTED` target:
+This module defines the following :ref:`Imported Targets`:
 
 ``PNG::PNG``
   The libpng library, if found.
 
-Result variables
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module sets the following variables:
 
 ``PNG_INCLUDE_DIRS``
-  where to find png.h, etc.
+  Directory containing the PNG headers (e.g., ``png.h``).
 ``PNG_LIBRARIES``
-  the libraries to link against to use PNG.
+  PNG libraries required for linking.
 ``PNG_DEFINITIONS``
-  You should add_definitions(${PNG_DEFINITIONS}) before compiling code
-  that includes png library files.
+  Compile definitions for using PNG, if any.  They can be added with
+  :command:`target_compile_definitions` command when not using the ``PNG::PNG``
+  imported target.
 ``PNG_FOUND``
-  If false, do not try to use PNG.
+  True if PNG library is found.
 ``PNG_VERSION_STRING``
-  the version of the PNG library found (since CMake 2.8.8)
+  The version of the PNG library found.
 
-Obsolete variables
+Obsolete Variables
 ^^^^^^^^^^^^^^^^^^
 
-The following variables may also be set, for backwards compatibility:
+The following variables may also be set for backward compatibility:
 
 ``PNG_LIBRARY``
-  where to find the PNG library.
+  Path to the PNG library.
 ``PNG_INCLUDE_DIR``
-  where to find the PNG headers (same as PNG_INCLUDE_DIRS)
+  Directory containing the PNG headers (same as ``PNG_INCLUDE_DIRS``).
 
-Since PNG depends on the ZLib compression library, none of the above
-will be defined unless ZLib can be found.
+Examples
+^^^^^^^^
+
+Finding PNG library and using it in a project:
+
+.. code-block:: cmake
+
+  find_package(PNG)
+  target_link_libraries(project_target PRIVATE PNG::PNG)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index c2eeb49..5081936 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -569,7 +569,7 @@
 
   # print the result:
   if(${_NAME}_FOUND)
-    FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
+    find_package_message(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
   else()
 
     if(FPHSA_CONFIG_MODE)
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index a9f2d2b..29db756 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -5,29 +5,84 @@
 FindPackageMessage
 ------------------
 
-.. code-block:: cmake
+This module provides a command for printing find result messages and is
+intended for use in :ref:`Find Modules`.
 
-  find_package_message(<name> "message for user" "find result details")
-
-This function is intended to be used in FindXXX.cmake modules files.
-It will print a message once for each unique find result.  This is
-useful for telling the user where a package was found.  The first
-argument specifies the name (XXX) of the package.  The second argument
-specifies the message to display.  The third argument lists details
-about the find result so that if they change the message will be
-displayed again.  The macro also obeys the QUIET argument to the
-find_package command.
-
-Example:
+Load it in a CMake find module with:
 
 .. code-block:: cmake
 
-  if(X11_FOUND)
-    find_package_message(X11 "Found X11: ${X11_X11_LIB}"
-      "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
+  include(FindPackageMessage)
+
+Commands
+^^^^^^^^
+
+This module provides the following command:
+
+.. command:: find_package_message
+
+  Prints a message once for each unique find result to inform the user which
+  package was found and where:
+
+  .. code-block:: cmake
+
+    find_package_message(<PackageName> <message> <details>)
+
+  ``<PackageName>``
+    The name of the package (for example, as used in the
+    ``Find<PackageName>.cmake`` module filename).
+
+  ``<message>``
+    The message string to display.
+
+  ``<details>``
+    A unique identifier for tracking message display.  The ``<message>`` is
+    printed only once per distinct ``<details>`` value.  If ``<details>`` string
+    changes in a subsequent configuration phase, the message will be displayed
+    again.
+
+  If :command:`find_package` was called with the ``QUIET`` option, the
+  ``<message>`` is not printed.
+
+Examples
+^^^^^^^^
+
+Printing a result message in a custom find module:
+
+.. code-block:: cmake
+  :caption: ``FindFoo.cmake``
+
+  find_library(Foo_LIBRARY foo)
+  find_path(Foo_INCLUDE_DIR foo.h)
+
+  include(FindPackageMessage)
+
+  if(Foo_LIBRARY AND Foo_INCLUDE_DIR)
+    find_package_message(
+      Foo
+      "Found Foo: ${Foo_LIBRARY}"
+      "[${Foo_LIBRARY}][${Foo_INCLUDE_DIR}]"
+    )
   else()
-   ...
+    message(STATUS "Could NOT find Foo")
   endif()
+
+When writing standard find modules, use the
+:module:`FindPackageHandleStandardArgs` module and its
+:command:`find_package_handle_standard_args` command which automatically
+prints the find result message based on whether the package was found:
+
+.. code-block:: cmake
+  :caption: ``FindFoo.cmake``
+
+  # ...
+
+  include(FindPackageHandleStandardArgs)
+
+  find_package_handle_standard_args(
+    Foo
+    REQUIRED_VARS Foo_LIBRARY Foo_INCLUDE_DIR
+  )
 #]=======================================================================]
 
 function(find_package_message pkg msg details)
diff --git a/Modules/FindPatch.cmake b/Modules/FindPatch.cmake
index 009a598..c6ca07b 100644
--- a/Modules/FindPatch.cmake
+++ b/Modules/FindPatch.cmake
@@ -7,29 +7,67 @@
 
 .. versionadded:: 3.10
 
-The module defines the following variables:
+Finds the ``patch`` command-line executable for applying diff patches to
+original files.
 
-``Patch_EXECUTABLE``
-  Path to patch command-line executable.
-``Patch_FOUND``
-  True if the patch command-line executable was found.
+Imported Targets
+^^^^^^^^^^^^^^^^
 
-The following :prop_tgt:`IMPORTED` targets are also defined:
+This module provides the following :ref:`Imported Targets`:
 
 ``Patch::patch``
-  The command-line executable.
+  Target encapsulating the ``patch`` command-line executable, available only if
+  ``patch`` is found.
 
   .. versionchanged:: 4.0
-    Imported target is defined only when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``.
+    This imported target is defined only when :prop_gbl:`CMAKE_ROLE` is
+    ``PROJECT``.
 
-Example usage:
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Patch_FOUND``
+  Boolean indicating whether the ``patch`` command-line executable is found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Patch_EXECUTABLE``
+  The path to the ``patch`` command-line executable.
+
+Examples
+^^^^^^^^
+
+Finding ``patch`` command and executing it in a process:
 
 .. code-block:: cmake
 
-   find_package(Patch)
-   if(Patch_FOUND)
-     message("Patch found: ${Patch_EXECUTABLE}")
-   endif()
+  find_package(Patch)
+  if(Patch_FOUND)
+    execute_process(
+      COMMAND ${Patch_EXECUTABLE} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/src.patch
+    )
+  endif()
+
+The imported target can be used, for example, inside the
+:command:`add_custom_command` command, which patches the given file when some
+build rule depends on its output:
+
+.. code-block:: cmake
+
+  find_package(Patch)
+  if(TARGET Patch::patch)
+    # Executed when some build rule depends on the src.c file.
+    add_custom_command(
+      OUTPUT src.c
+      COMMAND Patch::patch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/src.patch
+      # ...
+    )
+  endif()
 #]=======================================================================]
 
 set(_doc "Patch command line executable")
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index 2bc6a61..06a2e62 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -5,20 +5,37 @@
 FindPerl
 --------
 
-Find a Perl interpreter.
+Finds a Perl interpreter.  Perl is a general-purpose, interpreted, dynamic
+programming language.
+
+Result Variables
+^^^^^^^^^^^^^^^^
 
 This module defines the following variables:
 
-``PERL_EXECUTABLE``
-  The full path to Perl.
-
-``PERL_FOUND``
-  True if the Perl executable was found.
+``Perl_FOUND``
+  True if the Perl executable was found.  For backward compatibility, the
+  ``PERL_FOUND`` variable is also set to the same value.
 
 ``PERL_VERSION_STRING``
-  .. versionadded:: 2.8.8
-
   The version of Perl found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``PERL_EXECUTABLE``
+  Full path to the ``perl`` executable.
+
+Examples
+^^^^^^^^
+
+Finding the Perl interpreter:
+
+.. code-block:: cmake
+
+  find_package(Perl)
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index b275061..330700e 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -5,43 +5,59 @@
 FindPerlLibs
 ------------
 
-Find Perl libraries
+Finds Perl libraries.  Perl is a general-purpose, interpreted, dynamic
+programming language.  This module detects whether Perl is installed and
+determines the locations of include paths, libraries, and the library name.
 
-This module finds if PERL is installed and determines where the
-include files and libraries are.  It also determines what the name of
-the library is.  This code sets the following variables:
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module sets the following variables:
 
-  PERLLIBS_FOUND    = True if perl.h & libperl were found
-  PERL_INCLUDE_PATH = path to where perl.h is found
-  PERL_LIBRARY      = path to libperl
-  PERL_EXECUTABLE   = full path to the perl binary
+``PerlLibs_FOUND``
+  True if ``perl.h`` and ``libperl`` were found.  For backward compatibility,
+  the ``PERLLIBS_FOUND`` variable is also set to the same value.
+``PERL_SITESEARCH``
+  Path to the sitesearch install directory (``-V:installsitesearch``).
+``PERL_SITEARCH``
+  Path to the sitelib install directory (``-V:installsitearch``).
+``PERL_SITELIB``
+  Path to the sitelib install directory (``-V:installsitelib``).
+``PERL_VENDORARCH``
+  Path to the vendor arch install directory (``-V:installvendorarch``).
+``PERL_VENDORLIB``
+  Path to the vendor lib install directory (``-V:installvendorlib``).
+``PERL_ARCHLIB``
+  Path to the core arch lib install directory (``-V:archlib``).
+``PERL_PRIVLIB``
+  Path to the core priv lib install directory (``-V:privlib``).
+``PERL_UPDATE_ARCHLIB``
+  Path to the update arch lib install directory (``-V:installarchlib``).
+``PERL_UPDATE_PRIVLIB``
+  Path to the update priv lib install directory (``-V:installprivlib``).
+``PERL_EXTRA_C_FLAGS``
+  Compilation flags used to build Perl.
 
+Cache Variables
+^^^^^^^^^^^^^^^
 
+The following cache variables may also be set:
 
-The minimum required version of Perl can be specified using the
-standard syntax, e.g.  find_package(PerlLibs 6.0)
+``PERL_INCLUDE_PATH``
+  Directory containing ``perl.h`` and other Perl header files.
+``PERL_LIBRARY``
+  Path to the ``libperl``.
+``PERL_EXECUTABLE``
+  Full path to the ``perl`` executable.
 
-::
+Examples
+^^^^^^^^
 
-  The following variables are also available if needed
-  (introduced after CMake 2.6.4)
+Finding Perl libraries and specifying the minimum required version:
 
+.. code-block:: cmake
 
-
-::
-
-  PERL_SITESEARCH     = path to the sitesearch install dir (-V:installsitesearch)
-  PERL_SITEARCH       = path to the sitelib install directory (-V:installsitearch)
-  PERL_SITELIB        = path to the sitelib install directory (-V:installsitelib)
-  PERL_VENDORARCH     = path to the vendor arch install directory (-V:installvendorarch)
-  PERL_VENDORLIB      = path to the vendor lib install directory (-V:installvendorlib)
-  PERL_ARCHLIB        = path to the core arch lib install directory (-V:archlib)
-  PERL_PRIVLIB        = path to the core priv lib install directory (-V:privlib)
-  PERL_UPDATE_ARCHLIB = path to the update arch lib install directory (-V:installarchlib)
-  PERL_UPDATE_PRIVLIB = path to the update priv lib install directory (-V:installprivlib)
-  PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
+  find_package(PerlLibs 6.0)
 #]=======================================================================]
 
 # find the perl executable
@@ -112,8 +128,9 @@
     list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING})
   endif()
   if (CMAKE_SYSTEM_NAME MATCHES "MSYS|CYGWIN")
-    # on MSYS and CYGWIN environments, current perl -V:libperl gives shared library name
-    # rather than the import library. So, extends possible library names
+    # On MSYS and CYGWIN environments, current perl -V:libperl gives shared
+    # library name rather than the import library. So, extend possible library
+    # names.
     list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl)
   endif()
 
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index bbb9856..1894498 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -5,20 +5,47 @@
 FindPhysFS
 ----------
 
-Locate PhysFS library This module defines:
+Finds the PhysicsFS library (PhysFS) for file I/O abstraction.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``PhysFS_FOUND``
+  Boolean indicating whether PhysicsFS library is found.  For backward
+  compatibility, the ``PHYSFS_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
 
 ``PHYSFS_LIBRARY``
-  the name of the library to link against
-``PHYSFS_FOUND``
-  if false, do not try to link to PHYSFS
+  Path to the PhysicsFS library needed to link against.
 ``PHYSFS_INCLUDE_DIR``
-  where to find physfs.h
+  Directory containing the ``physfs.h`` and related headers needed for using
+  the library.
 
-``$PHYSFSDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$PHYSFSDIR
+This module accepts the following variables:
 
-used in building PHYSFS.
+``PHYSFSDIR``
+  Environment variable that can be set to help locate a PhysicsFS library
+  installed in a custom location.  It should point to the installation
+  destination that was used when configuring, building, and installing PhysicsFS
+  library: ``./configure --prefix=$PHYSFSDIR``.
+
+Examples
+^^^^^^^^
+
+Finding the PhysicsFS library:
+
+.. code-block:: cmake
+
+  find_package(PhysFS)
 #]=======================================================================]
 
 find_path(PHYSFS_INCLUDE_DIR physfs.h
diff --git a/Modules/FindPike.cmake b/Modules/FindPike.cmake
index 5ad5c4f..457e82a 100644
--- a/Modules/FindPike.cmake
+++ b/Modules/FindPike.cmake
@@ -5,16 +5,27 @@
 FindPike
 --------
 
-Find Pike
+Finds the Pike compiler and interpreter.  Pike is interpreted, general purpose,
+high-level, dynamic programming language.
 
-This module finds if PIKE is installed and determines where the
-include files and libraries are.  It also determines what the name of
-the library is.  This code sets the following variables:
+Cache Variables
+^^^^^^^^^^^^^^^
 
-::
+The following cache variables may also be set:
 
-  PIKE_INCLUDE_PATH       = path to where program.h is found
-  PIKE_EXECUTABLE         = full path to the pike binary
+``PIKE_INCLUDE_PATH``
+  The directory containing ``program.h``.
+``PIKE_EXECUTABLE``
+  Full path to the pike binary.
+
+Examples
+^^^^^^^^
+
+Finding Pike:
+
+.. code-block:: cmake
+
+  find_package(Pike)
 #]=======================================================================]
 
 find_path(PIKE_INCLUDE_PATH program.h
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index e2c322a..b230eb5 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -15,8 +15,6 @@
   True if a pkg-config executable was found.
 
 ``PKG_CONFIG_VERSION_STRING``
-  .. versionadded:: 2.8.8
-
   The version of pkg-config that was found.
 
 ``PKG_CONFIG_EXECUTABLE``
@@ -391,7 +389,7 @@
     # the system
     set(_lib_dirs)
     if(NOT DEFINED CMAKE_SYSTEM_NAME
-        OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
+        OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$"
             AND NOT CMAKE_CROSSCOMPILING))
       if(EXISTS "/etc/debian_version") # is this a debian system ?
         if(CMAKE_LIBRARY_ARCHITECTURE)
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 5b70d53..ede8f0d 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -5,41 +5,97 @@
 FindPostgreSQL
 --------------
 
-Find the PostgreSQL installation.
+Finds the PostgreSQL installation - the client library (``libpq``) and
+optionally the server.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.14
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``PostgreSQL::PostgreSQL``
-if PostgreSQL has been found.
+``PostgreSQL::PostgreSQL``
+  .. versionadded:: 3.14
+
+  Target encapsulating all usage requirements of the required ``libpq`` client
+  library and the optionally requested PostgreSQL server component.  This target
+  is available only if PostgreSQL is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``PostgreSQL_FOUND``
-  True if PostgreSQL is found.
+  Boolean indicating whether the minimum required version and components of
+  PostgreSQL have been found.
 ``PostgreSQL_LIBRARIES``
-  the PostgreSQL libraries needed for linking
+  The PostgreSQL libraries needed for linking.
 ``PostgreSQL_INCLUDE_DIRS``
-  the directories of the PostgreSQL headers
+  The include directories containing PostgreSQL headers.
 ``PostgreSQL_LIBRARY_DIRS``
-  the link directories for PostgreSQL libraries
+  The directories containing PostgreSQL libraries.
 ``PostgreSQL_VERSION_STRING``
-  the version of PostgreSQL found
+  The version of PostgreSQL found.
 ``PostgreSQL_TYPE_INCLUDE_DIR``
-  the directories of the PostgreSQL server headers
+  The include directory containing PostgreSQL server headers.
 
 Components
 ^^^^^^^^^^
 
-This module contains additional ``Server`` component, that forcibly checks
-for the presence of server headers. Note that ``PostgreSQL_TYPE_INCLUDE_DIR``
-is set regardless of the presence of the ``Server`` component in find_package call.
+This module supports the following additional components:
 
+``Server``
+  .. versionadded:: 3.20
+
+  Ensures that server headers are also found.  Note that
+  ``PostgreSQL_TYPE_INCLUDE_DIR`` variable is set regardless of whether this
+  component is specified in the ``find_package()`` call.
+
+Examples
+^^^^^^^^
+
+Finding the PostgreSQL client library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(PostgreSQL)
+  target_link_libraries(project_target PRIVATE PostgreSQL::PostgreSQL)
+
+Specifying a minimum required PostgreSQL version:
+
+.. code-block:: cmake
+
+  find_package(PostgreSQL 11)
+
+Finding the PostgreSQL client library and requiring server headers using the
+``Server`` component provides an imported target with all usage requirements,
+which can then be linked to a project target:
+
+.. code-block:: cmake
+
+  find_package(PostgreSQL COMPONENTS Server)
+  target_link_libraries(project_target PRIVATE PostgreSQL::PostgreSQL)
+
+When checking for PostgreSQL client library features, some capabilities are
+indicated by preprocessor macros in the ``libpq-fe.h`` header (e.g.
+``LIBPQ_HAS_PIPELINING``).  Others may require using the
+:command:`check_symbol_exists` command:
+
+.. code-block:: cmake
+
+  find_package(PostgreSQL)
+  target_link_libraries(project_target PRIVATE PostgreSQL::PostgreSQL)
+
+  # The PQservice() function is available as of PostgreSQL 18.
+  if(TARGET PostgreSQL::PostgreSQL)
+    include(CheckSymbolExists)
+    include(CMakePushCheckState)
+
+    cmake_push_check_state(RESET)
+    set(CMAKE_REQUIRED_LIBRARIES PostgreSQL::PostgreSQL)
+    check_symbol_exists(PQservice "libpq-fe.h" PROJECT_HAS_PQSERVICE)
+    cmake_pop_check_state()
+  endif()
 #]=======================================================================]
 
 # ----------------------------------------------------------------------------
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index 9833658..1d034bc 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -5,40 +5,93 @@
 FindProducer
 ------------
 
-Though Producer isn't directly part of OpenSceneGraph, its primary
-user is OSG so I consider this part of the Findosg* suite used to find
-OpenSceneGraph components.  You'll notice that I accept OSGDIR as an
-environment path.
+.. note::
 
-Each component is separate and you must opt in to each module.  You
-must also opt into OpenGL (and OpenThreads?) as these modules won't do
-it for you.  This is to allow you control over your own system piece
-by piece in case you need to opt out of certain components or change
-the Find behavior for a particular module (perhaps because the default
-:module:`FindOpenGL` module doesn't work with your system as an example).
-If you want to use a more convenient module that includes everything,
-use the :module:`FindOpenSceneGraph` instead of the Findosg*.cmake
-modules.
+  Producer (also known as *Open Producer*) library originated from the
+  osgProducer utility library in early versions of the OpenSceneGraph toolkit
+  and was later developed into a standalone library.  The osgProducer was
+  eventually replaced by the osgViewer library, and the standalone Producer
+  library became obsolete and is no longer maintained.  For details about
+  OpenSceneGraph usage, refer to the :module:`FindOpenSceneGraph` module.
 
-Locate Producer This module defines:
+This module finds the Producer library, a windowing and event handling library
+designed primarily for real-time graphics applications.
+
+Producer library headers are intended to be included in C++ project source code
+as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <Producer/CameraGroup>
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``Producer_FOUND``
+  Boolean indicating whether Producer is found.  For backward compatibility, the
+  ``PRODUCER_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``PRODUCER_INCLUDE_DIR``
+  The include directory containing headers needed to use Producer.
 
 ``PRODUCER_LIBRARY``
+  The path to the Producer library needed to link against for usage.
 
-``PRODUCER_FOUND``
-  if false, do not try to link to Producer
-``PRODUCER_INCLUDE_DIR``
-  where to find the headers
+Hints
+^^^^^
 
-``$PRODUCER_DIR`` is an environment variable that would correspond to::
+This module accepts the following variables:
 
-  ./configure --prefix=$PRODUCER_DIR
+``PRODUCER_DIR``
+  Environment variable that can be set to help locate a custom installation of
+  the Producer library.  It should point to the root directory where the
+  Producer library was installed.  This should match the installation prefix
+  used when configuring and building Producer, such as with
+  ``./configure --prefix=$PRODUCER_DIR``.
 
-used in building osg.
+Because Producer was historically tightly integrated with OpenSceneGraph, this
+module also accepts the following environment variables as equivalents to
+``PRODUCER_DIR`` for convenience to specify common installation root for
+multiple OpenSceneGraph-related libraries at once:
+
+``OSGDIR``
+  Environment variable treated the same as ``PRODUCER_DIR``.
+
+``OSG_DIR``
+  Environment variable treated the same as ``PRODUCER_DIR``.
+
+Examples
+^^^^^^^^
+
+Finding the Producer library and creating an :ref:`imported target
+<Imported Targets>` that encapsulates its usage requirements for linking to a
+project target:
+
+.. code-block:: cmake
+
+  find_package(Producer)
+
+  if(Producer_FOUND AND NOT TARGET Producer::Producer)
+    add_library(Producer::Producer INTERFACE IMPORTED)
+    set_target_properties(
+      Producer::Producer
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${PRODUCER_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${PRODUCER_LIBRARY}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE Producer::Producer)
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <Producer/CameraGroup>
-
 # Try the user's environment request before anything else.
 find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
   HINTS
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 89a6cfd..4402afa 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -5,252 +5,573 @@
 FindProtobuf
 ------------
 
-Locate and configure the Google Protocol Buffers library.
+.. note::
 
-.. versionadded:: 3.6
-  Support for :command:`find_package` version checks.
+  If the Protobuf library is built and installed using its CMake-based
+  build system, it provides a :ref:`package configuration file
+  <Config File Packages>` for use with the :command:`find_package` command
+  in *config mode*:
 
-.. versionchanged:: 3.6
-  All input and output variables use the ``Protobuf_`` prefix.
-  Variables with ``PROTOBUF_`` prefix are still supported for compatibility.
+  .. code-block:: cmake
 
-The following variables can be set and are optional:
+    find_package(Protobuf CONFIG)
 
-``Protobuf_SRC_ROOT_FOLDER``
-  When compiling with MSVC, if this cache variable is set
-  the protobuf-default VS project build locations
-  (vsprojects/Debug and vsprojects/Release
-  or vsprojects/x64/Debug and vsprojects/x64/Release)
-  will be searched for libraries and binaries.
-``Protobuf_IMPORT_DIRS``
-  List of additional directories to be searched for
-  imported .proto files.
-``Protobuf_DEBUG``
-  .. versionadded:: 3.6
+  In this case, imported targets and CMake commands such as
+  :command:`protobuf_generate` are provided by the upstream package rather
+  than this module.  Additionally, some variables documented here are not
+  available in *config mode*, as imported targets are preferred.  For usage
+  details, refer to the upstream documentation, which is the recommended
+  way to use Protobuf with CMake.
 
-  Show debug messages.
-``Protobuf_USE_STATIC_LIBS``
-  .. versionadded:: 3.9
+  This module works only in *module mode*.
 
-  Set to ON to force the use of the static libraries.
-  Default is OFF.
-
-Defines the following variables:
-
-``Protobuf_FOUND``
-  Found the Google Protocol Buffers library
-  (libprotobuf & header files)
-``Protobuf_VERSION``
-  .. versionadded:: 3.6
-
-  Version of package found.
-``Protobuf_INCLUDE_DIRS``
-  Include directories for Google Protocol Buffers
-``Protobuf_LIBRARIES``
-  The protobuf libraries
-``Protobuf_PROTOC_LIBRARIES``
-  The protoc libraries
-``Protobuf_LITE_LIBRARIES``
-  The protobuf-lite libraries
-
-.. versionadded:: 3.9
-  The following :prop_tgt:`IMPORTED` targets are also defined:
-
-``protobuf::libprotobuf``
-  The protobuf library.
-``protobuf::libprotobuf-lite``
-  The protobuf lite library.
-``protobuf::libprotoc``
-  The protoc library.
-``protobuf::protoc``
-  .. versionadded:: 3.10
-    The protoc compiler.
-
-The following cache variables are also available to set or use:
-
-``Protobuf_LIBRARY``
-  The protobuf library
-``Protobuf_PROTOC_LIBRARY``
-  The protoc library
-``Protobuf_INCLUDE_DIR``
-  The include directory for protocol buffers
-``Protobuf_PROTOC_EXECUTABLE``
-  The protoc compiler
-``Protobuf_LIBRARY_DEBUG``
-  The protobuf library (debug)
-``Protobuf_PROTOC_LIBRARY_DEBUG``
-  The protoc library (debug)
-``Protobuf_LITE_LIBRARY``
-  The protobuf lite library
-``Protobuf_LITE_LIBRARY_DEBUG``
-  The protobuf lite library (debug)
-
-Example:
+This module finds the Protocol Buffers library (Protobuf) in *module mode*:
 
 .. code-block:: cmake
 
-  find_package(Protobuf REQUIRED)
-  include_directories(${Protobuf_INCLUDE_DIRS})
-  include_directories(${CMAKE_CURRENT_BINARY_DIR})
-  protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto)
-  protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS EXPORT_MACRO DLL_EXPORT foo.proto)
-  protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS DESCRIPTORS PROTO_DESCS foo.proto)
-  protobuf_generate_python(PROTO_PY foo.proto)
-  add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
-  target_link_libraries(bar ${Protobuf_LIBRARIES})
+  find_package(Protobuf [<version>] [...])
 
-.. note::
-  The ``protobuf_generate_cpp`` and ``protobuf_generate_python``
-  functions and :command:`add_executable` or :command:`add_library`
-  calls only work properly within the same directory.
+Protobuf is an open-source, language-neutral, and platform-neutral mechanism
+for serializing structured data, developed by Google.  It is commonly used
+for data exchange between programs or across networks.
 
-.. command:: protobuf_generate_cpp
+.. versionadded:: 3.6
+  Support for the ``<version>`` argument in
+  :command:`find_package(Protobuf \<version\>)`.
 
-  Add custom commands to process ``.proto`` files to C++:
+.. versionchanged:: 3.6
+  All input and output variables use the ``Protobuf_`` prefix.  Variables
+  with ``PROTOBUF_`` prefix are supported for backward compatibility.
 
-  .. code-block:: cmake
+Imported Targets
+^^^^^^^^^^^^^^^^
 
-    protobuf_generate_cpp (
-      <srcs-var> <hdrs-var>
-      [DESCRIPTORS <var>]
-      [EXPORT_MACRO <macro>]
-      [<proto-file>...])
+This module provides the following :ref:`Imported Targets`:
 
-  ``<srcs-var>``
-    Variable to define with autogenerated source files
+``protobuf::libprotobuf``
+  .. versionadded:: 3.9
 
-  ``<hdrs-var>``
-    Variable to define with autogenerated header files
+  Target encapsulating the Protobuf library usage requirements, available if
+  Protobuf library is found.
 
-  ``DESCRIPTORS <var>``
-    .. versionadded:: 3.10
-      Variable to define with autogenerated descriptor files, if requested.
+``protobuf::libprotobuf-lite``
+  .. versionadded:: 3.9
 
-  ``EXPORT_MACRO <macro>``
-    is a macro which should expand to ``__declspec(dllexport)`` or
-    ``__declspec(dllimport)`` depending on what is being compiled.
+  Target encapsulating the ``protobuf-lite`` library usage requirements,
+  available if Protobuf and its lite library are found.
 
-  ``<proto-file>...``
-    ``.proto`` files
+``protobuf::libprotoc``
+  .. versionadded:: 3.9
 
-.. command:: protobuf_generate_python
+  Target encapsulating the ``protoc`` library usage requirements, available
+  if Protobuf and its ``protoc`` library are found.
 
-  .. versionadded:: 3.4
+``protobuf::protoc``
+  .. versionadded:: 3.10
 
-  Add custom commands to process ``.proto`` files to Python:
+  Imported executable target encapsulating the ``protoc`` compiler usage
+  requirements, available if Protobuf and ``protoc`` are found.
 
-  .. code-block:: cmake
+Result Variables
+^^^^^^^^^^^^^^^^
 
-    protobuf_generate_python (<py-srcs-var> [<proto-file>...])
+This module defines the following variables:
 
-  ``<py-srcs-var>``
-    Variable to define with autogenerated Python files
+``Protobuf_FOUND``
+  Boolean indicating whether (the requested version of) Protobuf library is
+  found.
+``Protobuf_VERSION``
+  .. versionadded:: 3.6
 
-  ``<proto-file>...``
-    ``.proto`` files
+  The version of Protobuf found.
+``Protobuf_INCLUDE_DIRS``
+  Include directories needed to use Protobuf.
+``Protobuf_LIBRARIES``
+  Libraries needed to link against to use Protobuf.
+``Protobuf_PROTOC_LIBRARIES``
+  Libraries needed to link against to use the ``protoc`` library.
+``Protobuf_LITE_LIBRARIES``
+  Libraries needed to link against to use the ``protobuf-lite`` library.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``Protobuf_INCLUDE_DIR``
+  The include directory containing Protobuf headers.
+``Protobuf_LIBRARY``
+  The path to the ``protobuf`` library.
+``Protobuf_PROTOC_LIBRARY``
+  The path to the ``protoc`` library.
+``Protobuf_PROTOC_EXECUTABLE``
+  The path to the ``protoc`` compiler.
+``Protobuf_LIBRARY_DEBUG``
+  The path to the ``protobuf`` debug library.
+``Protobuf_PROTOC_LIBRARY_DEBUG``
+  The path to the ``protoc`` debug library.
+``Protobuf_LITE_LIBRARY``
+  The path to the ``protobuf-lite`` library.
+``Protobuf_LITE_LIBRARY_DEBUG``
+  The path to the ``protobuf-lite`` debug library.
+``Protobuf_SRC_ROOT_FOLDER``
+  When compiling with MSVC, if this cache variable is set, the
+  protobuf-default Visual Studio project build locations will be searched for
+  libraries and binaries:
+
+  * ``<Protobuf_SRC_ROOT_FOLDER>/vsprojects/{Debug,Release}``, or
+  * ``<Protobuf_SRC_ROOT_FOLDER>/vsprojects/x64/{Debug,Release}``
+
+Hints
+^^^^^
+
+This module accepts the following optional variables before calling the
+``find_package(Protobuf)``:
+
+``Protobuf_DEBUG``
+  .. versionadded:: 3.6
+
+  Boolean variable that enables debug messages of this module to be printed
+  for debugging purposes.
+
+``Protobuf_USE_STATIC_LIBS``
+  .. versionadded:: 3.9
+
+  Set to ON to force the use of the static libraries.  Default is OFF.
+
+Commands
+^^^^^^^^
+
+This module provides the following commands if Protobuf is found:
+
+Generating Source Files
+"""""""""""""""""""""""
 
 .. command:: protobuf_generate
 
   .. versionadded:: 3.13
 
-  Automatically generate source files from ``.proto`` schema files at build time:
+  Automatically generates source files from ``.proto`` schema files at build
+  time:
 
   .. code-block:: cmake
 
-    protobuf_generate (
-        TARGET <target>
-        [LANGUAGE <lang>]
-        [OUT_VAR <var>]
-        [EXPORT_MACRO <macro>]
-        [PROTOC_OUT_DIR <dir>]
-        [PLUGIN <plugin>]
-        [PLUGIN_OPTIONS <plugin-options>]
-        [DEPENDENCIES <dependencies>]
-        [PROTOS <proto-file>...]
-        [IMPORT_DIRS <dir>...]
-        [GENERATE_EXTENSIONS <extension>...]
-        [PROTOC_OPTIONS <option>...]
-        [PROTOC_EXE <executable>]
-        [APPEND_PATH])
+    protobuf_generate(
+      [TARGET <target>]
+      [LANGUAGE <lang>]
+      [OUT_VAR <variable>]
+      [EXPORT_MACRO <macro>]
+      [PROTOC_OUT_DIR <out-dir>]
+      [PLUGIN <plugin>]
+      [PLUGIN_OPTIONS <plugin-options>]
+      [DEPENDENCIES <dependencies>...]
+      [PROTOS <proto-files>...]
+      [IMPORT_DIRS <dirs>...]
+      [APPEND_PATH]
+      [GENERATE_EXTENSIONS <extensions>...]
+      [PROTOC_OPTIONS <options>...]
+      [PROTOC_EXE <executable>]
+      [DESCRIPTORS]
+    )
 
-  ``APPEND_PATH``
-    A flag that causes the base path of all proto schema files to be added to
-    ``IMPORT_DIRS``.
+  ``TARGET <target>``
+    The CMake target to which the generated files are added as sources.  This
+    option is required when ``OUT_VAR <variable>`` is not used.
 
   ``LANGUAGE <lang>``
-    A single value: cpp or python. Determines what kind of source files are
-    being generated. Defaults to cpp.
+    A single value: ``cpp`` or ``python``.  Determines the kind of source
+    files to generate.  Defaults to ``cpp``.  For other languages, use the
+    ``GENERATE_EXTENSIONS`` option.
 
-  ``OUT_VAR <var>``
-    Name of a CMake variable that will be filled with the paths to the generated
-    source files.
+  ``OUT_VAR <variable>``
+    The name of a CMake variable that will be populated with the paths to
+    the generated source files.
 
   ``EXPORT_MACRO <macro>``
-    Name of a macro that is applied to all generated Protobuf message classes
-    and extern variables. It can, for example, be used to declare DLL exports.
+    The name of a preprocessor macro applied to all generated Protobuf message
+    classes and extern variables.  This can be used, for example, to declare
+    DLL exports.  The macro should expand to ``__declspec(dllexport)`` or
+    ``__declspec(dllimport)``, depending on what is being compiled.
 
-  ``PROTOC_OUT_DIR <dir>``
-    Output directory of generated source files. Defaults to ``CMAKE_CURRENT_BINARY_DIR``.
+    This option is only used when ``LANGUAGE`` is ``cpp``.
+
+  ``PROTOC_OUT_DIR <out-dir>``
+    The output directory for generated source files.  Defaults to:
+    :variable:`CMAKE_CURRENT_BINARY_DIR`.
 
   ``PLUGIN <plugin>``
     .. versionadded:: 3.21
 
-    An optional plugin executable. This could, for example, be the path to
+    An optional plugin executable.  This could be, for example, the path to
     ``grpc_cpp_plugin``.
 
   ``PLUGIN_OPTIONS <plugin-options>``
     .. versionadded:: 3.28
 
-    Additional options provided to the plugin, such as ``generate_mock_code=true``
-    for the gRPC cpp plugin.
+    Additional options passed to the plugin, such as ``generate_mock_code=true``
+    for the gRPC C++ plugin.
 
-  ``DEPENDENCIES <dependencies>``
+  ``DEPENDENCIES <dependencies>...``
     .. versionadded:: 3.28
 
-    Arguments forwarded to the ``DEPENDS`` of the underlying ``add_custom_command``
+    Dependencies on which the generation of files depends on.  These are
+    forwarded to the underlying :command:`add_custom_command(DEPENDS)`
     invocation.
 
-  ``TARGET <target>``
-    CMake target that will have the generated files added as sources.
+    .. versionchanged:: 4.1
+      This argument now accepts multiple values (``DEPENDENCIES a b c...``).
+      Previously, only a single value could be specified
+      (``DEPENDENCIES "a;b;c;..."``).
 
-  ``PROTOS <proto-file>...``
-    List of proto schema files. If omitted, then every source file ending in *proto* of ``TARGET`` will be used.
+  ``PROTOS <proto-files>...``
+    A list of ``.proto`` schema files to process.  If ``<target>`` is also
+    specified, these will be combined with all ``.proto`` source files from
+    that target.
 
-  ``IMPORT_DIRS <dir>...``
-    A common parent directory for the schema files. For example, if the schema file is
-    ``proto/helloworld/helloworld.proto`` and the import directory ``proto/`` then the
-    generated files are ``${PROTOC_OUT_DIR}/helloworld/helloworld.pb.h`` and
-    ``${PROTOC_OUT_DIR}/helloworld/helloworld.pb.cc``.
+  ``IMPORT_DIRS <dirs>...``
+    A list of one or more common parent directories for the schema files.
+    For example, if the schema file is ``proto/helloworld/helloworld.proto``
+    and the import directory is ``proto/``, then the generated files will be
+    ``<out-dir>/helloworld/helloworld.pb.h`` and
+    ``<out-dir>/helloworld/helloworld.pb.cc``.
 
-  ``GENERATE_EXTENSIONS <extension>...``
-    If LANGUAGE is omitted then this must be set to the extensions that protoc generates.
+  ``APPEND_PATH``
+    If specified, the base paths of all proto schema files are appended to
+    ``IMPORT_DIRS`` (it causes ``protoc`` to be invoked with ``-I`` argument
+    for each directory containing a ``.proto`` file).
 
-  ``PROTOC_OPTIONS <option>...``
+  ``GENERATE_EXTENSIONS <extensions>...``
+    If ``LANGUAGE`` is omitted, this must be set to specify the extensions
+    generated by ``protoc``.
+
+  ``PROTOC_OPTIONS <options>...``
     .. versionadded:: 3.28
 
-    Additional arguments that are forwarded to protoc.
+    A list of additional command-line options passed directly to the
+    ``protoc`` compiler.
 
   ``PROTOC_EXE <executable>``
     .. versionadded:: 4.0
 
-    Command name, path, or CMake executable used to generate protobuf bindings.
-    If omitted, ``protobuf::protoc`` is used.
+    The command-line program, path, or CMake executable used to generate
+    Protobuf bindings.  If omitted, ``protobuf::protoc`` imported target is
+    used by default.
 
-  Example:
+  ``DESCRIPTORS``
+    If specified, a command-line option ``--descriptor_set_out=<proto-file>``
+    is appended to ``protoc`` compiler for each ``.proto`` source file,
+    enabling the creation of self-describing messages.  This option can only
+    be used when ``<lang>`` is ``cpp`` and Protobuf is found in *module mode*.
+
+    .. note::
+
+      This option is not available when Protobuf is found in *config mode*.
+
+Deprecated Commands
+"""""""""""""""""""
+
+The following commands are provided for backward compatibility.
+
+.. note::
+
+  The ``protobuf_generate_cpp()`` and ``protobuf_generate_python()``
+  commands work correctly only within the same directory scope, where
+  ``find_package(Protobuf ...)`` is called.
+
+.. note::
+
+  If Protobuf is found in *config mode*, the ``protobuf_generate_cpp()`` and
+  ``protobuf_generate_python()`` commands are **not available** as of
+  Protobuf version 3.0.0, unless the upstream package configuration hint
+  variable ``protobuf_MODULE_COMPATIBLE`` is set to boolean true before
+  calling ``find_package(Protobuf ...)``.
+
+.. command:: protobuf_generate_cpp
+
+  .. deprecated:: 4.1
+    Use :command:`protobuf_generate`.
+
+  Automatically generates C++ source files from ``.proto`` schema files at
+  build time:
 
   .. code-block:: cmake
 
-    find_package(gRPC CONFIG REQUIRED)
-    find_package(Protobuf REQUIRED)
-    add_library(ProtoTest Test.proto)
-    target_link_libraries(ProtoTest PUBLIC gRPC::grpc++)
-    protobuf_generate(TARGET ProtoTest)
+    protobuf_generate_cpp(
+      <sources-variable>
+      <headers-variable>
+      [DESCRIPTORS <variable>]
+      [EXPORT_MACRO <macro>]
+      <proto-files>...
+    )
+
+  ``<sources-variable>``
+    Name of the variable to define, which will contain a list of generated
+    C++ source files.
+
+  ``<headers-variable>``
+    Name of the variable to define, which will contain a list of generated
+    header files.
+
+  ``DESCRIPTORS <variable>``
+    .. versionadded:: 3.10
+
+    Name of the variable to define, which will contain a list of generated
+    descriptor files if requested.
+
+    .. note::
+      This option is not available when Protobuf is found in *config mode*.
+
+  ``EXPORT_MACRO <macro>``
+    Name of a macro that should expand to ``__declspec(dllexport)`` or
+    ``__declspec(dllimport)``, depending on what is being compiled.
+
+  ``<proto-files>...``
+    One of more ``.proto`` files to be processed.
+
+.. command:: protobuf_generate_python
+
+  .. deprecated:: 4.1
+    Use :command:`protobuf_generate`.
+
+  .. versionadded:: 3.4
+
+  Automatically generates Python source files from ``.proto`` schema files at
+  build time:
+
+  .. code-block:: cmake
+
+    protobuf_generate_python(<python-sources-variable> <proto-files>...)
+
+  ``<python-sources-variable>``
+    Name of the variable to define, which will contain a list of generated
+    Python source files.
+
+  ``<proto-files>...``
+    One or more ``.proto`` files to be processed.
+
+---------------------------------------------------------------------
+
+The ``protobuf_generate_cpp()`` and ``protobuf_generate_python()`` commands
+accept the following optional variables before being invoked:
+
+``Protobuf_IMPORT_DIRS``
+  .. deprecated:: 4.1
+
+  A list of additional directories to search for imported ``.proto`` files.
+
+``PROTOBUF_GENERATE_CPP_APPEND_PATH``
+  .. deprecated:: 4.1
+    Use :command:`protobuf_generate(APPEND_PATH)` command option.
+
+  A boolean variable that, if set to boolean true, causes ``protoc`` to be
+  invoked with ``-I`` argument for each directory containing a ``.proto``
+  file.  By default, it is set to boolean true.
+
+Examples
+^^^^^^^^
+
+Examples: Finding Protobuf
+""""""""""""""""""""""""""
+
+Finding Protobuf library:
+
+.. code-block:: cmake
+
+  find_package(Protobuf)
+
+Or, finding Protobuf and specifying a minimum required version:
+
+.. code-block:: cmake
+
+  find_package(Protobuf 30)
+
+Or, finding Protobuf and making it required (if not found, processing stops
+with an error message):
+
+.. code-block:: cmake
+
+  find_package(Protobuf REQUIRED)
+
+Example: Finding Protobuf in Config Mode
+""""""""""""""""""""""""""""""""""""""""
+
+When Protobuf library is built and installed using its CMake-based build
+system, it can be found in *config mode*:
+
+.. code-block:: cmake
+
+  find_package(Protobuf CONFIG)
+
+However, some Protobuf installations might still not provide package
+configuration file.  The following example shows, how to use the
+:variable:`CMAKE_FIND_PACKAGE_PREFER_CONFIG` variable to find Protobuf in
+*config mode* and falling back to *module mode* if config file is not found:
+
+.. code-block:: cmake
+
+  set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
+  find_package(Protobuf)
+  unset(CMAKE_FIND_PACKAGE_PREFER_CONFIG)
+
+Example: Using Protobuf
+"""""""""""""""""""""""
+
+Finding Protobuf and linking its imported library target to a project target:
+
+.. code-block:: cmake
+
+  find_package(Protobuf)
+  target_link_libraries(example PRIVATE protobuf::libprotobuf)
+
+Example: Processing Proto Schema Files
+""""""""""""""""""""""""""""""""""""""
+
+The following example demonstrates how to process all ``*.proto`` schema
+source files added to a target into C++ source files:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  cmake_minimum_required(VERSION 3.24)
+  project(ProtobufExample)
+
+  add_executable(example main.cxx person.proto)
+
+  find_package(Protobuf)
+
+  if(Protobuf_FOUND)
+    protobuf_generate(TARGET example)
+  endif()
+
+  target_link_libraries(example PRIVATE protobuf::libprotobuf)
+  target_include_directories(example PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+
+.. code-block:: proto
+  :caption: ``person.proto``
+
+  syntax = "proto3";
+
+  message Person {
+    string name = 1;
+    int32 id = 2;
+  }
+
+.. code-block:: c++
+  :caption: ``main.cxx``
+
+  #include <iostream>
+  #include "person.pb.h"
+
+  int main()
+  {
+    Person person;
+    person.set_name("Alice");
+    person.set_id(123);
+
+    std::cout << "Name: " << person.name() << "\n";
+    std::cout << "ID: " << person.id() << "\n";
+
+    return 0;
+  }
+
+Example: Using Protobuf and gRPC
+""""""""""""""""""""""""""""""""
+
+The following example shows how to use Protobuf and gRPC:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  find_package(Protobuf REQUIRED)
+  find_package(gRPC CONFIG REQUIRED)
+
+  add_library(ProtoExample Example.proto)
+  target_link_libraries(ProtoExample PUBLIC gRPC::grpc++)
+
+  protobuf_generate(TARGET ProtoExample)
+  protobuf_generate(
+    TARGET ProtoExample
+    LANGUAGE grpc
+    PLUGIN protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
+    PLUGIN_OPTIONS generate_mock_code=true
+    GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc
+  )
+
+Examples: Upgrading Deprecated Commands
+"""""""""""""""""""""""""""""""""""""""
+
+The following example shows how to process ``.proto`` files to C++ code,
+using a deprecated command and its modern replacement:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt`` with deprecated command
+
+  find_package(Protobuf)
+
+  if(Protobuf_FOUND)
+    protobuf_generate_cpp(
+      proto_sources
+      proto_headers
+      EXPORT_MACRO DLL_EXPORT
+      DESCRIPTORS proto_descriptors
+      src/protocol/Proto1.proto
+      src/protocol/Proto2.proto
+    )
+  endif()
+
+  target_sources(
+    example
+    PRIVATE ${proto_sources} ${proto_headers} ${proto_descriptors}
+  )
+  target_link_libraries(example PRIVATE protobuf::libprotobuf)
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt`` with upgraded code
+
+  find_package(Protobuf)
+
+  if(Protobuf_FOUND)
     protobuf_generate(
-        TARGET ProtoTest
-        LANGUAGE grpc
-        PLUGIN protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
-        PLUGIN_OPTIONS generate_mock_code=true
-        GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc)
+      TARGET example
+      EXPORT_MACRO DLL_EXPORT
+      IMPORT_DIRS src/protocol
+      DESCRIPTORS
+      PROTOS
+        src/protocol/Proto1.proto
+        src/protocol/Proto2.proto
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE protobuf::libprotobuf)
+
+The following example shows how to process ``.proto`` files to Python code,
+using a deprecated command and its modern replacement:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt`` with deprecated command
+
+  find_package(Protobuf)
+
+  if(Protobuf_FOUND)
+    protobuf_generate_python(python_sources foo.proto)
+  endif()
+
+  add_custom_target(proto_files DEPENDS ${python_sources})
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt`` with upgraded code
+
+  find_package(Protobuf)
+
+  if(Protobuf_FOUND)
+    protobuf_generate(
+      LANGUAGE python
+      PROTOS foo.proto
+      OUT_VAR python_sources
+    )
+  endif()
+
+  add_custom_target(proto_files DEPENDS ${python_sources})
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -258,11 +579,11 @@
 
 function(protobuf_generate)
   set(_options APPEND_PATH DESCRIPTORS)
-  set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS DEPENDENCIES PROTOC_EXE)
+  set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN PLUGIN_OPTIONS PROTOC_EXE)
   if(COMMAND target_sources)
     list(APPEND _singleargs TARGET)
   endif()
-  set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS PROTOC_OPTIONS)
+  set(_multiargs PROTOS IMPORT_DIRS GENERATE_EXTENSIONS PROTOC_OPTIONS DEPENDENCIES)
 
   cmake_parse_arguments(protobuf_generate "${_options}" "${_singleargs}" "${_multiargs}" "${ARGN}")
 
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 73d41dd..28f47b4 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -48,6 +48,21 @@
 If component ``Development`` is specified, it implies sub-components
 ``Development.Module`` and ``Development.Embed``.
 
+.. versionchanged:: 4.1
+  In a cross-compiling mode (i.e. the :variable:`CMAKE_CROSSCOMPILING` variable
+  is defined to true), the following constraints, when the policy
+  :policy:`CMP0190` is set to ``NEW``, now apply to the requested components:
+
+  * ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+  * ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+    The target artifacts will be searched. In this case, the
+    :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+    be used to execute the interpreter or the compiler.
+
+  When both host and target artifacts are needed, two different calls to the
+  :command:`find_package` command should be done. The
+  ``Python_ARTIFACTS_PREFIX`` variable can be helpful in this situation.
+
 To ensure consistent versions between components ``Interpreter``, ``Compiler``,
 ``Development`` (or one of its sub-components) and ``NumPy``, specify all
 components at the same time:
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index 371c6d4..24a3970 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -39,13 +39,17 @@
 # helper commands
 #
 macro (_PYTHON_DISPLAY_FAILURE _PYTHON_MSG)
-  if (${_PYTHON_BASE}_FIND_REQUIRED)
+  if (${ARGC} GREATER 1 AND "${ARGV1}" STREQUAL "FATAL")
+    set (_${_PYTHON_PREFIX}_FATAL TRUE)
+  endif()
+  if (${_PYTHON_BASE}_FIND_REQUIRED OR _${_PYTHON_PREFIX}_FATAL)
     message (FATAL_ERROR "${_PYTHON_MSG}")
   else()
     if (NOT ${_PYTHON_BASE}_FIND_QUIETLY)
       message(STATUS "${_PYTHON_MSG}")
     endif ()
   endif()
+  unset(_${_PYTHON_PREFIX}_FATAL)
 
   set (${_PYTHON_BASE}_FOUND FALSE)
   set (${_PYTHON_PREFIX}_FOUND FALSE)
@@ -75,6 +79,53 @@
 endfunction()
 
 
+function (_PYTHON_RESET_ARTIFACTS comp)
+  set(components ${comp})
+  if (comp STREQUAL "Interpreter")
+    list (APPEND components Compiler Development NumPy)
+  endif()
+  if (comp STREQUAL "Development")
+    list (APPEND components NumPy)
+  endif()
+  set(find_components ${${_PYTHON_BASE}_FIND_COMPONENTS})
+  list(TRANSFORM find_components REPLACE "^Development.*" "Development")
+  list(REMOVE_DUPLICATES find_components)
+
+  foreach (component IN LISTS components)
+    if (NOT component IN_LIST find_components)
+      continue()
+    endif()
+    if (component STREQUAL "Interpreter")
+      unset(_${_PYTHON_PREFIX}_EXECUTABLE CACHE)
+    endif()
+    if (component STREQUAL "Compiler"
+        AND "IronPython" IN_LIST _${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS)
+      unset(_${_PYTHON_PREFIX}_COMPILER CACHE)
+    endif()
+    if (component STREQUAL "Development")
+      set(artifacts ${ARGN})
+      if (NOT artifacts)
+        set(artifacts LIBRARY SABI_LIBRARY INCLUDE_DIR)
+      endif()
+      unset(_${_PYTHON_PREFIX}_CONFIG)
+      foreach (artifact IN LISTS artifacts)
+        if (artifact IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
+          if (artifact MATCHES "LIBRARY")
+            unset(_${_PYTHON_PREFIX}_${artifact}_RELEASE CACHE)
+            unset(_${_PYTHON_PREFIX}_${artifact}_DEBUG CACHE)
+          elseif(arifact STREQUAL "INCLUDE_DIR")
+            unset(_${_PYTHON_PREFIX}_${artifact} CACHE)
+          endif()
+        endif()
+      endforeach()
+    endif()
+    if (component STREQUAL "NumPy")
+      unset(_${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR CACHE)
+    endif()
+  endforeach()
+endfunction()
+
+
 macro (_PYTHON_SELECT_LIBRARY_CONFIGURATIONS _PYTHON_BASENAME)
   if(NOT DEFINED ${_PYTHON_BASENAME}_LIBRARY_RELEASE)
     set(${_PYTHON_BASENAME}_LIBRARY_RELEASE "${_PYTHON_BASENAME}_LIBRARY_RELEASE-NOTFOUND")
@@ -528,7 +579,7 @@
   endif()
 
   if ("Interpreter" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS AND _${_PYTHON_PREFIX}_EXECUTABLE
-      AND NOT CMAKE_CROSSCOMPILING)
+      AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
     if (NAME STREQUAL "PREFIX")
       execute_process (COMMAND ${_${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c "import sys\ntry:\n   import sysconfig\n   sys.stdout.write(';'.join([sysconfig.get_config_var('base') or '', sysconfig.get_config_var('installed_base') or '']))\nexcept Exception:\n   from distutils import sysconfig\n   sys.stdout.write(';'.join([sysconfig.PREFIX,sysconfig.EXEC_PREFIX,sysconfig.BASE_EXEC_PREFIX]))"
                        RESULT_VARIABLE _result
@@ -844,6 +895,11 @@
     return()
   endif()
 
+  if (_${_PYTHON_PREFIX}_CROSSCOMPILING)
+    set (${_PYTHON_PGL_NAME} "${CMAKE_CROSSCOMPILING_EMULATOR}" PARENT_SCOPE)
+    return()
+  endif()
+
   if ("IronPython" IN_LIST _${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS
       AND NOT SYSTEM_NAME MATCHES "Windows|Linux")
     if (_PGL_INTERPRETER)
@@ -999,7 +1055,7 @@
   if (CMAKE_SIZEOF_VOID_P AND ("Development.Module" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS
         OR "Development.SABIModule" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS
         OR "Development.Embed" IN_LIST ${_PYTHON_BASE}_FIND_COMPONENTS)
-      AND NOT CMAKE_CROSSCOMPILING)
+      AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
     # In this case, interpreter must have same architecture as environment
     execute_process (COMMAND ${_${_PYTHON_PREFIX}_INTERPRETER_LAUNCHER} "${_${_PYTHON_PREFIX}_EXECUTABLE}" -c
                              "import sys, struct; sys.stdout.write(str(struct.calcsize(\"P\")))"
@@ -1083,7 +1139,7 @@
   file (WRITE "${working_dir}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n")
   execute_process (COMMAND ${launcher} "${_${_PYTHON_PREFIX}_COMPILER}"
                            ${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS}
-                           /target:exe /embed "${working_dir}/version.py"
+                           /target:exe /embed /standalone "${working_dir}/version.py"
                    WORKING_DIRECTORY "${working_dir}"
                    OUTPUT_QUIET
                    ERROR_QUIET
@@ -1438,6 +1494,22 @@
   set (${_PYTHON_BASE}_FIND_REQUIRED_Development.Embed TRUE)
 endif()
 
+## handle cross-compiling constraints for components:
+##  If Interpreter and/or Compiler are specified with Development components
+##  the CMAKE_CROSSCOMPILING_EMULATOR variable should be defined
+cmake_policy (GET CMP0190 _${_PYTHON_PREFIX}_CROSSCOMPILING_POLICY)
+unset (_${_PYTHON_PREFIX}_CROSSCOMPILING)
+if (CMAKE_CROSSCOMPILING AND _${_PYTHON_PREFIX}_CROSSCOMPILING_POLICY STREQUAL "NEW")
+  if (${_PYTHON_BASE}_FIND_COMPONENTS MATCHES "Interpreter|Compiler"
+      AND ${_PYTHON_BASE}_FIND_COMPONENTS MATCHES "Development")
+    if (CMAKE_CROSSCOMPILING_EMULATOR)
+      set (_${_PYTHON_PREFIX}_CROSSCOMPILING TRUE)
+    else()
+      _python_display_failure ("${_PYTHON_PREFIX}: When cross-compiling, Interpreter and/or Compiler components cannot be searched when CMAKE_CROSSCOMPILING_EMULATOR variable is not specified (see policy CMP0190)." FATAL)
+    endif()
+  endif()
+endif()
+
 unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
 unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_MODULE_ARTIFACTS)
 unset (_${_PYTHON_PREFIX}_FIND_DEVELOPMENT_SABIMODULE_ARTIFACTS)
@@ -1888,6 +1960,8 @@
     if (NOT ${_PYTHON_PREFIX}_EXECUTABLE STREQUAL _${_PYTHON_PREFIX}_EXECUTABLE)
       # invalidate cache properties
       unset (_${_PYTHON_PREFIX}_INTERPRETER_PROPERTIES CACHE)
+      # invalidate the previous results for any other requested components
+      _python_reset_artifacts(Interpreter)
     endif()
     set (_${_PYTHON_PREFIX}_EXECUTABLE "${${_PYTHON_PREFIX}_EXECUTABLE}" CACHE INTERNAL "")
     unset (_${_PYTHON_PREFIX}_EXECUTABLE_DEBUG CACHE)
@@ -2662,7 +2736,7 @@
     file (WRITE "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py" "import sys; sys.stdout.write('.'.join([str(x) for x in sys.version_info[:3]])); sys.stdout.flush()\n")
     execute_process (COMMAND ${_${_PYTHON_PREFIX}_COMPILER_LAUNCHER} "${_${_PYTHON_PREFIX}_COMPILER}"
                              ${_${_PYTHON_PREFIX}_IRON_PYTHON_COMPILER_ARCH_FLAGS}
-                             /target:exe /embed "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py"
+                             /target:exe /embed /standalone "${_${_PYTHON_PREFIX}_VERSION_DIR}/version.py"
                      WORKING_DIRECTORY "${_${_PYTHON_PREFIX}_VERSION_DIR}"
                      OUTPUT_QUIET
                      ERROR_QUIET)
@@ -2794,18 +2868,17 @@
 
   if (DEFINED ${_PYTHON_PREFIX}_LIBRARY
       AND IS_ABSOLUTE "${${_PYTHON_PREFIX}_LIBRARY}")
+    _python_reset_artifacts(Development)
     set (_${_PYTHON_PREFIX}_LIBRARY_RELEASE "${${_PYTHON_PREFIX}_LIBRARY}" CACHE INTERNAL "")
-    unset (_${_PYTHON_PREFIX}_LIBRARY_DEBUG CACHE)
-    unset (_${_PYTHON_PREFIX}_INCLUDE_DIR CACHE)
   endif()
   if (DEFINED ${_PYTHON_PREFIX}_SABI_LIBRARY
       AND IS_ABSOLUTE "${${_PYTHON_PREFIX}_SABI_LIBRARY}")
+    _python_reset_artifacts(Development SABI_LIBRARY INCLUDE_DIR)
     set (_${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE "${${_PYTHON_PREFIX}_SABI_LIBRARY}" CACHE INTERNAL "")
-    unset (_${_PYTHON_PREFIX}_SABI_LIBRARY_DEBUG CACHE)
-    unset (_${_PYTHON_PREFIX}_INCLUDE_DIR CACHE)
   endif()
   if (DEFINED ${_PYTHON_PREFIX}_INCLUDE_DIR
       AND IS_ABSOLUTE "${${_PYTHON_PREFIX}_INCLUDE_DIR}")
+    _python_reset_artifacts(Development INCLUDE_DIR)
     set (_${_PYTHON_PREFIX}_INCLUDE_DIR "${${_PYTHON_PREFIX}_INCLUDE_DIR}" CACHE INTERNAL "")
   endif()
 
@@ -2825,7 +2898,8 @@
     # if python interpreter is found, use it to look-up for artifacts
     # to ensure consistency between interpreter and development environments.
     # If not, try to locate a compatible config tool
-    if ((NOT ${_PYTHON_PREFIX}_Interpreter_FOUND OR CMAKE_CROSSCOMPILING)
+    if ((NOT ${_PYTHON_PREFIX}_Interpreter_FOUND
+          OR (NOT _${_PYTHON_PREFIX}_CROSSCOMPILING AND CMAKE_CROSSCOMPILING))
         AND "CPython" IN_LIST _${_PYTHON_PREFIX}_FIND_IMPLEMENTATIONS)
       set (_${_PYTHON_PREFIX}_HINTS "${${_PYTHON_PREFIX}_ROOT_DIR}" ENV ${_PYTHON_PREFIX}_ROOT_DIR)
       unset (_${_PYTHON_PREFIX}_VIRTUALENV_PATHS)
@@ -2923,8 +2997,8 @@
                            OUTPUT_VARIABLE __${_PYTHON_PREFIX}_ABIFLAGS
                            ERROR_QUIET
                            OUTPUT_STRIP_TRAILING_WHITESPACE)
-          if (_${_PYTHON_PREFIX}_RESULT)
-            # assume ABI is not supported
+          if (_${_PYTHON_PREFIX}_RESULT OR NOT __${_PYTHON_PREFIX}_ABIFLAGS )
+            # assume ABI is not supported or not used
             set (__${_PYTHON_PREFIX}_ABIFLAGS "<none>")
           endif()
           if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND NOT __${_PYTHON_PREFIX}_ABIFLAGS IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
@@ -3091,7 +3165,9 @@
 
   if ("LIBRARY" IN_LIST _${_PYTHON_PREFIX}_FIND_DEVELOPMENT_ARTIFACTS)
     if (NOT _${_PYTHON_PREFIX}_LIBRARY_RELEASE)
-      if ((${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT CMAKE_CROSSCOMPILING) OR _${_PYTHON_PREFIX}_CONFIG)
+      if ((${_PYTHON_PREFIX}_Interpreter_FOUND
+            AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
+          OR _${_PYTHON_PREFIX}_CONFIG)
         # retrieve root install directory
         _python_get_config_var (_${_PYTHON_PREFIX}_PREFIX PREFIX)
 
@@ -3359,7 +3435,9 @@
           HINTS "${_${_PYTHON_PREFIX}_PATH}" ${_${_PYTHON_PREFIX}_HINTS}
           NO_DEFAULT_PATH)
       else()
-        if ((${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT CMAKE_CROSSCOMPILING) OR _${_PYTHON_PREFIX}_CONFIG)
+        if ((${_PYTHON_PREFIX}_Interpreter_FOUND
+              AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
+            OR _${_PYTHON_PREFIX}_CONFIG)
           # retrieve root install directory
           _python_get_config_var (_${_PYTHON_PREFIX}_PREFIX PREFIX)
 
@@ -3623,7 +3701,9 @@
         break()
       endif()
 
-      if ((${_PYTHON_PREFIX}_Interpreter_FOUND AND NOT CMAKE_CROSSCOMPILING) OR _${_PYTHON_PREFIX}_CONFIG)
+      if ((${_PYTHON_PREFIX}_Interpreter_FOUND
+            AND (_${_PYTHON_PREFIX}_CROSSCOMPILING OR NOT CMAKE_CROSSCOMPILING))
+          OR _${_PYTHON_PREFIX}_CONFIG)
         _python_get_config_var (_${_PYTHON_PREFIX}_INCLUDE_DIRS INCLUDES)
 
         find_path (_${_PYTHON_PREFIX}_INCLUDE_DIR
@@ -3863,12 +3943,19 @@
       _python_set_development_module_found (SABIModule)
       _python_set_development_module_found (Embed)
     endif()
-    if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI AND
-        (NOT _${_PYTHON_PREFIX}_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS
-          OR (NOT WIN32 AND NOT _${_PYTHON_PREFIX}_INC_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)))
-      set (${_PYTHON_PREFIX}_Development.Module_FOUND FALSE)
-      set (${_PYTHON_PREFIX}_Development.SABIModule_FOUND FALSE)
-      set (${_PYTHON_PREFIX}_Development.Embed_FOUND FALSE)
+    if (DEFINED _${_PYTHON_PREFIX}_FIND_ABI)
+      if ((_${_PYTHON_PREFIX}_LIBRARY_RELEASE OR _${_PYTHON_PREFIX}_SABI_LIBRARY_RELEASE)
+          AND NOT _${_PYTHON_PREFIX}_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
+        set (${_PYTHON_PREFIX}_Development.Module_FOUND FALSE)
+        set (${_PYTHON_PREFIX}_Development.SABIModule_FOUND FALSE)
+        set (${_PYTHON_PREFIX}_Development.Embed_FOUND FALSE)
+      endif()
+      if (_${_PYTHON_PREFIX}_INCLUDE_DIR AND
+          NOT WIN32 AND NOT _${_PYTHON_PREFIX}_INC_ABI IN_LIST _${_PYTHON_PREFIX}_ABIFLAGS)
+        set (${_PYTHON_PREFIX}_Development.Module_FOUND FALSE)
+        set (${_PYTHON_PREFIX}_Development.SABIModule_FOUND FALSE)
+        set (${_PYTHON_PREFIX}_Development.Embed_FOUND FALSE)
+      endif()
     endif()
   endif()
 
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index ce9a7d5..869dc70 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -41,6 +41,21 @@
 If component ``Development`` is specified, it implies sub-components
 ``Development.Module`` and ``Development.Embed``.
 
+.. versionchanged:: 4.1
+  In a cross-compiling mode (i.e. the :variable:`CMAKE_CROSSCOMPILING` variable
+  is defined to true), the following constraints, when the policy
+  :policy:`CMP0190` is set to ``NEW``, now apply to the requested components:
+
+  * ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+  * ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+    The target artifacts will be searched. In this case, the
+    :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+    be used to execute the interpreter or the compiler.
+
+  When both host and target artifacts are needed, two different calls to the
+  :command:`find_package` command should be done. The
+  ``Python_ARTIFACTS_PREFIX`` variable can be helpful in this situation.
+
 To ensure consistent versions between components ``Interpreter``, ``Compiler``,
 ``Development`` (or one of its sub-components) and ``NumPy``, specify all
 components at the same time:
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 5edc087..66c325a 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -48,6 +48,22 @@
 If component ``Development`` is specified, it implies sub-components
 ``Development.Module`` and ``Development.Embed``.
 
+.. versionchanged:: 4.1
+
+  In a cross-compiling mode (i.e. the :variable:`CMAKE_CROSSCOMPILING` variable
+  is defined to true), the following constraints, when the policy
+  :policy:`CMP0190` is set to ``NEW``, now apply to the requested components:
+
+  * ``Interpreter`` or ``Compiler`` alone: the host artifacts will be searched.
+  * ``Interpreter`` or ``Compiler`` with ``Development`` or any sub-component:
+    The target artifacts will be searched. In this case, the
+    :variable:`CMAKE_CROSSCOMPILING_EMULATOR` variable must be defined and will
+    be used to execute the interpreter or the compiler.
+
+  When both host and target artifacts are needed, two different calls to the
+  :command:`find_package` command should be done. The
+  ``Python_ARTIFACTS_PREFIX`` variable can be helpful in this situation.
+
 To ensure consistent versions between components ``Interpreter``, ``Compiler``,
 ``Development`` (or one of its sub-components) and ``NumPy``, specify all
 components at the same time:
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index a2c051f..4f4b85f 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -10,47 +10,80 @@
 
 .. deprecated:: 3.12
 
-  Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
+  Use :module:`FindPython3`, :module:`FindPython2`, or :module:`FindPython`
+  instead.
 
-Find python interpreter
-
-This module finds if Python interpreter is installed and determines
-where the executables are.  This code sets the following variables:
-
-::
-
-  PYTHONINTERP_FOUND         - Was the Python executable found
-  PYTHON_EXECUTABLE          - path to the Python interpreter
-
-
-
-::
-
-  PYTHON_VERSION_STRING      - Python version found e.g. 2.5.2
-  PYTHON_VERSION_MAJOR       - Python major version found e.g. 2
-  PYTHON_VERSION_MINOR       - Python minor version found e.g. 5
-  PYTHON_VERSION_PATCH       - Python patch version found e.g. 2
-
-
-
-The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
-of version numbers that should be taken into account when searching
-for Python.  You need to set this variable before calling
-find_package(PythonInterp).
-
-If calling both ``find_package(PythonInterp)`` and
-``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
-get the currently active Python version by default with a consistent version
-of PYTHON_LIBRARIES.
+This module finds the Python interpreter and determines the location of its
+executable.
 
 .. note::
 
-  A call to ``find_package(PythonInterp ${V})`` for python version ``V``
-  may find a ``python`` executable with no version suffix.  In this case
-  no attempt is made to avoid python executables from other versions.
-  Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython`
-  instead.
+  When using both this and the :module:`FindPythonLibs` module, call
+  ``find_package(PythonInterp)`` before ``find_package(PythonLibs)``.  This
+  ensures that the detected interpreter version is used to guide the selection
+  of compatible libraries, resulting in a consistent ``PYTHON_LIBRARIES`` value.
 
+.. note::
+
+  A call to ``find_package(PythonInterp ${V})`` for Python version ``V`` may
+  find a ``python`` executable with no version suffix.  In this case no attempt
+  is made to avoid Python executables from other versions.  Use
+  :module:`FindPython3`, :module:`FindPython2`, or :module:`FindPython` instead.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``PythonInterp_FOUND``
+  Boolean indicating whether the (requested version of) Python executable is
+  found.  For backward compatibility, the ``PYTHONINTERP_FOUND`` variable is
+  also set to the same value.
+``PYTHON_VERSION_STRING``
+  Python version found (e.g., ``2.5.2``).
+``PYTHON_VERSION_MAJOR``
+  Python major version found (e.g., ``2``).
+``PYTHON_VERSION_MINOR``
+  Python minor version found (e.g., ``5``).
+``PYTHON_VERSION_PATCH``
+  Python patch version found (e.g., ``2``).
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``PYTHON_EXECUTABLE``
+  The path to the Python interpreter.
+
+Hints
+^^^^^
+
+This module accepts the following variables before calling
+``find_package(PythonInterp)``:
+
+``Python_ADDITIONAL_VERSIONS``
+  This variable can be used to specify a list of version numbers that should be
+  taken into account when searching for Python.
+
+Examples
+^^^^^^^^
+
+Finding the Python interpreter in earlier versions of CMake:
+
+.. code-block:: cmake
+
+  find_package(PythonInterp)
+  execute_process(COMMAND ${PYTHON_EXECUTABLE} --help)
+
+Starting with CMake 3.12, the Python interpreter can be found using the
+:module:`FindPython` module.  The equivalent example using the modern approach
+is:
+
+.. code-block:: cmake
+
+  find_package(Python)
+  execute_process(COMMAND ${Python_EXECUTABLE} --help)
 #]=======================================================================]
 
 cmake_policy(GET CMP0148 _FindPythonInterp_CMP0148)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 41da7dc..bf2b2dc 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -10,42 +10,99 @@
 
 .. deprecated:: 3.12
 
-  Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
+  Use :module:`FindPython3`, :module:`FindPython2`, or :module:`FindPython`
+  instead.
 
-Find python libraries
+This module finds the Python installation and determines the location of its
+include directories and libraries, as well as the name of the Python library to
+link against.
 
-This module finds if Python is installed and determines where the
-include files and libraries are.  It also determines what the name of
-the library is.  This code sets the following variables:
+.. note::
 
-::
+  When using both this and the :module:`FindPythonInterp` module, call
+  ``find_package(PythonInterp)`` before ``find_package(PythonLibs)``.  This
+  ensures that the detected interpreter version is used to guide the selection
+  of compatible libraries, resulting in a consistent ``PYTHON_LIBRARIES`` value.
 
-  PYTHONLIBS_FOUND           - have the Python libs been found
-  PYTHON_LIBRARIES           - path to the python library
-  PYTHON_INCLUDE_PATH        - path to where Python.h is found (deprecated)
-  PYTHON_INCLUDE_DIRS        - path to where Python.h is found
-  PYTHON_DEBUG_LIBRARIES     - path to the debug library (deprecated)
-  PYTHONLIBS_VERSION_STRING  - version of the Python libs found (since CMake 2.8.8)
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
+``PythonLibs_FOUND``
+  Boolean indicating whether the (requested version of) Python libraries have
+  been found.  For backward compatibility, the ``PYTHONLIBS_FOUND`` variable is
+  also set to the same value.
 
-The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
-of version numbers that should be taken into account when searching
-for Python.  You need to set this variable before calling
-find_package(PythonLibs).
+``PYTHONLIBS_VERSION_STRING``
+  The version of the Python libraries found.
 
-If you'd like to specify the installation of Python to use, you should
-modify the following cache variables:
+``PYTHON_LIBRARIES``
+  Libraries needed to link against to use Python.
 
-::
+``PYTHON_INCLUDE_DIRS``
+  Include directories needed to use Python.
 
-  PYTHON_LIBRARY             - path to the python library
-  PYTHON_INCLUDE_DIR         - path to where Python.h is found
+Cache Variables
+^^^^^^^^^^^^^^^
 
-If calling both ``find_package(PythonInterp)`` and
-``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
-get the currently active Python version by default with a consistent version
-of PYTHON_LIBRARIES.
+The following cache variables may also be set to specify the Python installation
+to use:
+
+``PYTHON_LIBRARY``
+  The path to the Python library.
+
+``PYTHON_INCLUDE_DIR``
+  The directory containing the ``Python.h`` header file.
+
+Hints
+^^^^^
+
+This module accepts the following variables before calling
+``find_package(PythonLibs)``:
+
+``Python_ADDITIONAL_VERSIONS``
+  This variable can be used to specify a list of version numbers that should be
+  taken into account when searching for Python.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
+
+These variables are provided for backward compatibility:
+
+``PYTHON_DEBUG_LIBRARIES``
+  .. deprecated:: 2.8.8
+    Use ``PYTHON_LIBRARIES`` instead.
+
+  Result variable that holds the path to the debug library.
+
+``PYTHON_INCLUDE_PATH``
+  .. deprecated:: 2.8.0
+    Use ``PYTHON_INCLUDE_DIR`` or ``PYTHON_INCLUDE_DIRS`` instead.
+
+  Result variable that holds the path to the directory containing the
+  ``Python.h`` header file.
+
+Examples
+^^^^^^^^
+
+In earlier versions of CMake, Python libraries were found and used in a project
+like this:
+
+.. code-block:: cmake
+
+  find_package(PythonLibs)
+  target_link_libraries(app PRIVATE ${PYTHON_LIBRARIES})
+  target_include_directories(app PRIVATE ${PYTHON_INCLUDE_DIRS})
+
+Starting with CMake 3.12, Python libraries can be found using the
+:module:`FindPython` module.  The equivalent example using the modern approach
+with an imported target is:
+
+.. code-block:: cmake
+
+  find_package(Python COMPONENTS Development)
+  target_link_libraries(app PRIVATE Python::Python)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 31d4c0b..98cd1e2 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -6,35 +6,56 @@
 ------
 
 .. deprecated:: 3.14
-  This module is available only if policy :policy:`CMP0084` is not set to ``NEW``.
 
-Searches for all installed versions of Qt3 or Qt4.
+  This module is available only if policy :policy:`CMP0084` is not set to
+  ``NEW``.  It supports only Qt3 and Qt4.  For Qt5 or later versions see
+  :manual:`cmake-qt(7)`.
 
-This module cannot handle Qt5 or any later versions.
-For those, see :manual:`cmake-qt(7)`.
+This module finds an installed version of Qt3 or Qt4.  Qt is a cross-platform
+application development framework for creating graphical user interfaces and
+applications.
 
-This module should only be used if your project can work with multiple
-versions of Qt.  If not, you should just directly use FindQt4 or
-FindQt3.  If multiple versions of Qt are found on the machine, then
-The user must set the option DESIRED_QT_VERSION to the version they
-want to use.  If only one version of qt is found on the machine, then
-the DESIRED_QT_VERSION is set to that version and the matching FindQt3
-or FindQt4 module is included.  Once the user sets DESIRED_QT_VERSION,
-then the FindQt3 or FindQt4 module is included.
+Use this module only if the project can work with both Qt3 and Qt4
+versions.  If a specific version is required, use :module:`FindQt4` or
+:module:`FindQt3` module directly.
 
-::
+Behavior:
 
-  QT_REQUIRED if this is set to TRUE then if CMake can
-              not find Qt4 or Qt3 an error is raised
-              and a message is sent to the user.
+* If multiple Qt versions are found, the user must set the preferred major
+  Qt version with the ``DESIRED_QT_VERSION`` variable.
+* If only one Qt version is found, then the ``DESIRED_QT_VERSION`` is set
+  automatically.
+* Once the ``DESIRED_QT_VERSION`` variable is set, the corresponding
+  :module:`FindQt3` or :module:`FindQt4` module is included.
 
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module sets the following variables:
 
-::
+``QT4_INSTALLED``
+  ``TRUE`` if Qt4 is found.
+``QT3_INSTALLED``
+  ``TRUE`` if Qt3 is found.
 
-  DESIRED_QT_VERSION OPTION is created
-  QT4_INSTALLED is set to TRUE if qt4 is found.
-  QT3_INSTALLED is set to TRUE if qt3 is found.
+Hints
+^^^^^
+
+``QT_REQUIRED``
+  If this variable is set to ``TRUE`` before calling ``find_package(Qt)``,
+  CMake will raise an error if neither Qt3 nor Qt4 is found.
+``DESIRED_QT_VERSION``
+  Specifies the Qt major version to use.  Can be either ``3``, ``4``, or empty,
+  to search for version automatically.
+
+Examples
+^^^^^^^^
+
+Finding Qt3 or Qt4 version:
+
+.. code-block:: cmake
+
+  find_package(Qt)
 #]=======================================================================]
 
 if(_findqt_testing)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 594fc63..2c62a5f 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -5,33 +5,78 @@
 FindQt3
 -------
 
-Locate Qt include paths and libraries
+This module finds Qt3, a cross-platform application development framework for
+creating graphical user interfaces and applications.
 
-This module defines:
+.. note::
 
-::
+  This module is for Qt version 3.  As of Qt version 5, the Qt upstream also
+  provides an exported configuration to find Qt.  New code should follow the
+  :manual:`cmake-qt(7)` instead of using this module.
 
-  QT_INCLUDE_DIR    - where to find qt.h, etc.
-  QT_LIBRARIES      - the libraries to link against to use Qt.
-  QT_DEFINITIONS    - definitions to use when
-                      compiling code that uses Qt.
-  QT_FOUND          - If false, don't try to use Qt.
-  QT_VERSION_STRING - the version of Qt found
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module sets the following variables:
 
+``Qt3_FOUND``
+  True if Qt3 has been found.
+``QT_FOUND``
+  True if Qt3 has been found.  This variable is for compatibility with other Qt
+  find modules.
+``QT_VERSION_STRING``
+  The version of Qt3 that was found.
+``QT_LIBRARIES``
+  Libraries needed to link against for using Qt3.
+``QT_DEFINITIONS``
+  A list of compile definitions to use when compiling code that uses Qt3.
 
-If you need the multithreaded version of Qt, set QT_MT_REQUIRED to
-TRUE
+Cache Variables
+^^^^^^^^^^^^^^^
 
-Also defined, but not for general use are:
+The following cache variables may also be set:
 
-::
+``QT_INCLUDE_DIR``
+  The directory containing ``qt.h`` and other Qt3 header files.
 
-  QT_MOC_EXECUTABLE, where to find the moc tool.
-  QT_UIC_EXECUTABLE, where to find the uic tool.
-  QT_QT_LIBRARY, where to find the Qt library.
-  QT_QTMAIN_LIBRARY, where to find the qtmain
-   library. This is only required by Qt3 on Windows.
+The following cache variables may also be set but are not meant for general use:
+
+``QT_MOC_EXECUTABLE``
+  Path to the ``moc`` tool.
+``QT_UIC_EXECUTABLE``
+  Path to the ``uic`` tool.
+``QT_QT_LIBRARY``
+  Path to the Qt3 library.
+``QT_QTMAIN_LIBRARY``
+  Path to the ``qtmain`` library.  This is only required by Qt3 on Windows.
+
+Hints
+^^^^^
+
+``QT_MT_REQUIRED``
+  To search for the multithreaded version of Qt3, set this variable to ``TRUE``
+  before looking for Qt3.
+
+Examples
+^^^^^^^^
+
+Finding Qt3 on the system:
+
+.. code-block:: cmake
+
+  find_package(Qt3)
+  if(Qt3_FOUND)
+    target_link_libraries(foo PRIVATE ${QT_LIBRARIES})
+    target_include_directories(foo PRIVATE ${QT_INCLUDE_DIR})
+    target_compile_definitions(foo PRIVATE ${QT_DEFINITIONS})
+  endif()
+
+Looking for the multithreaded version of Qt3:
+
+.. code-block:: cmake
+
+  set(QT_MT_REQUIRED TRUE)
+  find_package(Qt3)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 580e1e2..2c9e39f 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -5,32 +5,26 @@
 FindQt4
 -------
 
-Finding and Using Qt4
-^^^^^^^^^^^^^^^^^^^^^
-
-This module can be used to find Qt4.  The most important issue is that
-the Qt4 qmake is available via the system path.  This qmake is then
-used to detect basically everything else.  This module defines a
-number of :prop_tgt:`IMPORTED` targets, macros and variables.
-
-Typical usage could be something like:
-
-.. code-block:: cmake
-
-   set(CMAKE_AUTOMOC ON)
-   set(CMAKE_INCLUDE_CURRENT_DIR ON)
-   find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
-   add_executable(myexe main.cpp)
-   target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
+This module finds Qt4, a cross-platform application development framework for
+creating graphical user interfaces and applications.  It defines a number of
+imported targets, macros, and variables to use Qt4 in the project.
 
 .. note::
 
- When using :prop_tgt:`IMPORTED` targets, the qtmain.lib static library is
- automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>`
- executables. To disable that globally, set the
- ``QT4_NO_LINK_QTMAIN`` variable before finding Qt4. To disable that
- for a particular executable, set the ``QT4_NO_LINK_QTMAIN`` target
- property to ``TRUE`` on the executable.
+  This module is for Qt version 4.  As of Qt version 5, the Qt upstream also
+  provides an exported configuration to find Qt.  New code should follow the
+  :manual:`cmake-qt(7)` instead of using this module.
+
+To detect the Qt4 package, the Qt4 ``qmake`` tool is required and must be
+available in the system path.
+
+.. note::
+
+  When using :ref:`Imported Targets`, the ``qtmain.lib`` static library is
+  automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>`
+  executables.  To disable this globally, set the ``QT4_NO_LINK_QTMAIN``
+  variable before finding Qt4.  To disable this for a particular executable,
+  set the ``QT4_NO_LINK_QTMAIN`` target property to ``TRUE`` on that executable.
 
 Qt Build Tools
 ^^^^^^^^^^^^^^
@@ -41,264 +35,415 @@
 automatically invoked by :manual:`cmake(1)` if the appropriate conditions
 are met.  See :manual:`cmake-qt(7)` for more.
 
-Qt Macros
-^^^^^^^^^
-
-In some cases it can be necessary or useful to invoke the Qt build tools in a
-more-manual way. Several macros are available to add targets for such uses.
-
-::
-
-  macro QT4_WRAP_CPP(outfiles inputfile ... [TARGET tgt] OPTIONS ...)
-        create moc code from a list of files containing Qt class with
-        the Q_OBJECT declaration.  Per-directory preprocessor definitions
-        are also added.  If the <tgt> is specified, the
-        INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
-        the <tgt> are passed to moc.  Options may be given to moc, such as
-        those found when executing "moc -help".
-
-
-::
-
-  macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
-        create code from a list of Qt designer ui files.
-        Options may be given to uic, such as those found
-        when executing "uic -help"
-
-
-::
-
-  macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
-        create code from a list of Qt resource files.
-        Options may be given to rcc, such as those found
-        when executing "rcc -help"
-
-
-::
-
-  macro QT4_GENERATE_MOC(inputfile outputfile [TARGET tgt])
-        creates a rule to run moc on infile and create outfile.
-        Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
-        because you need a custom filename for the moc file or something
-        similar.  If the <tgt> is specified, the
-        INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
-        the <tgt> are passed to moc.
-
-
-::
-
-  macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
-        Create the interface header and implementation files with the
-        given basename from the given interface xml file and add it to
-        the list of sources.
-
-        You can pass additional parameters to the qdbusxml2cpp call by setting
-        properties on the input file:
-
-        INCLUDE the given file will be included in the generate interface header
-
-        CLASSNAME the generated class is named accordingly
-
-        NO_NAMESPACE the generated class is not wrapped in a namespace
-
-
-::
-
-  macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
-        Create the interface header and implementation files
-        for all listed interface xml files.
-        The basename will be automatically determined from the name
-        of the xml file.
-
-        The source file properties described for
-        QT4_ADD_DBUS_INTERFACE also apply here.
-
-
-::
-
-  macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname
-                             [basename] [classname])
-        create a dbus adaptor (header and implementation file) from the xml file
-        describing the interface, and add it to the list of sources. The adaptor
-        forwards the calls to a parent class, defined in parentheader and named
-        parentclassname. The name of the generated files will be
-        <basename>adaptor.{cpp,h} where basename defaults to the basename of the
-        xml file.
-        If <classname> is provided, then it will be used as the classname of the
-        adaptor itself.
-
-
-::
-
-  macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
-        generate the xml interface file from the given header.
-        If the optional argument interfacename is omitted, the name of the
-        interface file is constructed from the basename of the header with
-        the suffix .xml appended.
-        Options may be given to qdbuscpp2xml, such as those found when
-        executing "qdbuscpp2xml --help"
-
-
-::
-
-  macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
-                                ts_files ... OPTIONS ...)
-        out: qm_files
-        in:  directories sources ts_files
-        options: flags to pass to lupdate, such as -extensions to specify
-        extensions for a directory scan.
-        generates commands to create .ts (via lupdate) and .qm
-        (via lrelease) - files from directories and/or sources. The ts files are
-        created and/or updated in the source tree (unless given with full paths).
-        The qm files are generated in the build tree.
-        Updating the translations can be done by adding the qm_files
-        to the source list of your library/executable, so they are
-        always updated, or by adding a custom target to control when
-        they get updated/generated.
-
-
-::
-
-  macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
-        out: qm_files
-        in:  ts_files
-        generates commands to create .qm from .ts - files. The generated
-        filenames can be found in qm_files. The ts_files
-        must exist and are not updated in any way.
-
-
-::
-
-  macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... [TARGET tgt])
-        The qt4_automoc macro is obsolete.  Use the CMAKE_AUTOMOC feature instead.
-        This macro is still experimental.
-        It can be used to have moc automatically handled.
-        So if you have the files foo.h and foo.cpp, and in foo.h a
-        a class uses the Q_OBJECT macro, moc has to run on it. If you don't
-        want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
-        #include "foo.moc"
-        in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will
-        scan all listed files at cmake-time for such included moc files and if it
-        finds them cause a rule to be generated to run moc at build time on the
-        accompanying header file foo.h.
-        If a source file has the SKIP_AUTOMOC property set it will be ignored by
-        this macro.
-        If the <tgt> is specified, the INTERFACE_INCLUDE_DIRECTORIES and
-        INTERFACE_COMPILE_DEFINITIONS from the <tgt> are passed to moc.
-
-
-::
-
- function QT4_USE_MODULES( target [link_type] modules...)
-        This function is obsolete. Use target_link_libraries with IMPORTED targets
-        instead.
-        Make <target> use the <modules> from Qt. Using a Qt module means
-        to link to the library, add the relevant include directories for the
-        module, and add the relevant compiler defines for using the module.
-        Modules are roughly equivalent to components of Qt4, so usage would be
-        something like:
-         qt4_use_modules(myexe Core Gui Declarative)
-        to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument
-        can be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the
-        same argument to the target_link_libraries call.
-
-
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-A particular Qt library may be used by using the corresponding
-:prop_tgt:`IMPORTED` target with the :command:`target_link_libraries`
-command:
+Qt libraries can be linked using their corresponding
+:ref:`IMPORTED target <Imported Targets>` with the
+:command:`target_link_libraries` command:
 
 .. code-block:: cmake
 
   target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
 
-Using a target in this way causes :cmake(1)` to use the appropriate include
-directories and compile definitions for the target when compiling ``myexe``.
+Linking to an imported target automatically applies the correct include
+directories and compile definitions when building ``myexe``.
 
-Targets are aware of their dependencies, so for example it is not necessary
-to list ``Qt4::QtCore`` if another Qt library is listed, and it is not
-necessary to list ``Qt4::QtGui`` if ``Qt4::QtDeclarative`` is listed.
-Targets may be tested for existence in the usual way with the
-:command:`if(TARGET)` command.
+Imported targets also manage their dependencies, so listing ``Qt4::QtCore`` is
+unnecessary if another Qt library depends on it.  Likewise, ``Qt4::QtGui`` is
+automatically included when linking ``Qt4::QtDeclarative``.  Targets can be
+checked for existence using :command:`if(TARGET)` command.
 
-The Qt toolkit may contain both debug and release libraries.
-:manual:`cmake(1)` will choose the appropriate version based on the build
-configuration.
+If both debug and release versions of a Qt toolkit library are available, CMake
+selects the appropriate one based on the
+:ref:`build configuration <Build Configurations>`.
+
+This module provides the following imported targets, if found:
 
 ``Qt4::QtCore``
- The QtCore target
+  The QtCore target
 ``Qt4::QtGui``
- The QtGui target
+  The QtGui target
 ``Qt4::Qt3Support``
- The Qt3Support target
+  The Qt3Support target
 ``Qt4::QtAssistant``
- The QtAssistant target
+  The QtAssistant target
 ``Qt4::QtAssistantClient``
- The QtAssistantClient target
+  The QtAssistantClient target
 ``Qt4::QAxContainer``
- The QAxContainer target (Windows only)
+  The QAxContainer target (Windows only)
 ``Qt4::QAxServer``
- The QAxServer target (Windows only)
+  The QAxServer target (Windows only)
 ``Qt4::QtDBus``
- The QtDBus target
+  The QtDBus target
 ``Qt4::QtDeclarative``
- The QtDeclarative target
+  The QtDeclarative target
 ``Qt4::QtDesigner``
- The QtDesigner target
+  The QtDesigner target
 ``Qt4::QtDesignerComponents``
- The QtDesignerComponents target
+  The QtDesignerComponents target
 ``Qt4::QtHelp``
- The QtHelp target
+  The QtHelp target
 ``Qt4::QtMotif``
- The QtMotif target
+  The QtMotif target
 ``Qt4::QtMultimedia``
- The QtMultimedia target
+  The QtMultimedia target
 ``Qt4::QtNetwork``
- The QtNetwork target
-``Qt4::QtNsPLugin``
- The QtNsPLugin target
+  The QtNetwork target
+``Qt4::QtNsPlugin``
+  The QtNsPlugin target
 ``Qt4::QtOpenGL``
- The QtOpenGL target
+  The QtOpenGL target
 ``Qt4::QtScript``
- The QtScript target
+  The QtScript target
 ``Qt4::QtScriptTools``
- The QtScriptTools target
+  The QtScriptTools target
 ``Qt4::QtSql``
- The QtSql target
+  The QtSql target
 ``Qt4::QtSvg``
- The QtSvg target
+  The QtSvg target
 ``Qt4::QtTest``
- The QtTest target
+  The QtTest target
 ``Qt4::QtUiTools``
- The QtUiTools target
+  The QtUiTools target
 ``Qt4::QtWebKit``
- The QtWebKit target
+  The QtWebKit target
 ``Qt4::QtXml``
- The QtXml target
+  The QtXml target
 ``Qt4::QtXmlPatterns``
- The QtXmlPatterns target
+  The QtXmlPatterns target
 ``Qt4::phonon``
- The phonon target
+  The phonon target
 
 Result Variables
 ^^^^^^^^^^^^^^^^
 
-  Below is a detailed list of variables that FindQt4.cmake sets.
+This module sets the following variables:
 
 ``Qt4_FOUND``
- If false, don't try to use Qt 4.
+  Boolean whether Qt4 has been found.  If false, don't try to use Qt4.
 ``QT_FOUND``
- If false, don't try to use Qt. This variable is for compatibility only.
+  Boolean whether Qt4 has been found.  If false, don't try to use Qt4.  This
+  variable is for compatibility with other Qt find modules.
 ``QT4_FOUND``
- If false, don't try to use Qt 4. This variable is for compatibility only.
+  Boolean whether Qt4 has been found.  If false, don't try to use Qt4.  This
+  variable is for backward compatibility only.
 ``QT_VERSION_MAJOR``
- The major version of Qt found.
+  The major version of Qt found.
 ``QT_VERSION_MINOR``
- The minor version of Qt found.
+  The minor version of Qt found.
 ``QT_VERSION_PATCH``
- The patch version of Qt found.
+  The patch version of Qt found.
+
+Hints
+^^^^^
+
+``QT4_NO_LINK_QTMAIN``
+  If set to boolean true before finding Qt4, it globally disables linking
+  ``qtmain.lib`` static library on Windows.
+
+Macros
+^^^^^^
+
+In some cases it can be necessary or useful to invoke the Qt build tools in a
+more-manual way.  This module provides the following macros to add targets for
+such uses:
+
+.. command:: qt4_wrap_cpp
+
+  Creates build rules for running ``moc`` on a given list of input files:
+
+  .. code-block:: cmake
+
+    qt4_wrap_cpp(<variable> <files>... [TARGET <target>] [OPTIONS <options>...])
+
+  This macro creates build rules for processing a list of input files
+  ``<files>`` that contain Qt classes with the ``Q_OBJECT`` declaration.
+  Per-directory preprocessor definitions are also added.
+
+  ``<variable>``
+    Name of a variable where a list of generated output files is stored.
+
+  ``<files>``
+    One or more input source files.
+
+  ``TARGET``
+    If specified, the ``INTERFACE_INCLUDE_DIRECTORIES`` and
+    ``INTERFACE_COMPILE_DEFINITIONS`` target properties from the ``<target>``
+    are passed to ``moc``.
+
+  ``OPTIONS``
+    Optional list of options given to ``moc``, such as those found when
+    executing ``moc -help``.
+
+  .. note::
+
+    Instead of using ``qt4_wrap_cpp()``, the :variable:`CMAKE_AUTOMOC` variable
+    can be set to process source files with ``moc`` automatically.
+
+.. command:: qt4_wrap_ui
+
+  Creates build rules for running ``uic`` on a given list of Qt designer ui
+  input files:
+
+  .. code-block:: cmake
+
+    qt4_wrap_ui(<variable> <files>... [OPTIONS <options>...])
+
+  ``<variable>``
+    Name of a variable where a list of generated output filenames is stored.
+
+  ``<files>``
+    One or more Qt designer ui input source files.
+
+  ``OPTIONS``
+    Optional list of options given to ``uic``, such as those found when
+    executing ``uic -help``.
+
+  .. note::
+
+    Instead of using ``qt4_wrap_ui()``, the :variable:`CMAKE_AUTOUIC` variable
+    can be set to process ui files with ``uic`` automatically.
+
+.. command:: qt4_add_resources
+
+  Creates build rules for running ``rcc`` on a given list of input Qt resource
+  files:
+
+  .. code-block:: cmake
+
+    qt4_add_resources(<variable> <files>... [OPTIONS <options>...])
+
+  ``<variable>``
+    Name of a variable where a list of generated output filenames is stored.
+
+  ``<files>``
+    One or more Qt resource input source files.
+
+  ``OPTIONS``
+    Optional list of options given to ``rcc``, such as those found when
+    executing ``rcc -help``.
+
+  .. note::
+
+    Instead of using ``qt4_add_resources()``, the :variable:`CMAKE_AUTORCC`
+    variable can be set to process resource files with ``rcc`` automatically.
+
+.. command:: qt4_generate_moc
+
+  Creates a build rule that generates output file by running ``moc`` on a given
+  input file.
+
+  .. code-block:: cmake
+
+    qt4_generate_moc(<input-file> <output-file> [TARGET <target>])
+
+  This macro creates a build rule for ``<input-file>`` to generate
+  ``<output-file>``.  Use this if for some reason ``qt4_wrap_cpp()`` isn't
+  feasible, e.g. because a custom filename is needed for the moc file or
+  similar.
+
+  ``TARGET``
+    If specified, the ``INTERFACE_INCLUDE_DIRECTORIES`` and
+    ``INTERFACE_COMPILE_DEFINITIONS`` target properties from the ``<target>``
+    are passed to ``moc``.
+
+.. command:: qt4_add_dbus_interface
+
+  Creates the interface header and implementation files from an interface XML
+  file:
+
+  .. code-block:: cmake
+
+    qt4_add_dbus_interface(<variable> <interface-file> <basename>)
+
+  This macro creates the interface header (``<basename>.h``) and implementation
+  files (``<basename>.{cpp,moc}``) from the given interface XML file
+  ``<interface-file>`` and adds it to the variable which contains a list of
+  sources (specified as variable name ``<variable>``).
+
+  Additional parameters can be passed to the ``qdbusxml2cpp`` call by setting
+  the following source file properties on the input file ``<interface-file>``:
+
+  ``INCLUDE``
+    The given file will be included in the generate interface header.
+
+  ``CLASSNAME``
+    The name of the generated class.
+
+  ``NO_NAMESPACE``
+    The generated class will not be wrapped in a namespace.
+
+.. command:: qt4_add_dbus_interfaces
+
+  Creates the interface header and implementation files from multiple interface
+  XML files:
+
+  .. code-block:: cmake
+
+    qt4_add_dbus_interfaces(<variable> <interface-files>...)
+
+  This macro creates the interface header and implementation files for all
+  listed interface XML files ``<interface-files>``.  The basename will be
+  automatically determined from the name of the XML file.  The resulting output
+  files list is stored in a variable ``<variable>``.
+
+  The source file properties described for ``qt4_add_dbus_interface()`` also
+  apply here.
+
+.. command:: qt4_add_dbus_adaptor
+
+  Generates an adaptor class for a D-Bus interface:
+
+  .. code-block:: cmake
+
+    qt4_add_dbus_adaptor(<variable> <xmlfile> <parent-header> <parent-classname>
+                         [<basename>] [<classname>])
+
+  Creates a D-Bus adaptor (header and implementation file) from the XML file
+  describing the interface, and adds it to the list of sources.  The adaptor
+  forwards the calls to a parent class, defined in ``<parent-header>`` and named
+  ``<parent-classname>``.  The generated filenames will be
+  ``<basename>adaptor.{cpp,h}`` where ``<basename>`` defaults to the basename of
+  the XML file if not given.  If ``<classname>`` is provided, then it will be
+  used as the classname of the adaptor itself.  Generated filenames are stored
+  in a variable ``<variable>``.
+
+.. command:: qt4_generate_dbus_interface
+
+  Generates a D-Bus XML interface file from a given header file:
+
+  .. code-block:: cmake
+
+    qt4_generate_dbus_interface(<header> [<interface>] [OPTIONS <options>...])
+
+  This macro creates a build rule to extract declaration from the given
+  ``<header>`` file to generate a corresponding XML interface file.
+
+  ``<header>``
+    Path to header file from which XML interface file is generated.
+
+  ``<interface>``
+    Path to the generated XML interface file.  If this optional argument is
+    omitted, the name of the interface file is constructed from the basename of
+    the header with the suffix ``.xml`` appended.  A relative path is
+    interpreted as relative to :variable:`CMAKE_CURRENT_BINARY_DIR`.
+
+  ``OPTIONS``
+    A list of options that may be given to ``qdbuscpp2xml``, such as those found
+    when executing ``qdbuscpp2xml --help``.
+
+.. command:: qt4_create_translation
+
+  Creates build rules for generating TS and QM files:
+
+  .. code-block:: cmake
+
+    qt4_create_translation(<qm-files-var> <directories>... <sources>...
+                           <ts-files>... [OPTIONS <options>...])
+
+  This macro creates build rules to generate TS (Translation Source files
+  ``.ts``) files via ``lupdate`` and QM (Qt Message files ``.qm``) files via
+  ``lrelease`` from the given ``<directories>`` and/or ``<sources>``.  The TS
+  files are created and/or updated in the source tree (unless given with full
+  paths).  The QM files are generated in the build tree.
+
+  ``<qm-files-var>``
+    A list of generated QM files is stored in this variable.  Updating the
+    translations can be done by adding the ``<qm-files-var>`` to the source list
+    of the project library/executable, so they are always updated, or by adding
+    a custom target to control when they get updated/generated.
+
+  ``<directories>``
+    A list of directories containing source files.
+
+  ``<sources>``
+    A list of source files.
+
+  ``<ts-files>``
+    A list of TS (Translation Source) files.
+
+  ``OPTIONS``
+    Optional list of flags passed to ``lupdate``, such as ``-extensions``, to
+    specify file extensions for directory scanning.
+
+.. command:: qt4_add_translation
+
+  Creates build rules for generating QM files from the given TS files:
+
+  .. code-block:: cmake
+
+    qt4_add_translation(<qm-files-var> <ts-files>...)
+
+  This macro creates build rules for generating QM files from the given TS files
+  and stores a list of generated filenames of QM files in the ``<qm-files-var>``
+  variable.  The ``<ts-files>`` must exist and are not updated in any way.
+
+.. command:: qt4_automoc
+
+  .. deprecated:: 2.8.11
+
+    Use feature provided by the :variable:`CMAKE_AUTOMOC` variable instead.
+
+  Runs ``moc`` on input files:
+
+  .. code-block:: cmake
+
+    qt4_automoc(<source-files>... [TARGET <target>])
+
+  This macro can be used to have ``moc`` automatically handled.  For example, if
+  there are ``foo.h`` and ``foo.cpp`` files, and in ``foo.h`` a class uses the
+  ``Q_OBJECT`` preprocessor macro, ``moc`` has to run on it.  If using
+  ``qt4_wrap_cpp()`` isn't wanted (however, it is reliable and mature), the
+  ``#include "foo.moc"`` can be inserted in ``foo.cpp`` and then ``foo.cpp``
+  given as argument to ``qt4_automoc()``.  This will scan all listed files
+  ``<source-files>`` at configuration phase for such included moc files and if
+  it finds them, a rule is generated to run moc at build time on the
+  accompanying header file ``foo.h``.  If a source file has the
+  :prop_sf:`SKIP_AUTOMOC` property set, file will be ignored by this macro.
+
+  ``TARGET``
+    If specified, the ``INTERFACE_INCLUDE_DIRECTORIES`` and
+    ``INTERFACE_COMPILE_DEFINITIONS`` target properties from the ``<target>``
+    are passed to ``moc``.
+
+.. command:: qt4_use_modules
+
+  .. deprecated:: 2.8.11
+
+    Use :command:`target_link_libraries` with :ref:`Imported Targets` instead.
+
+  Provides Qt modules to a project for linking them to a target:
+
+  .. code-block:: cmake
+
+    qt4_use_modules(<target> [<LINK_PUBLIC|LINK_PRIVATE>] <modules>...)
+
+  This function makes ``<target>`` use the ``<modules>`` from Qt.  Using a Qt
+  module means to link to the library, add the relevant include directories for
+  the module, and add the relevant compiler defines for using the module.
+  Modules are roughly equivalent to Qt4 components.
+
+  ``LINK_PUBLIC`` or ``LINK_PRIVATE``
+    Optional linking mode, used as the corresponding argument in the
+    ``target_link_libraries()`` call.
+
+  For example, calling ``qt4_use_modules(myexe Core Gui Declarative)`` will use
+  the ``QtCore``, ``QtGui`` and ``QtDeclarative`` components on the project
+  target ``myexe``.
+
+Examples
+^^^^^^^^
+
+Typical usage to find Qt4, could be something like:
+
+.. code-block:: cmake
+
+  set(CMAKE_AUTOMOC ON)
+  set(CMAKE_INCLUDE_CURRENT_DIR ON)
+  find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
+  add_executable(myexe main.cpp)
+  target_link_libraries(myexe PRIVATE Qt4::QtGui Qt4::QtXml)
 #]=======================================================================]
 
 # Use find_package( Qt4 COMPONENTS ... ) to enable modules
@@ -333,10 +478,12 @@
 
 
 include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSymbolExists.cmake)
-include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
 include(FindPackageHandleStandardArgs)
 include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
 
+# Included for backward compatibility, otherwise unused.
+include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
+
 set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
 
 set( QT_DEFINITIONS "")
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index 5df14ca..3f6b5ee 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -5,18 +5,54 @@
 FindQuickTime
 -------------
 
-Locate QuickTime This module defines:
+Finds the QuickTime multimedia framework, which provides support for video,
+audio, and interactive media.
+
+.. note::
+
+  This module is for the QuickTime framework, which has been deprecated by Apple
+  and is no longer supported.  On Apple systems, use AVFoundation and AVKit
+  instead.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``QuickTime_FOUND``
+  Boolean indicating whether the QuickTime is found.  For backward
+  compatibility, the ``QUICKTIME_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
 
 ``QUICKTIME_LIBRARY``
+  The path to the QuickTime library.
 
-``QUICKTIME_FOUND``
-  if false, do not try to link to gdal
 ``QUICKTIME_INCLUDE_DIR``
-  where to find the headers
+  Directory containing QuickTime headers.
 
-``$QUICKTIME_DIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$QUICKTIME_DIR
+This module accepts the following variables:
+
+``QUICKTIME_DIR``
+  Environment variable that can be set to help locate a QuickTime library
+  installed in a custom location.  It should point to the installation
+  destination that was used when configuring, building, and installing QuickTime
+  library: ``./configure --prefix=$QUICKTIME_DIR``.
+
+Examples
+^^^^^^^^
+
+Finding QuickTime library:
+
+.. code-block:: cmake
+
+  find_package(QuickTime)
 #]=======================================================================]
 
 find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h QuickTime.h
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index 0431f09..6a1a024 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -5,33 +5,43 @@
 FindRTI
 -------
 
-Try to find M&S HLA RTI libraries
+Finds HLA RTI standard libraries and their include directories.
 
-This module finds if any HLA RTI is installed and locates the standard
-RTI include files and libraries.
+`RTI <https://en.wikipedia.org/wiki/Run-time_infrastructure_(simulation)>`_
+(Run-Time Infrastructure) is a simulation infrastructure standardized by IEEE
+and SISO, required when implementing HLA (High Level Architecture).  It provides
+a well-defined C++ API, ensuring that M&S (Modeling and Simulation) applications
+remain independent of a particular RTI implementation.
 
-RTI is a simulation infrastructure standardized by IEEE and SISO.  It
-has a well defined C++ API that assures that simulation applications
-are independent on a particular RTI implementation.
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
+``RTI_FOUND``
+  Set to FALSE if any HLA RTI was not found.
+``RTI_LIBRARIES``
+  The libraries to link against to use RTI.
+``RTI_DEFINITIONS``
+  Compile definitions for using RTI.  Default value is set to
+  ``-DRTI_USES_STD_FSTREAM``.
 
+Cache Variables
+^^^^^^^^^^^^^^^
 
+The following cache variables may also be set:
 
-This code sets the following variables:
+``RTI_INCLUDE_DIR``
+  Directory where RTI include files are found.
 
-::
+Examples
+^^^^^^^^
 
-  RTI_INCLUDE_DIR = the directory where RTI includes file are found
-  RTI_LIBRARIES = The libraries to link against to use RTI
-  RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
-  RTI_FOUND = Set to FALSE if any HLA RTI was not found
+Finding RTI:
 
+.. code-block:: cmake
 
-
-Report problems to <certi-devel@nongnu.org>
+  find_package(RTI)
 #]=======================================================================]
 
 macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
@@ -43,8 +53,12 @@
 set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
 
 # noqa: spellcheck off
-# Detect the CERTI installation, http://www.cert.fr/CERTI
-# Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
+# Detect the CERTI installation:
+#   - https://www.nongnu.org/certi/
+#   - Mailing list for reporting issues and development discussions:
+#     <certi-devel@nongnu.org>
+# Detect the MAK Technologies RTI installation:
+#   - https://www.mak.com/mak-one/tools/mak-rti
 # note: the following list is ordered to find the most recent version first
 set(RTI_POSSIBLE_DIRS
   ENV CERTI_HOME
@@ -100,5 +114,3 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(RTI DEFAULT_MSG
   RTI_LIBRARY RTI_INCLUDE_DIR)
-
-# $Id$
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 3881319..18b9e35 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -354,10 +354,10 @@
 
 if (Ruby_VERSION_MAJOR)
   set(Ruby_VERSION "${Ruby_VERSION_MAJOR}.${Ruby_VERSION_MINOR}.${Ruby_VERSION_PATCH}")
+  set(_Ruby_VERSION_NODOT "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}${Ruby_VERSION_PATCH}")
+  set(_Ruby_VERSION_NODOT_ZERO_PATCH "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}0")
   set(_Ruby_VERSION_SHORT "${Ruby_VERSION_MAJOR}.${Ruby_VERSION_MINOR}")
   set(_Ruby_VERSION_SHORT_NODOT "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}")
-  set(_Ruby_NODOT_VERSION "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}${Ruby_VERSION_PATCH}")
-  set(_Ruby_NODOT_VERSION_ZERO_PATCH "${Ruby_VERSION_MAJOR}${Ruby_VERSION_MINOR}0")
 endif ()
 
 # FIXME: Currently we require both the interpreter and development components to be found
@@ -385,31 +385,34 @@
   set(Ruby_INCLUDE_DIRS ${Ruby_INCLUDE_DIRS} ${Ruby_CONFIG_INCLUDE_DIR})
 endif ()
 
-# Determine the list of possible names for the Ruby shared library
-set(_Ruby_POSSIBLE_LIB_NAMES ruby ruby-static ruby${_Ruby_VERSION_SHORT} ruby${_Ruby_VERSION_SHORT_NODOT} ruby${_Ruby_NODOT_VERSION} ruby-${_Ruby_VERSION_SHORT} ruby-${Ruby_VERSION})
+# Determine the list of possible names for the ruby library
+set(_Ruby_POSSIBLE_LIB_NAMES
+  ruby
+  ruby-static
+  ruby-${Ruby_VERSION}
+  ruby${_Ruby_VERSION_NODOT}
+  ruby${_Ruby_VERSION_NODOT_ZERO_PATCH}
+  ruby-${_Ruby_VERSION_SHORT}
+  ruby${_Ruby_VERSION_SHORT}
+  ruby${_Ruby_VERSION_SHORT_NODOT}
+)
 
 if (WIN32)
-  set(_Ruby_POSSIBLE_MSVC_RUNTIMES "ucrt;msvcrt;vcruntime140;vcruntime140_1")
-  if (MSVC_TOOLSET_VERSION)
-    list(APPEND _Ruby_POSSIBLE_MSVC_RUNTIMES "msvcr${MSVC_TOOLSET_VERSION}")
-  else ()
-    list(APPEND _Ruby_POSSIBLE_MSVC_RUNTIMES "msvcr")
-  endif ()
-
-  set(_Ruby_POSSIBLE_VERSION_SUFFICES "${_Ruby_NODOT_VERSION};${_Ruby_NODOT_VERSION_ZERO_PATCH}")
+  set(_Ruby_POSSIBLE_RUNTIMES "ucrt;msvcrt;vcruntime140;vcruntime140_1;vcruntime${MSVC_TOOLSET_VERSION}")
+  set(_Ruby_POSSIBLE_VERSION_SUFFIXES "${_Ruby_VERSION_NODOT};${_Ruby_VERSION_NODOT_ZERO_PATCH}")
 
   if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-    set(_Ruby_POSSIBLE_ARCH_PREFIXS "libx64-;x64-")
+    set(_Ruby_POSSIBLE_ARCH_PREFIXES "libx64-;x64-")
   else ()
-    set(_Ruby_POSSIBLE_ARCH_PREFIXS "lib")
+    set(_Ruby_POSSIBLE_ARCH_PREFIXES "lib")
   endif ()
 
-  foreach (_Ruby_MSVC_RUNTIME ${_Ruby_POSSIBLE_MSVC_RUNTIMES})
-    foreach (_Ruby_VERSION_SUFFIX ${_Ruby_POSSIBLE_VERSION_SUFFICES})
-      foreach (_Ruby_ARCH_PREFIX ${_Ruby_POSSIBLE_ARCH_PREFIXS})
+  foreach (_Ruby_RUNTIME ${_Ruby_POSSIBLE_RUNTIMES})
+    foreach (_Ruby_VERSION_SUFFIX ${_Ruby_POSSIBLE_VERSION_SUFFIXES})
+      foreach (_Ruby_ARCH_PREFIX ${_Ruby_POSSIBLE_ARCH_PREFIXES})
         list(APPEND _Ruby_POSSIBLE_LIB_NAMES
-             "${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}"
-             "${_Ruby_ARCH_PREFIX}${_Ruby_MSVC_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}-static")
+             "${_Ruby_ARCH_PREFIX}${_Ruby_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}"
+             "${_Ruby_ARCH_PREFIX}${_Ruby_RUNTIME}-ruby${_Ruby_VERSION_SUFFIX}-static")
       endforeach ()
     endforeach ()
   endforeach ()
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 0e85990..a720dcc 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -5,109 +5,171 @@
 FindSDL
 -------
 
-Locate the SDL library
+Finds the SDL (Simple DirectMedia Layer) library.  SDL is a cross-platform
+library for developing multimedia software, such as games and emulators.
 
+.. note::
+
+  This module is specifically intended for SDL version 1.  Starting with version
+  2, SDL provides a CMake package configuration file when built with CMake and
+  should be found using ``find_package(SDL2)``.  Similarly, SDL version 3 can be
+  found using ``find_package(SDL3)``.  These newer versions provide separate
+  :ref:`Imported Targets` that encapsulate usage requirements.  Refer to the
+  official SDL documentation for more information.
+
+Note that the include path for the SDL header has changed in recent SDL 1
+versions from ``SDL/SDL.h`` to simply ``SDL.h``.  This change aligns with SDL's
+convention of using ``#include "SDL.h"`` for portability, as not all systems
+install the headers in a ``SDL/`` subdirectory (e.g., FreeBSD).
+
+When targeting macOS and using the SDL framework, be sure to include both
+``SDLmain.h`` and ``SDLmain.m`` in the project.  For other platforms, the
+``SDLmain`` library is typically linked using ``-lSDLmain``, which this module
+will attempt to locate automatically.  Additionally, for macOS, this module will
+add the ``-framework Cocoa`` flag as needed.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.19
-
-This module defines the following :prop_tgt:`IMPORTED` target:
+This module provides the following :ref:`Imported Targets`:
 
 ``SDL::SDL``
-  The SDL library, if found
+  .. versionadded:: 3.19
 
-Result variables
+  Target encapsulating the SDL library usage requirements, available if SDL is
+  found.
+
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
+
+``SDL_FOUND``
+  Boolean indicating whether the (requested version of) SDL is found.
+
+``SDL_VERSION``
+  .. versionadded:: 3.19
+
+  The human-readable string containing the version of SDL found.
+
+``SDL_VERSION_MAJOR``
+  .. versionadded:: 3.19
+
+  The major version of SDL found.
+
+``SDL_VERSION_MINOR``
+  .. versionadded:: 3.19
+
+  The minor version of SDL found.
+
+``SDL_VERSION_PATCH``
+  .. versionadded:: 3.19
+
+  The patch version of SDL found.
 
 ``SDL_INCLUDE_DIRS``
-  where to find SDL.h
+  .. versionadded:: 3.19
+
+  Include directories needed to use SDL.
+
 ``SDL_LIBRARIES``
-  the name of the library to link against
-``SDL_FOUND``
-  if false, do not try to link to SDL
-``SDL_VERSION``
-  the human-readable string containing the version of SDL if found
-``SDL_VERSION_MAJOR``
-  SDL major version
-``SDL_VERSION_MINOR``
-  SDL minor version
-``SDL_VERSION_PATCH``
-  SDL patch version
+  .. versionadded:: 3.19
 
-.. versionadded:: 3.19
-  Added the ``SDL_INCLUDE_DIRS``, ``SDL_LIBRARIES`` and ``SDL_VERSION[_<PART>]``
-  variables.
+  Libraries needed to link against to use SDL.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
-These variables may optionally be set to help this module find the correct files:
+These variables may optionally be set to help this module find the correct
+files:
 
 ``SDL_INCLUDE_DIR``
-  where to find SDL.h
+  The directory containing the ``SDL.h`` header file.
 ``SDL_LIBRARY``
-  the name of the library to link against
+  A list of libraries containing the path to the SDL library and libraries
+  needed to link against to use SDL.
 
+Hints
+^^^^^
 
-Variables for locating SDL
-^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-This module responds to the flag:
+This module accepts the following variables:
 
 ``SDL_BUILDING_LIBRARY``
-    If this is defined, then no SDL_main will be linked in because
-    only applications need main().
-    Otherwise, it is assumed you are building an application and this
-    module will attempt to locate and set the proper link flags
-    as part of the returned SDL_LIBRARY variable.
+  When set to boolean true, the ``SDL_main`` library will be excluded from
+  linking, as it is not required when building the SDL library itself (only
+  applications need ``main()`` function).  If not set, this module assumes an
+  application is being built and attempts to locate and include the appropriate
+  ``SDL_main`` link flags in the returned ``SDL_LIBRARY`` variable.
 
+``SDLDIR``
+  Environment variable that can be set to help locate an SDL library installed
+  in a custom location.  It should point to the installation destination that
+  was used when configuring, building, and installing SDL library:
+  ``./configure --prefix=$SDLDIR``.
 
-Obsolete variables
-^^^^^^^^^^^^^^^^^^
+  On macOS, setting this variable will prefer the Framework version (if found)
+  over others.  In this case, the cache value of ``SDL_LIBRARY`` would need to
+  be manually changed to override this selection or set the
+  :variable:`CMAKE_INCLUDE_PATH` variable to modify the search paths.
 
-.. deprecated:: 3.19
+Troubleshooting
+^^^^^^^^^^^^^^^
+
+In case the SDL library is not found automatically, the ``SDL_LIBRARY_TEMP``
+variable may be empty, and ``SDL_LIBRARY`` will not be set.  This typically
+means that CMake could not locate the SDL library (e.g., ``SDL.dll``,
+``libSDL.so``, ``SDL.framework``, etc.).  To resolve this, manually set
+``SDL_LIBRARY_TEMP`` to the correct path and reconfigure the project.
+Similarly, if ``SDLMAIN_LIBRARY`` is unset, it may also need to be specified
+manually.  These variables are used to construct the final ``SDL_LIBRARY``
+value.  If they are not set, ``SDL_LIBRARY`` will remain undefined.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
 These variables are obsolete and provided for backwards compatibility:
 
 ``SDL_VERSION_STRING``
-  the human-readable string containing the version of SDL if found.
-  Identical to SDL_VERSION
+  .. deprecated:: 3.19
+    Superseded by the ``SDL_VERSION`` with the same value.
 
+  The human-readable string containing the version of SDL if found.
 
-Don't forget to include SDLmain.h and SDLmain.m your project for the
-OS X framework based version.  (Other versions link to -lSDLmain which
-this module will try to find on your behalf.) Also for OS X, this
-module will automatically add the -framework Cocoa on your behalf.
+Examples
+^^^^^^^^
 
+Finding SDL library and linking it to a project target:
 
+.. code-block:: cmake
 
-Additional Note: If you see an empty SDL_LIBRARY_TEMP in your
-configuration and no SDL_LIBRARY, it means CMake did not find your SDL
-library (SDL.dll, libsdl.so, SDL.framework, etc).  Set
-SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
-Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this
-value as appropriate.  These values are used to generate the final
-SDL_LIBRARY variable, but when these values are unset, SDL_LIBRARY
-does not get created.
+  find_package(SDL)
+  target_link_libraries(project_target PRIVATE SDL::SDL)
 
+When working with SDL version 2, the upstream package provides the
+``SDL2::SDL2`` imported target directly.  It can be used in a project without
+using this module:
 
+.. code-block:: cmake
 
-$SDLDIR is an environment variable that would correspond to the
-./configure --prefix=$SDLDIR used in building SDL.  l.e.galup 9-20-02
+  find_package(SDL2)
+  target_link_libraries(project_target PRIVATE SDL2::SDL2)
 
-On OSX, this will prefer the Framework version (if found) over others.
-People will have to manually change the cache values of SDL_LIBRARY to
-override this selection or set the CMake environment
-CMAKE_INCLUDE_PATH to modify the search paths.
+Similarly, for SDL version 3:
 
-Note that the header path has changed from SDL/SDL.h to just SDL.h
-This needed to change because "proper" SDL convention is #include
-"SDL.h", not <SDL/SDL.h>.  This is done for portability reasons
-because not all systems place things in SDL/ (see FreeBSD).
+.. code-block:: cmake
+
+  find_package(SDL3)
+  target_link_libraries(project_target PRIVATE SDL3::SDL3)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindSDL_gfx` module to find the SDL_gfx library.
+* The :module:`FindSDL_image` module to find the SDL_image library.
+* The :module:`FindSDL_mixer` module to find the SDL_mixer library.
+* The :module:`FindSDL_net` module to find the SDL_net library.
+* The :module:`FindSDL_sound` module to find the SDL_sound library.
+* The :module:`FindSDL_ttf` module to find the SDL_ttf library.
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindSDL_gfx.cmake b/Modules/FindSDL_gfx.cmake
index fb066c9..c7f489e 100644
--- a/Modules/FindSDL_gfx.cmake
+++ b/Modules/FindSDL_gfx.cmake
@@ -7,21 +7,70 @@
 
 .. versionadded:: 3.25
 
-Locate SDL_gfx library
+Finds the SDL_gfx library that provides graphics support in SDL (Simple
+DirectMedia Layer) applications.
 
-This module defines:
+.. note::
 
-::
+  This module is for SDL_gfx version 1.  For version 2 or newer usage refer to
+  the upstream documentation.
 
-  SDL::SDL_gfx, the name of the target to use with target_*() commands
-  SDL_GFX_LIBRARIES, the name of the library to link against
-  SDL_GFX_INCLUDE_DIRS, where to find the headers
-  SDL_GFX_FOUND, if false, do not try to link against
-  SDL_GFX_VERSION_STRING - human-readable string containing the
-                             version of SDL_gfx
+Imported Targets
+^^^^^^^^^^^^^^^^
 
-``$SDLDIR`` is an environment variable that would correspond to the
-``./configure --prefix=$SDLDIR`` used in building SDL.
+This module provides the following :ref:`Imported Targets`:
+
+``SDL::SDL_gfx``
+  Target encapsulating the SDL_gfx library usage requirements, available if
+  SDL_gfx is found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``SDL_gfx_FOUND``
+  Boolean indicating whether the (requested version of) SDL_gfx library is
+  found.  For backward compatibility, the ``SDL_GFX_FOUND`` variable is also set
+  to the same value.
+``SDL_GFX_VERSION_STRING``
+  The human-readable string containing the version of SDL_gfx found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``SDL_GFX_INCLUDE_DIRS``
+  The directory containing the headers needed to use SDL_gfx.
+``SDL_GFX_LIBRARIES``
+  The path to the SDL_gfx library needed to link against to use SDL_gfx.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``SDLDIR``
+  Environment variable that can be set to help locate an SDL library installed
+  in a custom location.  It should point to the installation destination that
+  was used when configuring, building, and installing SDL library:
+  ``./configure --prefix=$SDLDIR``.
+
+Examples
+^^^^^^^^
+
+Finding SDL_gfx library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(SDL_gfx)
+  target_link_libraries(project_target PRIVATE SDL::SDL_gfx)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindSDL` module to find the main SDL library.
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 995baaa..5835532 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -5,32 +5,107 @@
 FindSDL_image
 -------------
 
-Locate SDL_image library
+Finds the SDL_image library that loads images of various formats as SDL (Simple
+DirectMedia Layer) surfaces.
 
-This module defines:
+.. note::
 
-::
+  This module is specifically intended for SDL_image version 1.  Starting with
+  version 2.6, SDL_image provides a CMake package configuration file when built
+  with CMake and should be found using ``find_package(SDL2_image)``.  Similarly,
+  SDL_image version 3 can be found using ``find_package(SDL3_image)``.  These
+  newer versions provide :ref:`Imported Targets` that encapsulate usage
+  requirements.  Refer to the official SDL documentation for more information.
 
-  SDL_IMAGE_LIBRARIES, the name of the library to link against
-  SDL_IMAGE_INCLUDE_DIRS, where to find the headers
-  SDL_IMAGE_FOUND, if false, do not try to link against
-  SDL_IMAGE_VERSION_STRING - human-readable string containing the
-                             version of SDL_image
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
+``SDL_image_FOUND``
+  Boolean indicating whether the (requested version of) SDL_image library is
+  found.  For backward compatibility, the ``SDL_IMAGE_FOUND`` variable is also
+  set to the same value.
+
+``SDL_IMAGE_VERSION_STRING``
+  The human-readable string containing the version of SDL_image found.
+
+``SDL_IMAGE_INCLUDE_DIRS``
+  Include directories containing headers needed to use the SDL_image library.
+
+``SDL_IMAGE_LIBRARIES``
+  Libraries needed to link against to use the SDL_image library.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``SDLDIR``
+  Environment variable that can be set to help locate an SDL library installed
+  in a custom location.  It should point to the installation destination that
+  was used when configuring, building, and installing SDL library:
+  ``./configure --prefix=$SDLDIR``.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
 For backward compatibility the following variables are also set:
 
-::
+``SDLIMAGE_FOUND``
+  .. deprecated:: 2.8.10
+    Use the ``SDL_image_FOUND``, which has the same value.
 
-  SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
-  SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
-  SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
+``SDLIMAGE_INCLUDE_DIR``
+  .. deprecated:: 2.8.10
+    Use the ``SDL_IMAGE_INCLUDE_DIRS``, which has the same value.
 
+``SDLIMAGE_LIBRARY``
+  .. deprecated:: 2.8.10
+    Use the ``SDL_IMAGE_LIBRARIES``, which has the same value.
 
+Examples
+^^^^^^^^
 
-$SDLDIR is an environment variable that would correspond to the
-./configure --prefix=$SDLDIR used in building SDL.
+Finding SDL_image library and creating an imported interface target for linking
+it to a project target:
+
+.. code-block:: cmake
+
+  find_package(SDL_image)
+
+  if(SDL_image_FOUND AND NOT TARGET SDL::SDL_image)
+    add_library(SDL::SDL_image INTERFACE IMPORTED)
+    set_target_properties(
+      SDL::SDL_image
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${SDL_IMAGE_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${SDL_IMAGE_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE SDL::SDL_image)
+
+When working with SDL_image version 2, the upstream package provides the
+``SDL2_image::SDL2_image`` imported target directly.  It can be used in a
+project without using this module:
+
+.. code-block:: cmake
+
+  find_package(SDL2_image)
+  target_link_libraries(project_target PRIVATE SDL2_image::SDL2_image)
+
+Similarly, for SDL_image version 3:
+
+.. code-block:: cmake
+
+  find_package(SDL3_image)
+  target_link_libraries(project_target PRIVATE SDL3_image::SDL3_image)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindSDL` module to find the main SDL library.
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -95,7 +170,7 @@
 # for backward compatibility
 set(SDLIMAGE_LIBRARY ${SDL_IMAGE_LIBRARIES})
 set(SDLIMAGE_INCLUDE_DIR ${SDL_IMAGE_INCLUDE_DIRS})
-set(SDLIMAGE_FOUND ${SDL_IMAGE_FOUND})
+set(SDLIMAGE_FOUND ${SDL_image_FOUND})
 
 mark_as_advanced(SDL_IMAGE_LIBRARY SDL_IMAGE_INCLUDE_DIR)
 
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 5219f84..a9bafbc 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -5,32 +5,99 @@
 FindSDL_mixer
 -------------
 
-Locate SDL_mixer library
+Finds the SDL_mixer library that provides an audio mixer with support for
+various file formats in SDL (Simple DirectMedia Layer) applications.
 
-This module defines:
+.. note::
 
-::
+  This module is specifically intended for SDL_mixer version 1.  Starting with
+  version 2.5, SDL_mixer provides a CMake package configuration file when built
+  with CMake and should be found using ``find_package(SDL2_mixer)``.  These
+  newer versions provide :ref:`Imported Targets` that encapsulate usage
+  requirements.  Refer to the official SDL documentation for more information.
 
-  SDL_MIXER_LIBRARIES, the name of the library to link against
-  SDL_MIXER_INCLUDE_DIRS, where to find the headers
-  SDL_MIXER_FOUND, if false, do not try to link against
-  SDL_MIXER_VERSION_STRING - human-readable string containing the
-                             version of SDL_mixer
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
+``SDL_mixer_FOUND``
+  Boolean indicating whether the (requested version of) SDL_mixer library is
+  found.  For backward compatibility, the ``SDL_MIXER_FOUND`` variable is also
+  set to the same value.
+
+``SDL_MIXER_VERSION_STRING``
+  The human-readable string containing the version of SDL_mixer found.
+
+``SDL_MIXER_INCLUDE_DIRS``
+  Include directories containing headers needed to use the SDL_mixer library.
+
+``SDL_MIXER_LIBRARIES``
+  Libraries needed to link against to use SDL_mixer.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``SDLDIR``
+  Environment variable that can be set to help locate an SDL library installed
+  in a custom location.  It should point to the installation destination that
+  was used when configuring, building, and installing SDL library:
+  ``./configure --prefix=$SDLDIR``.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
 For backward compatibility the following variables are also set:
 
-::
+``SDLMIXER_FOUND``
+  .. deprecated:: 2.8.10
+    Use ``SDL_mixer_FOUND``, which has the same value.
 
-  SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
-  SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
-  SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
+``SDLMIXER_INCLUDE_DIR``
+  .. deprecated:: 2.8.10
+    Use ``SDL_MIXER_INCLUDE_DIRS``, which has the same value.
 
+``SDLMIXER_LIBRARY``
+  .. deprecated:: 2.8.10
+    Use ``SDL_MIXER_LIBRARIES``, which has the same value.
 
+Examples
+^^^^^^^^
 
-$SDLDIR is an environment variable that would correspond to the
-./configure --prefix=$SDLDIR used in building SDL.
+Finding SDL_mixer library and creating an imported interface target for linking
+it to a project target:
+
+.. code-block:: cmake
+
+  find_package(SDL_mixer)
+
+  if(SDL_mixer_FOUND AND NOT TARGET SDL::SDL_mixer)
+    add_library(SDL::SDL_mixer INTERFACE IMPORTED)
+    set_target_properties(
+      SDL::SDL_mixer
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${SDL_MIXER_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${SDL_MIXER_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE SDL::SDL_mixer)
+
+When working with SDL_mixer version 2, the upstream package provides the
+``SDL2_mixer::SDL2_mixer`` imported target directly.  It can be used in a
+project without using this module:
+
+.. code-block:: cmake
+
+  find_package(SDL2_mixer)
+  target_link_libraries(project_target PRIVATE SDL2_mixer::SDL2_mixer)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindSDL` module to find the main SDL library.
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -95,7 +162,7 @@
 # for backward compatibility
 set(SDLMIXER_LIBRARY ${SDL_MIXER_LIBRARIES})
 set(SDLMIXER_INCLUDE_DIR ${SDL_MIXER_INCLUDE_DIRS})
-set(SDLMIXER_FOUND ${SDL_MIXER_FOUND})
+set(SDLMIXER_FOUND ${SDL_mixer_FOUND})
 
 mark_as_advanced(SDL_MIXER_LIBRARY SDL_MIXER_INCLUDE_DIR)
 
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index a8189fb..c5ba976 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -5,31 +5,99 @@
 FindSDL_net
 -----------
 
-Locate SDL_net library
+Finds the SDL_net library, a cross-platform network library for use with the
+SDL (Simple DirectMedia Layer) applications.
 
-This module defines:
+.. note::
 
-::
+  This module is specifically intended for SDL_net version 1.  Starting with
+  version 2.1, SDL_net provides a CMake package configuration file when built
+  with CMake and should be found using ``find_package(SDL2_net)``.  These
+  newer versions provide :ref:`Imported Targets` that encapsulate usage
+  requirements.  Refer to the official SDL documentation for more information.
 
-  SDL_NET_LIBRARIES, the name of the library to link against
-  SDL_NET_INCLUDE_DIRS, where to find the headers
-  SDL_NET_FOUND, if false, do not try to link against
-  SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
+``SDL_net_FOUND``
+  Boolean indicating whether the (requested version of) SDL_net library is
+  found.  For backward compatibility, the ``SDL_NET_FOUND`` variable is also set
+  to the same value.
+
+``SDL_NET_VERSION_STRING``
+  The human-readable string containing the version of SDL_net found.
+
+``SDL_NET_INCLUDE_DIRS``
+  Include directories containing headers needed to use the SDL_net library.
+
+``SDL_NET_LIBRARIES``
+  Libraries needed to link against to use the SDL_net library.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
 For backward compatibility the following variables are also set:
 
-::
+``SDLNET_FOUND``
+  .. deprecated:: 2.8.10
+    Use the ``SDL_net_FOUND``, which has the same value.
 
-  SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
-  SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
-  SDLNET_FOUND (same value as SDL_NET_FOUND)
+``SDLNET_INCLUDE_DIR``
+  .. deprecated:: 2.8.10
+    Use the ``SDL_NET_INCLUDE_DIRS``, which has the same value.
 
+``SDLNET_LIBRARY``
+  .. deprecated:: 2.8.10
+    Use the ``SDL_NET_LIBRARIES``, which has the same value.
 
+Hints
+^^^^^
 
-$SDLDIR is an environment variable that would correspond to the
-./configure --prefix=$SDLDIR used in building SDL.
+This module accepts the following variables:
+
+``SDLDIR``
+  Environment variable that can be set to help locate an SDL library installed
+  in a custom location.  It should point to the installation destination that
+  was used when configuring, building, and installing SDL library:
+  ``./configure --prefix=$SDLDIR``.
+
+Examples
+^^^^^^^^
+
+Finding SDL_net library and creating an imported interface target for linking it
+to a project target:
+
+.. code-block:: cmake
+
+  find_package(SDL_net)
+
+  if(SDL_net_FOUND AND NOT TARGET SDL::SDL_net)
+    add_library(SDL::SDL_net INTERFACE IMPORTED)
+    set_target_properties(
+      SDL::SDL_net
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${SDL_NET_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${SDL_NET_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE SDL::SDL_net)
+
+When working with SDL_net version 2, the upstream package provides the
+``SDL2_net::SDL2_net`` imported target directly.  It can be used in a project
+without using this module:
+
+.. code-block:: cmake
+
+  find_package(SDL2_net)
+  target_link_libraries(project_target PRIVATE SDL2_net::SDL2_net)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindSDL` module to find the main SDL library.
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -94,7 +162,7 @@
 # for backward compatibility
 set(SDLNET_LIBRARY ${SDL_NET_LIBRARIES})
 set(SDLNET_INCLUDE_DIR ${SDL_NET_INCLUDE_DIRS})
-set(SDLNET_FOUND ${SDL_NET_FOUND})
+set(SDLNET_FOUND ${SDL_net_FOUND})
 
 mark_as_advanced(SDL_NET_LIBRARY SDL_NET_INCLUDE_DIR)
 
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 30a89aa..954303f 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -5,63 +5,144 @@
 FindSDL_sound
 -------------
 
-Locates the SDL_sound library
+Finds the SDL_sound library, an abstract soundfile decoder for use in SDL
+(Simple DirectMedia Layer) applications.
 
+.. note::
 
+  This module is specifically intended for SDL_sound version 1.  Starting with
+  version 2.0.2, SDL_sound provides a CMake package configuration file when
+  built with CMake and should be found using ``find_package(SDL2_sound)``.
+  These newer versions provide :ref:`Imported Targets` that encapsulate usage
+  requirements.  Refer to the upstream SDL_sound documentation for more
+  information.
 
-This module depends on SDL being found and must be called AFTER
-FindSDL.cmake is called.
+.. note::
+  This module depends on SDL being found and must be called after the
+  :module:`find_package(SDL) <FindSDL>`.
 
-This module defines
+  Depending on how the SDL_sound library is built, it may require additional
+  dependent libraries to be found for this module to succeed.  These
+  dependencies may include MikMod, ModPlug, Ogg, Vorbis, SMPEG, FLAC, and Speex.
 
-::
+Result Variables
+^^^^^^^^^^^^^^^^
 
-  SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
-  SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
-  SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
-    to link against.
-  SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
-    flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
-    This is available mostly for cases this module failed to anticipate for
-    and you must add additional flags. This is marked as ADVANCED.
-  SDL_SOUND_VERSION_STRING, human-readable string containing the
-    version of SDL_sound
+This module defines the following variables:
 
+``SDL_sound_FOUND``
+  Boolean indicating whether the (requested version of) SDL_sound library is
+  found.  For backward compatibility, the ``SDL_SOUND_FOUND`` variable is also
+  set to the same value.
 
+``SDL_SOUND_VERSION_STRING``
+  The human-readable string containing the version of SDL_sound found.
 
-This module also defines (but you shouldn't need to use directly)
+``SDL_SOUND_LIBRARIES``
+  Libraries needed to link against to use the SDL_sound library.
 
-::
+Cache Variables
+^^^^^^^^^^^^^^^
 
-   SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
-   against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
+The following cache variables may also be set:
 
-And might define the following as needed
+``SDL_SOUND_INCLUDE_DIR``
+  The directory containing the ``SDL_sound.h`` and other headers needed to use
+  the SDL_sound library.
 
-::
+``SDL_SOUND_LIBRARY``
+  The name of just the SDL_sound library you would link against.  Use
+  ``SDL_SOUND_LIBRARIES`` for the link instructions and not this one.
 
-   MIKMOD_LIBRARY
-   MODPLUG_LIBRARY
-   OGG_LIBRARY
-   VORBIS_LIBRARY
-   SMPEG_LIBRARY
-   FLAC_LIBRARY
-   SPEEX_LIBRARY
+``MIKMOD_LIBRARY``
+  The path to the dependent MikMod library.
 
+``MODPLUG_LIBRARY``
+  The path to the dependent ModPlug library (libmodplug).
 
+``OGG_LIBRARY``
+  The path to the dependent Ogg library.
 
-Typically, you should not use these variables directly, and you should
-use SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other
-audio libraries (if needed) to successfully compile on your system.
+``VORBIS_LIBRARY``
+  The path to the dependent Vorbis library.
 
-Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable that
-would correspond to the ./configure --prefix=$SDLDIR used in building
-SDL.
+``SMPEG_LIBRARY``
+  The path to the dependent SMPEG library.
 
-On OSX, this will prefer the Framework version (if found) over others.
-People will have to manually change the cache values of SDL_LIBRARY to
-override this selectionor set the CMake environment CMAKE_INCLUDE_PATH
-to modify the search paths.
+``FLAC_LIBRARY``
+  The path to the dependent FLAC library.
+
+``SPEEX_LIBRARY``
+  The path to the dependent Speex library.
+
+Hints
+^^^^^
+
+This module accepts the following variables:
+
+``SDLDIR``
+  Environment variable that can be set to help locate an SDL library installed
+  in a custom location.  It should point to the installation destination that
+  was used when configuring, building, and installing SDL library:
+  ``./configure --prefix=$SDLDIR``.
+
+  On macOS, setting this variable will prefer the Framework version (if found)
+  over others.  In this case, the cache value of ``SDL_LIBRARY`` would need to
+  be manually changed to override this selection or set the
+  :variable:`CMAKE_INCLUDE_PATH` variable to modify the search paths.
+
+``SDLSOUNDDIR``
+  Environment variable that works the same as ``SDLDIR``.
+
+``SDL_SOUND_EXTRAS``
+  This is an optional cache variable that can be used to add additional flags
+  that are prepended to the ``SDL_SOUND_LIBRARIES`` result variable.  This is
+  available mostly for cases this module failed to anticipate for and additional
+  flags must be added.
+
+Examples
+^^^^^^^^
+
+Finding SDL_sound library and creating an imported interface target for linking
+it to a project target:
+
+.. code-block:: cmake
+
+  find_package(SDL)
+  find_package(SDL_sound)
+
+  if(SDL_sound_FOUND AND NOT TARGET SDL::SDL_sound)
+    add_library(SDL::SDL_sound INTERFACE IMPORTED)
+    set_target_properties(
+      SDL::SDL_sound
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${SDL_SOUND_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${SDL_SOUND_LIBRARIES}"
+    )
+
+    # Append the SDL dependency as imported target to be transitively linked:
+    set_property(
+      TARGET SDL::SDL_sound
+      APPEND
+      PROPERTY INTERFACE_LINK_LIBRARIES SDL::SDL
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE SDL::SDL_sound)
+
+When working with SDL_sound version 2, the upstream package provides the
+``SDL2_sound::SDL2_sound`` imported target directly.  It can be used in a
+project without using this module:
+
+.. code-block:: cmake
+
+  find_package(SDL2_sound)
+  target_link_libraries(project_target PRIVATE SDL2_sound::SDL2_sound)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindSDL` module to find the main SDL library.
 #]=======================================================================]
 
 
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 080705f..2569588 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -5,31 +5,107 @@
 FindSDL_ttf
 -----------
 
-Locate SDL_ttf library
+Finds the SDL_ttf library that provides support for rendering text with TrueType
+fonts in SDL (Simple DirectMedia Layer) applications.
 
-This module defines:
+.. note::
 
-::
+  This module is specifically intended for SDL_ttf version 1.  Starting with
+  version 2.0.15, SDL_ttf provides a CMake package configuration file when built
+  with CMake and should be found using ``find_package(SDL2_ttf)``.  Similarly,
+  SDL_ttf version 3 can be found using ``find_package(SDL3_ttf)``.  These newer
+  versions provide :ref:`Imported Targets` that encapsulate usage requirements.
+  Refer to the official SDL documentation for more information.
 
-  SDL_TTF_LIBRARIES, the name of the library to link against
-  SDL_TTF_INCLUDE_DIRS, where to find the headers
-  SDL_TTF_FOUND, if false, do not try to link against
-  SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
+``SDL_ttf_FOUND``
+  Boolean indicating whether the (requested version of) SDL_ttf library is
+  found.  For backward compatibility, the ``SDL_TTF_FOUND`` variable is also set
+  to the same value.
+
+``SDL_TTF_VERSION_STRING``
+  The human-readable string containing the version of SDL_ttf found.
+
+``SDL_TTF_INCLUDE_DIRS``
+  Include directories containing headers needed to use SDL_ttf library.
+
+``SDL_TTF_LIBRARIES``
+  Libraries needed to link against to use SDL_ttf.
+
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
 
 For backward compatibility the following variables are also set:
 
-::
+``SDLTTF_FOUND``
+  .. deprecated:: 2.8.10
+    Replaced with ``SDL_ttf_FOUND``, which has the same value.
 
-  SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
-  SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
-  SDLTTF_FOUND (same value as SDL_TTF_FOUND)
+``SDLTTF_INCLUDE_DIR``
+  .. deprecated:: 2.8.10
+    Replaced with ``SDL_TTF_INCLUDE_DIRS``, which has the same value.
 
+``SDLTTF_LIBRARY``
+  .. deprecated:: 2.8.10
+    Replaced with ``SDL_TTF_LIBRARIES``, which has the same value.
 
+Hints
+^^^^^
 
-$SDLDIR is an environment variable that would correspond to the
-./configure --prefix=$SDLDIR used in building SDL.
+This module accepts the following variables:
+
+``SDLDIR``
+  Environment variable that can be set to help locate an SDL library installed
+  in a custom location.  It should point to the installation destination that
+  was used when configuring, building, and installing SDL library:
+  ``./configure --prefix=$SDLDIR``.
+
+Examples
+^^^^^^^^
+
+Finding SDL_ttf library and creating an imported interface target for linking
+it to a project target:
+
+.. code-block:: cmake
+
+  find_package(SDL_ttf)
+
+  if(SDL_ttf_FOUND AND NOT TARGET SDL::SDL_ttf)
+    add_library(SDL::SDL_ttf INTERFACE IMPORTED)
+    set_target_properties(
+      SDL::SDL_ttf
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${SDL_TTF_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${SDL_TTF_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(project_target PRIVATE SDL::SDL_ttf)
+
+When working with SDL_ttf version 2, the upstream package provides the
+``SDL2_ttf::SDL2_ttf`` imported target directly.  It can be used in a project
+without using this module:
+
+.. code-block:: cmake
+
+  find_package(SDL2_ttf)
+  target_link_libraries(project_target PRIVATE SDL2_ttf::SDL2_ttf)
+
+Similarly, for SDL_ttf version 3:
+
+.. code-block:: cmake
+
+  find_package(SDL3_ttf)
+  target_link_libraries(project_target PRIVATE SDL3_ttf::SDL3_ttf)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindSDL` module to find the main SDL library.
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake
index fcacbef..914b84a 100644
--- a/Modules/FindSQLite3.cmake
+++ b/Modules/FindSQLite3.cmake
@@ -7,29 +7,43 @@
 
 .. versionadded:: 3.14
 
-Find the SQLite libraries, v3
+Finds the SQLite 3 library.  SQLite is a small, fast, self-contained,
+high-reliability, and full-featured SQL database engine written in C, intended
+for embedding in applications.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module defines the following :prop_tgt:`IMPORTED` target:
+This module provides the following :ref:`Imported Targets`:
 
 ``SQLite::SQLite3``
+  Target encapsulating SQLite library usage requirements.  It is available only
+  when SQLite is found.
 
-Result variables
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables if found:
+This module sets the following variables:
 
 ``SQLite3_INCLUDE_DIRS``
-  where to find sqlite3.h, etc.
+  Include directories containing the ``sqlite3.h`` and related headers needed
+  to use SQLite.
 ``SQLite3_LIBRARIES``
-  the libraries to link against to use SQLite3.
+  Libraries needed to link against to use SQLite.
 ``SQLite3_VERSION``
-  version of the SQLite3 library found
+  Version of the SQLite library found.
 ``SQLite3_FOUND``
-  TRUE if found
+  Boolean indicating whether the SQLite library is found.
 
+Examples
+^^^^^^^^
+
+Finding the SQLite library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(SQLite3)
+  target_link_libraries(project_target PRIVATE SQLite::SQLite3)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -66,7 +80,7 @@
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(SQLite3
-    REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
+    REQUIRED_VARS SQLite3_LIBRARY SQLite3_INCLUDE_DIR
     VERSION_VAR SQLite3_VERSION)
 
 # Create the imported target
diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake
index f83766b..dd50ba4 100644
--- a/Modules/FindSelfPackers.cmake
+++ b/Modules/FindSelfPackers.cmake
@@ -5,15 +5,37 @@
 FindSelfPackers
 ---------------
 
-Find upx
+Finds `UPX <https://upx.github.io/>`_, the Ultimate Packer for eXecutables.
 
-This module looks for some executable packers (i.e.  software that
-compress executables or shared libs into on-the-fly self-extracting
-executables or shared libs.  Examples:
+This module searches for executable packers-tools that compress executables or
+shared libraries into on-the-fly, self-extracting versions.  It currently
+supports ``UPX``.
 
-::
+Cache Variables
+^^^^^^^^^^^^^^^
 
-  UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
+The following cache variables may be set:
+
+``SELF_PACKER_FOR_EXECUTABLE``
+  Path to the executable packer for compressing executables.
+
+``SELF_PACKER_FOR_SHARED_LIB``
+  Path to the executable packer for compressing shared libraries.
+
+``SELF_PACKER_FOR_EXECUTABLE_FLAGS``
+  Command-line options to use when compressing executables.
+
+``SELF_PACKER_FOR_SHARED_LIB_FLAGS``
+  Command-line options to use when compressing shared libraries.
+
+Examples
+^^^^^^^^
+
+Finding UPX:
+
+.. code-block:: cmake
+
+  find_package(SelfPackers)
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 986db16..ea96e7b 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -5,110 +5,204 @@
 FindSquish
 ----------
 
--- Typical Use
+Finds Squish, a cross-platform automated GUI testing framework for applications
+built on various GUI technologies.  Squish supports testing of both native and
+cross-platform toolkits, such as Qt, Java, and Tk.
 
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
-This module can be used to find Squish.
+``Squish_FOUND``
+  Boolean indicating whether the (requested version of) Squish is found.  For
+  backward compatibility, the ``SQUISH_FOUND`` variable is also set to the same
+  value.
 
-::
+``SQUISH_VERSION``
+  The full version of the Squish found.
 
-  SQUISH_FOUND                    If false, don't try to use Squish
-  SQUISH_VERSION                  The full version of Squish found
-  SQUISH_VERSION_MAJOR            The major version of Squish found
-  SQUISH_VERSION_MINOR            The minor version of Squish found
-  SQUISH_VERSION_PATCH            The patch version of Squish found
+``SQUISH_VERSION_MAJOR``
+  The major version of the Squish found.
 
+``SQUISH_VERSION_MINOR``
+  The minor version of the Squish found.
 
+``SQUISH_VERSION_PATCH``
+  The patch version of the Squish found.
 
-::
+``SQUISH_INSTALL_DIR_FOUND``
+  Boolean indicating whether the Squish installation directory is found.
 
-  SQUISH_INSTALL_DIR              The Squish installation directory
-                                  (containing bin, lib, etc)
-  SQUISH_SERVER_EXECUTABLE        The squishserver executable
-  SQUISH_CLIENT_EXECUTABLE        The squishrunner executable
+``SQUISH_SERVER_EXECUTABLE_FOUND``
+  Boolean indicating whether the Squish server executable is found.
 
+``SQUISH_CLIENT_EXECUTABLE_FOUND``
+  Boolean indicating whether the Squish client executable is found.
 
+Cache Variables
+^^^^^^^^^^^^^^^
 
-::
+The following cache variables may also be set:
 
-  SQUISH_INSTALL_DIR_FOUND        Was the install directory found?
-  SQUISH_SERVER_EXECUTABLE_FOUND  Was the server executable found?
-  SQUISH_CLIENT_EXECUTABLE_FOUND  Was the client executable found?
+``SQUISH_INSTALL_DIR``
+  The Squish installation directory containing ``bin``, ``lib``, etc.
 
+``SQUISH_SERVER_EXECUTABLE``
+  The path to the ``squishserver`` executable.
 
+``SQUISH_CLIENT_EXECUTABLE``
+  The path to the ``squishrunner`` executable.
 
-It provides the function squish_add_test() for adding a squish test
-to cmake using Squish >= 4.x:
+Commands
+^^^^^^^^
+
+This module provides the following commands, if Squish is found:
+
+.. command:: squish_add_test
+
+  Adds a Squish test to the project:
+
+  .. code-block:: cmake
+
+    squish_add_test(
+      <name>
+      AUT <target>
+      SUITE <suite-name>
+      TEST <squish-test-case-name>
+      [PRE_COMMAND <command>]
+      [POST_COMMAND <command>]
+      [SETTINGSGROUP <group>]
+    )
+
+  This command is built on top of the :command:`add_test` command and adds a
+  Squish test called ``<name>`` to the CMake project.  It supports Squish
+  versions 4 and newer.
+
+  During the CMake testing phase, the Squish server is started, the test is
+  executed on the client, and the server is stopped once the test completes.  If
+  any of these steps fail (including if the test itself fails), a fatal error is
+  raised indicating the test did not pass.
+
+  The arguments are:
+
+  ``<name>``
+    The name of the test.  This is passed as the first argument to the
+    :command:`add_test` command.
+
+  ``AUT <target>``
+    The name of the CMake target to be used as the AUT (Application Under Test),
+    i.e., the executable that will be tested.
+
+  ``SUITE <suite-name>``
+    Either the full path to the Squish test suite or just the suite name (i.e.,
+    the last directory name of the suite).  In the latter case, the
+    ``CMakeLists.txt`` invoking ``squish_add_test()`` must reside in the parent
+    directory of the suite.
+
+  ``TEST <squish-test-case-name>``
+    The name of the Squish test, corresponding to the subdirectory of the test
+    within the suite directory.
+
+  ``PRE_COMMAND <command>``
+    An optional command to execute before starting the Squish test.  Pass it as
+    a string.  This may be a single command, or a :ref:`semicolon-separated list
+    <CMake Language Lists>` of command and arguments.
+
+  ``POST_COMMAND <command>``
+    An optional command to execute after the Squish test has completed.  Pass it
+    as a string.  This may be a single command, or a :ref:`semicolon-separated
+    list <CMake Language Lists>` of command and arguments.
+
+  ``SETTINGSGROUP <group>``
+    .. deprecated:: 3.18
+      This argument is now ignored.  It was previously used to specify a
+      settings group name for executing the test instead of the default value
+      ``CTest_<username>``.
+
+  .. versionchanged:: 3.18
+    In previous CMake versions, this command was named ``squish_v4_add_test()``.
+
+.. command:: squish_v3_add_test
+
+  Adds a Squish test to the project, when using Squish version 3.x:
+
+  .. code-block:: cmake
+
+    squish_v3_add_test(
+      <test-name>
+      <application-under-test>
+      <squish-test-case-name>
+      <environment-variables>
+      <test-wrapper>
+    )
+
+  .. note::
+    This command is for Squish version 3, which is not maintained anymore.  Use
+    a newer Squish version, and ``squish_add_test()`` command.
+
+  The arguments are:
+
+  ``<name>``
+    The name of the test.
+
+  ``<application-under-test>``
+    The path to the executable used as the AUT (Application Under Test), i.e.,
+    the executable that will be tested.
+
+  ``<squish-test-case-name>``
+    The name of the Squish test, corresponding to the subdirectory of the test
+    within the suite directory.
+
+  ``<environment-variables>``
+    A semicolon-separated list of environment variables and their values
+    (VAR=VALUE).
+
+  ``<test-wrapper>``
+    A string of one or more (semicolon-separated list) test wrappers needed by
+    the test case.
+
+Examples
+^^^^^^^^
+
+Finding Squish and specifying a minimum required version:
 
 .. code-block:: cmake
 
-   squish_add_test(cmakeTestName
-     AUT targetName SUITE suiteName TEST squishTestName
-     [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] )
+  find_package(Squish 6.5)
 
-.. versionchanged:: 3.18
-  In previous CMake versions, this function was named ``squish_v4_add_test``.
-
-The arguments have the following meaning:
-
-``cmakeTestName``
-  this will be used as the first argument for add_test()
-``AUT targetName``
-  the name of the cmake target which will be used as AUT, i.e. the
-  executable which will be tested.
-``SUITE suiteName``
-  this is either the full path to the squish suite, or just the
-  last directory of the suite, i.e. the suite name. In this case
-  the CMakeLists.txt which calls squish_add_test() must be located
-  in the parent directory of the suite directory.
-``TEST squishTestName``
-  the name of the squish test, i.e. the name of the subdirectory
-  of the test inside the suite directory.
-``SETTINGSGROUP group``
-  deprecated, this argument will be ignored.
-``PRE_COMMAND command``
-  if specified, the given command will be executed before starting the squish test.
-``POST_COMMAND command``
-  same as PRE_COMMAND, but after the squish test has been executed.
-
-
-
-.. code-block:: cmake
-
-   enable_testing()
-   find_package(Squish 6.5)
-   if (SQUISH_FOUND)
-      squish_add_test(myTestName
-        AUT myApp
-        SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite
-        TEST someSquishTest
-        )
-   endif ()
-
-
-
-
-
-For users of Squish version 3.x the macro squish_v3_add_test() is
-provided:
-
-.. code-block:: cmake
-
-   squish_v3_add_test(testName applicationUnderTest testCase envVars testWrapper)
-   Use this macro to add a test using Squish 3.x.
-
-
+Adding a Squish test:
 
 .. code-block:: cmake
 
   enable_testing()
+
+  find_package(Squish 6.5)
+  if(Squish_FOUND)
+    squish_add_test(
+      projectTestName
+      AUT projectApp
+      SUITE ${CMAKE_CURRENT_SOURCE_DIR}/tests/projectSuite
+      TEST someSquishTest
+    )
+  endif()
+
+Example, how to use the ``squish_v3_add_test()`` command:
+
+.. code-block:: cmake
+
+  enable_testing()
+
   find_package(Squish 3.0)
-  if (SQUISH_FOUND)
-    squish_v3_add_test(myTestName myApplication testCase envVars testWrapper)
-  endif ()
-
-
+  if(Squish_FOUND)
+    squish_v3_add_test(
+      projectTestName
+      $<TARGET_FILE:projectApp>
+      someSquishTest
+      "FOO=1;BAR=2"
+      testWrapper
+    )
+  endif()
 #]=======================================================================]
 
 set(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 294f415..ae17656 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -5,62 +5,129 @@
 FindSubversion
 --------------
 
-Extract information from a subversion working copy
-
-The module defines the following variables:
-
-::
-
-  Subversion_SVN_EXECUTABLE - path to svn command line client
-  Subversion_VERSION_SVN - version of svn command line client
-  Subversion_FOUND - true if the command line client was found
-  SUBVERSION_FOUND - same as Subversion_FOUND, set for compatibility reasons
-
-
-
-The minimum required version of Subversion can be specified using the
-standard syntax, e.g. ``find_package(Subversion 1.4)``.
-
-If the command line client executable is found two macros are defined:
+Finds a Subversion command-line client executable (``svn``) and provides
+commands for extracting information from a Subversion working copy:
 
 .. code-block:: cmake
 
-  Subversion_WC_INFO(<dir> <var-prefix> [IGNORE_SVN_FAILURE])
-  Subversion_WC_LOG(<dir> <var-prefix>)
+  find_package(Subversion [<version>] [...])
 
-``Subversion_WC_INFO`` extracts information of a subversion working copy at a
-given location.  This macro defines the following variables if running
-Subversion's ``info`` command on ``<dir>`` succeeds; otherwise a
-``SEND_ERROR`` message is generated.
+Result Variables
+^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.13
-  The error can be ignored by providing the
-  ``IGNORE_SVN_FAILURE`` option, which causes these variables to remain
-  undefined.
+This module defines the following variables:
 
-::
+``Subversion_FOUND``
+  Boolean indicating whether (the requested version of) Subversion command-line
+  client is found.  For backward compatibility, the ``SUBVERSION_FOUND``
+  variable is also set to the same value.
 
-  <var-prefix>_WC_URL - url of the repository (at <dir>)
-  <var-prefix>_WC_ROOT - root url of the repository
-  <var-prefix>_WC_REVISION - current revision
-  <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
-  <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
-  <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
-  <var-prefix>_WC_INFO - output of command `svn info <dir>'
+``Subversion_VERSION_SVN``
+  Version of the ``svn`` command-line client found.
 
-``Subversion_WC_LOG`` retrieves the log message of the base revision of a
-subversion working copy at a given location.  This macro defines the variable:
+Cache Variables
+^^^^^^^^^^^^^^^
 
-::
+The following cache variables may also be set:
 
-  <var-prefix>_LAST_CHANGED_LOG - last log of base revision
+``Subversion_SVN_EXECUTABLE``
+  Path to the ``svn`` command-line client.
 
-Example usage:
+Commands
+^^^^^^^^
+
+This module provides the following commands if the Subversion command-line
+client is found:
+
+.. command:: Subversion_WC_INFO
+
+  Extracts information from a Subversion working copy located at a specified
+  directory:
+
+  .. code-block:: cmake
+
+    Subversion_WC_INFO(<dir> <var-prefix> [IGNORE_SVN_FAILURE])
+
+  This command defines the following variables if running Subversion's ``info``
+  subcommand on ``<dir>`` succeeds; otherwise a ``SEND_ERROR`` message is
+  generated:
+
+  ``<var-prefix>_WC_URL``
+    URL of the repository (at ``<dir>``).
+  ``<var-prefix>_WC_ROOT``
+    Root URL of the repository.
+  ``<var-prefix>_WC_REVISION``
+    Current revision.
+  ``<var-prefix>_WC_LAST_CHANGED_AUTHOR``
+    Author of last commit.
+  ``<var-prefix>_WC_LAST_CHANGED_DATE``
+    Date of last commit.
+  ``<var-prefix>_WC_LAST_CHANGED_REV``
+    Revision of last commit.
+  ``<var-prefix>_WC_INFO``
+    Output of the command ``svn info <dir>``
+
+  The options are:
+
+  ``IGNORE_SVN_FAILURE``
+    .. versionadded:: 3.13
+
+    When specified, errors from Subversion operation will not trigger a
+    ``SEND_ERROR`` message.  In case of an error, the ``<var-prefix>_*``
+    variables remain undefined.
+
+.. command:: Subversion_WC_LOG
+
+  Retrieves the log message of the base revision of a Subversion working copy at
+  a given location:
+
+  .. code-block:: cmake
+
+    Subversion_WC_LOG(<dir> <var-prefix>)
+
+  This command defines the following variable if running Subversion's ``log``
+  subcommand on ``<dir>`` succeeds; otherwise a ``SEND_ERROR`` message is
+  generated:
+
+  ``<var-prefix>_LAST_CHANGED_LOG``
+    Last log of the base revision of a Subversion working copy located at
+    ``<dir>``.
+
+Examples
+^^^^^^^^
+
+Examples: Finding Subversion
+""""""""""""""""""""""""""""
+
+Finding Subversion:
 
 .. code-block:: cmake
 
   find_package(Subversion)
-  if(SUBVERSION_FOUND)
+
+Or, finding Subversion and specifying a minimum required version:
+
+.. code-block:: cmake
+
+  find_package(Subversion 1.4)
+
+Or, finding Subversion and making it required (if not found, processing stops
+with an error message):
+
+.. code-block:: cmake
+
+  find_package(Subversion REQUIRED)
+
+Example: Using Subversion
+"""""""""""""""""""""""""
+
+Finding Subversion and retrieving information about the current project's
+working copy:
+
+.. code-block:: cmake
+
+  find_package(Subversion)
+  if(Subversion_FOUND)
     Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
     message("Current revision is ${Project_WC_REVISION}")
     Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
@@ -165,4 +232,4 @@
                                              VERSION_VAR Subversion_VERSION_SVN )
 
 # for compatibility
-set(Subversion_SVN_FOUND ${SUBVERSION_FOUND})
+set(Subversion_SVN_FOUND ${Subversion_FOUND})
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 1273e8d..5ed3791 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -5,44 +5,69 @@
 FindTCL
 -------
 
-TK_INTERNAL_PATH was removed.
+Finds the Tcl (Tool Command Language), dynamic programming language.
 
-This module finds if Tcl is installed and determines where the include
-files and libraries are.  It also determines what the name of the
-library is.  This code sets the following variables:
+This module locates a Tcl installation, including its include directories and
+libraries, and determines the appropriate Tcl library name for linking.  As part
+of the Tcl ecosystem, it also finds Tk, a GUI toolkit that provides a library of
+basic widgets for building graphical user interfaces.
 
-::
+Result Variables
+^^^^^^^^^^^^^^^^
 
-  TCL_FOUND              = Tcl was found
-  TK_FOUND               = Tk was found
-  TCLTK_FOUND            = Tcl and Tk were found
-  TCL_LIBRARY            = path to Tcl library (tcl tcl80)
-  TCL_INCLUDE_PATH       = path to where tcl.h can be found
-  TCL_TCLSH              = path to tclsh binary (tcl tcl80)
-  TK_LIBRARY             = path to Tk library (tk tk80 etc)
-  TK_INCLUDE_PATH        = path to where tk.h can be found
-  TK_WISH                = full path to the wish executable
+This module defines the following variables:
+
+``TCL_FOUND``
+  Boolean indicating whether the Tcl is found.
+``TK_FOUND``
+  Boolean indicating whether the Tk is found.
+``TCLTK_FOUND``
+  Boolean indicating whether both Tcl and Tk are found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``TCL_LIBRARY``
+  The path to the Tcl library (e.g., ``tcl``, etc.).
+``TCL_INCLUDE_PATH``
+  The directory containing ``tcl.h`` and other Tcl-related headers needed to use
+  Tcl.
+``TCL_TCLSH``
+  The path to the ``tclsh`` command-line executable.
+``TK_LIBRARY``
+  The path to the Tk library (e.g., ``tk``, etc.).
+``TK_INCLUDE_PATH``
+  The directory containing ``tk.h`` and other Tk-related headers needed to use
+  Tk.
+``TK_WISH``
+  The path to the ``wish`` windowing shell command-line executable.
 
 
+Other Libraries
+^^^^^^^^^^^^^^^
 
-In an effort to remove some clutter and clear up some issues for
-people who are not necessarily Tcl/Tk gurus/developers, some
-variables were moved or removed.  Changes compared to CMake 2.4 are:
+The Tcl Stub Library can be found using the separate :module:`FindTclStub`
+module.
 
-::
 
-   => they were only useful for people writing Tcl/Tk extensions.
-   => these libs are not packaged by default with Tcl/Tk distributions.
-      Even when Tcl/Tk is built from source, several flavors of debug libs
-      are created and there is no real reason to pick a single one
-      specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
-      Let's leave that choice to the user by allowing him to assign
-      TCL_LIBRARY to any Tcl library, debug or not.
-   => this ended up being only a Win32 variable, and there is a lot of
-      confusion regarding the location of this file in an installed Tcl/Tk
-      tree anyway (see 8.5 for example). If you need the internal path at
-      this point it is safer you ask directly where the *source* tree is
-      and dig from there.
+Examples
+^^^^^^^^
+
+Finding Tcl:
+
+.. code-block:: cmake
+
+  find_package(TCL)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindTclsh` module to find the Tcl shell command-line executable.
+* The :module:`FindTclStub` module to find the Tcl Stubs Library.
+* The :module:`FindWish` module to find the ``wish`` windowing shell
+  command-line executable .
 #]=======================================================================]
 
 block(SCOPE_FOR POLICIES)
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index ad4b3c6..c756b93 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -5,64 +5,107 @@
 FindTIFF
 --------
 
-Find the TIFF library (``libtiff``, https://libtiff.gitlab.io/libtiff/).
+Finds the `TIFF library <https://libtiff.gitlab.io/libtiff/>`_ (``libtiff``).
+This module also takes into account the upstream TIFF library's exported CMake
+package configuration, if available.
 
-Optional COMPONENTS
-^^^^^^^^^^^^^^^^^^^
+Components
+^^^^^^^^^^
 
-This module supports the optional component `CXX`, for use with the COMPONENTS
-argument of the :command:`find_package` command. This component has an associated
-imported target, as described below.
+This module supports the following components:
+
+``CXX``
+  .. versionadded:: 3.19
+
+  Optional component that ensures that the C++ wrapper library (``libtiffxx``)
+  is found.
+
+Components can be specified using the standard syntax:
+
+.. code-block:: cmake
+
+  find_package(TIFF [COMPONENTS <components>...])
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.5
-
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``TIFF::TIFF``
-  The TIFF library, if found.
+  .. versionadded:: 3.5
+
+  Target encapsulating the TIFF library usage requirements, available only if
+  the TIFF is found.
 
 ``TIFF::CXX``
   .. versionadded:: 3.19
 
-  The C++ wrapper libtiffxx, if requested by the `COMPONENTS CXX` option,
-  if the compiler is not MSVC (which includes the C++ wrapper in libtiff),
-  and if found.
+  Target encapsulating the usage requirements for the the C++ wrapper library
+  ``libtiffxx``, available only if TIFF is found.  This target provides CXX
+  usage requirements only if the compiler is not MSVC.  It also has the
+  ``TIFF::TIFF`` target linked in to simplify its usage.
 
-Result variables
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``TIFF_FOUND``
-  true if the TIFF headers and libraries were found
-``TIFF_INCLUDE_DIR``
-  the directory containing the TIFF headers
-``TIFF_INCLUDE_DIRS``
-  the directory containing the TIFF headers
-``TIFF_LIBRARIES``
-  TIFF libraries to be linked
+  Boolean indicating whether the TIFF is found.
 
-Cache variables
+``TIFF_VERSION_STRING``
+  The version of the TIFF library found.
+
+``TIFF_INCLUDE_DIRS``
+  The directory containing the TIFF headers.
+
+``TIFF_LIBRARIES``
+  TIFF libraries to be linked.
+
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``TIFF_INCLUDE_DIR``
-  the directory containing the TIFF headers
-``TIFF_LIBRARY_RELEASE``
-  the path to the TIFF library for release configurations
-``TIFF_LIBRARY_DEBUG``
-  the path to the TIFF library for debug configurations
-``TIFFXX_LIBRARY_RELEASE``
-  the path to the TIFFXX library for release configurations
-``TIFFXX_LIBRARY_DEBUG``
-  the path to the TIFFXX library for debug configurations
+  The directory containing the TIFF headers.
 
-.. versionadded:: 3.4
-  Debug and Release variants are found separately.
+``TIFF_LIBRARY_RELEASE``
+  .. versionadded:: 3.4
+
+  The path to the TIFF library for release configurations.
+
+``TIFF_LIBRARY_DEBUG``
+  .. versionadded:: 3.4
+
+  The path to the TIFF library for debug configurations.
+
+``TIFFXX_LIBRARY_RELEASE``
+  .. versionadded:: 3.19
+
+  The path to the TIFFXX library for release configurations.
+
+``TIFFXX_LIBRARY_DEBUG``
+  .. versionadded:: 3.19
+
+  The path to the TIFFXX library for debug configurations.
+
+Examples
+^^^^^^^^
+
+Finding TIFF library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(TIFF)
+  target_link_libraries(project_target PRIVATE TIFF::TIFF)
+
+Finding TIFF and TIFFXX libraries by specifying the ``CXX`` component:
+
+.. code-block:: cmake
+
+  find_package(TIFF COMPONENTS CXX)
+  target_link_libraries(project_target PRIVATE TIFF::CXX)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index 62e5ef2..ac0b2a6 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -5,44 +5,53 @@
 FindTclStub
 -----------
 
-TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
+Finds the Tcl Stub Library, which is used for building version-independent Tcl
+extensions.
 
-This module finds Tcl stub libraries.  It first finds Tcl include
-files and libraries by calling FindTCL.cmake.  How to Use the Tcl
-Stubs Library:
+Tcl (Tool Command Language) is a dynamic programming language, and the Tcl Stub
+Library provides a mechanism to allow Tcl extensions to be compiled in a way
+that they can work across multiple Tcl versions, without requiring
+recompilation.
 
-::
+This module is typically used in conjunction with Tcl development projects that
+aim to be portable across different Tcl releases.  It first calls the
+:module:`FindTCL` module to locate Tcl installation and then attempts to find
+the stub libraries corresponding to the located Tcl version.
 
-   http://tcl.activestate.com/doc/howto/stubs.html
+Cache Variables
+^^^^^^^^^^^^^^^
 
-Using Stub Libraries:
+The following cache variables may also be set:
 
-::
+``TCL_STUB_LIBRARY``
+  The path to the Tcl stub library.
+``TK_STUB_LIBRARY``
+  The path to the Tk stub library.
+``TTK_STUB_LIBRARY``
+  The path to the ttk stub library.
 
-   http://safari.oreilly.com/0130385603/ch48lev1sec3
+Examples
+^^^^^^^^
 
-This code sets the following variables:
+Finding Tcl Stubs Library:
 
-::
+.. code-block:: cmake
 
-  TCL_STUB_LIBRARY       = path to Tcl stub library
-  TK_STUB_LIBRARY        = path to Tk stub library
-  TTK_STUB_LIBRARY       = path to ttk stub library
+  find_package(TclStub)
 
+See Also
+^^^^^^^^
 
+* The :module:`FindTCL` module to find the Tcl installation.
+* The :module:`FindTclsh` module to find the Tcl shell command-line executable.
 
-In an effort to remove some clutter and clear up some issues for
-people who are not necessarily Tcl/Tk gurus/developers, some
-variables were moved or removed.  Changes compared to CMake 2.4 are:
+Online references:
 
-::
+* `How to Use the Tcl Stubs Library
+  <https://www.tcl-lang.org/doc/howto/stubs.html>`_
 
-   => these libs are not packaged by default with Tcl/Tk distributions.
-      Even when Tcl/Tk is built from source, several flavors of debug libs
-      are created and there is no real reason to pick a single one
-      specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
-      Let's leave that choice to the user by allowing him to assign
-      TCL_STUB_LIBRARY to any Tcl library, debug or not.
+* `Practical Programming in Tcl and Tk
+  <https://www.oreilly.com/library/view/practical-programming-in/0130385603/>`_
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindTCL.cmake)
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 878735a..81c666a 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -5,16 +5,41 @@
 FindTclsh
 ---------
 
-Find tclsh
+Finds the Tcl shell command-line executable (``tclsh``), which includes the Tcl
+(Tool Command Language) interpreter.
 
-This module finds if TCL is installed and determines where the include
-files and libraries are.  It also determines what the name of the
-library is.  This code sets the following variables:
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following variables:
 
-  TCLSH_FOUND = TRUE if tclsh has been found
-  TCL_TCLSH = the path to the tclsh executable
+``Tclsh_FOUND``
+  Boolean indicating whether the ``tclsh`` executable (and the requested
+  version, if specified) is found.  For backward compatibility, the
+  ``TCLSH_FOUND`` variable is also set to the same value.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``TCL_TCLSH``
+  The path to the ``tclsh`` executable.
+
+Examples
+^^^^^^^^
+
+Finding the ``tclsh`` command-line executable:
+
+.. code-block:: cmake
+
+  find_package(Tclsh)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindTCL` module to find the Tcl installation.
+* The :module:`FindTclStub` module to find the Tcl Stubs Library.
 #]=======================================================================]
 
 get_filename_component(TK_WISH_PATH "${TK_WISH}" PATH)
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index fab9806..e10051d 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -7,107 +7,146 @@
 
 .. versionadded:: 3.7
 
-Find Vulkan, which is a low-overhead, cross-platform 3D graphics
-and computing API.
+Finds Vulkan, a low-overhead, cross-platform 3D graphics and computing API,
+along with related development tools typically provided by the Vulkan SDK.  This
+includes commonly used utilities such as shader compilers and SPIR-V tools
+(e.g., DXC, ``glslc``, ``glslang``, etc.) that support Vulkan-based development
+workflows.
 
-Optional COMPONENTS
-^^^^^^^^^^^^^^^^^^^
+Components
+^^^^^^^^^^
 
 .. versionadded:: 3.24
 
-This module respects several optional COMPONENTS.
-There are corresponding imported targets for each of these.
+This module supports several optional components that can be specified with the
+:command:`find_package` command:
+
+.. code-block:: cmake
+
+  find_package(Vulkan [COMPONENTS <components>...])
+
+Each component provides a corresponding imported target.  Supported components
+include:
 
 ``glslc``
-  The SPIR-V compiler.
+  .. versionadded:: 3.24
+
+  Finds the SPIR-V compiler.  This optional component is always implied
+  automatically for backward compatibility, even if not requested.
 
 ``glslangValidator``
-  The ``glslangValidator`` tool.
+  .. versionadded:: 3.24
+
+  Finds the ``glslangValidator`` tool that is used to compile GLSL and HLSL
+  shaders into SPIR-V.  This optional component is always implied automatically
+  for backward compatibility, even if not requested.
 
 ``glslang``
-  The SPIR-V generator library.
+  .. versionadded:: 3.24
+
+  Finds the Khronos-reference front-end shader parser and SPIR-V code
+  generation library (``glslang``).
 
 ``shaderc_combined``
-  The static library for Vulkan shader compilation.
+  .. versionadded:: 3.24
+
+  Finds the Google static library used for Vulkan shader compilation.
 
 ``SPIRV-Tools``
-  Tools to process SPIR-V modules.
+  .. versionadded:: 3.24
+
+  Finds Khronos library for analyzing and transforming SPIR-V modules.
 
 ``MoltenVK``
-  On macOS, an additional component ``MoltenVK`` is available.
+  .. versionadded:: 3.24
+
+  Finds the Khronos MoltenVK library, which is available on macOS, and
+  implements a subset of Vulkan API over Apple Metal graphics framework.
 
 ``dxc``
   .. versionadded:: 3.25
 
-  The DirectX Shader Compiler.
+  Finds the DirectX Shader Compiler (DXC), including the library and
+  command-line tool.  Note that Visual Studio also provides a DXC tool, but the
+  version included with the Vulkan SDK is typically required for Vulkan
+  development, as it has Vulkan capability enabled.
 
-The ``glslc`` and ``glslangValidator`` components are provided even
-if not explicitly requested (for backward compatibility).
+``volk``
+  .. versionadded:: 3.25
+
+  Finds the Vulkan meta-loader ``volk`` library, a vector-optimized library of
+  kernels.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module defines :prop_tgt:`IMPORTED` targets if Vulkan has been found:
+This module provides the following :ref:`Imported Targets`:
 
 ``Vulkan::Vulkan``
-  The main Vulkan library.
+  Target encapsulating the main Vulkan library usage requirements, available
+  if Vulkan is found.
 
 ``Vulkan::glslc``
   .. versionadded:: 3.19
 
-  The GLSLC SPIR-V compiler, if it has been found.
+  Imported executable target encapsulating the GLSLC SPIR-V compiler usage
+  requirements, available if ``glslc`` is found.
 
 ``Vulkan::Headers``
   .. versionadded:: 3.21
 
-  Provides just Vulkan headers include paths, if found.  No library is
-  included in this target.  This can be useful for applications that
-  load Vulkan library dynamically.
+  Target encapsulating the usage requirements needed to include Vulkan headers.
+  It provides only the include directories and does not link to any library.
+  This is useful for applications that load the Vulkan library dynamically at
+  runtime.  This target is available if Vulkan is found.
 
 ``Vulkan::glslangValidator``
   .. versionadded:: 3.21
 
-  The glslangValidator tool, if found.  It is used to compile GLSL and
-  HLSL shaders into SPIR-V.
+  Imported executable target encapsulating the ``glslangValidator`` usage
+  requirements, available if this tool is found.
 
 ``Vulkan::glslang``
   .. versionadded:: 3.24
 
-  Defined if SDK has the Khronos-reference front-end shader parser and SPIR-V
-  generator library (glslang).
+  Target encapsulating the ``glslang`` library usage requirements, available if
+  ``glslang`` is found in the SDK.
 
 ``Vulkan::shaderc_combined``
   .. versionadded:: 3.24
 
-  Defined if SDK has the Google static library for Vulkan shader compilation
-  (shaderc_combined).
+  Target encapsulating the ``shaderc_combined`` library usage requirements,
+  available if this library is found in the SDK.
 
 ``Vulkan::SPIRV-Tools``
   .. versionadded:: 3.24
 
-  Defined if SDK has the Khronos library to process SPIR-V modules
-  (SPIRV-Tools).
+  Target encapsulating the SPIRV-Tools library usage requirements, available if
+  this library is found in the SDK.
 
 ``Vulkan::MoltenVK``
   .. versionadded:: 3.24
 
-  Defined if SDK has the Khronos library which implement a subset of Vulkan API
-  over Apple Metal graphics framework. (MoltenVK).
+  Target encapsulating the MoltenVK library usage requirements, available if
+  this library is found in the SDK.
 
 ``Vulkan::volk``
   .. versionadded:: 3.25
 
-  Defined if SDK has the Vulkan meta-loader (volk).
+  Target encapsulating the ``volk`` library usage requirements, available if
+  ``volk`` is found in the SDK.
 
 ``Vulkan::dxc_lib``
   .. versionadded:: 3.25
 
-  Defined if SDK has the DirectX shader compiler library.
+  Target encapsulating the usage requirements for the DirectX shader compiler
+  library, available if DXC library is found in the SDK.
 
 ``Vulkan::dxc_exe``
   .. versionadded:: 3.25
 
-  Defined if SDK has the DirectX shader compiler CLI tool.
+  Imported executable target providing usage requirements for the DirectX shader
+  compiler CLI tool, available if SDK has this tool.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
@@ -115,108 +154,152 @@
 This module defines the following variables:
 
 ``Vulkan_FOUND``
-  set to true if Vulkan was found
-``Vulkan_INCLUDE_DIRS``
-  include directories for Vulkan
-``Vulkan_LIBRARIES``
-  link against this library to use Vulkan
+  Boolean indicating whether (the requested version of) Vulkan and all required
+  components are found.
+
 ``Vulkan_VERSION``
   .. versionadded:: 3.23
 
-  value from ``vulkan/vulkan_core.h``
+  The version of Vulkan found.  Value is retrieved from
+  ``vulkan/vulkan_core.h``.
+
+``Vulkan_INCLUDE_DIRS``
+  Include directories needed to use the main Vulkan library.
+
+``Vulkan_LIBRARIES``
+  Libraries needed to link against to use the main Vulkan library.
+
 ``Vulkan_glslc_FOUND``
   .. versionadded:: 3.24
 
-  True, if the SDK has the glslc executable.
+  Boolean indicating whether the SDK provides the ``glslc`` executable.
+
 ``Vulkan_glslangValidator_FOUND``
   .. versionadded:: 3.24
 
-  True, if the SDK has the glslangValidator executable.
+  Boolean indicating whether the SDK provides the ``glslangValidator``
+  executable.
+
 ``Vulkan_glslang_FOUND``
   .. versionadded:: 3.24
 
-  True, if the SDK has the glslang library.
+  Boolean indicating whether the SDK provides the ``glslang`` library.
+
 ``Vulkan_shaderc_combined_FOUND``
   .. versionadded:: 3.24
 
-  True, if the SDK has the shaderc_combined library.
+  Boolean indicating whether the SDK provides the ``shaderc_combined`` library.
+
 ``Vulkan_SPIRV-Tools_FOUND``
   .. versionadded:: 3.24
 
-  True, if the SDK has the SPIRV-Tools library.
+  Boolean indicating whether the SDK provides the SPIRV-Tools library.
+
 ``Vulkan_MoltenVK_FOUND``
   .. versionadded:: 3.24
 
-  True, if the SDK has the MoltenVK library.
+  Boolean indicating whether the SDK provides the MoltenVK library.
+
 ``Vulkan_volk_FOUND``
   .. versionadded:: 3.25
 
-  True, if the SDK has the volk library.
+  Boolean indicating whether the SDK provides the volk library.
 
 ``Vulkan_dxc_lib_FOUND``
   .. versionadded:: 3.25
 
-  True, if the SDK has the DirectX shader compiler library.
+  Boolean indicating whether the SDK provides the DirectX shader compiler
+  library.
 
 ``Vulkan_dxc_exe_FOUND``
   .. versionadded:: 3.25
 
-  True, if the SDK has the DirectX shader compiler CLI tool.
+  Boolean indicating whether the SDK provides the DirectX shader compiler CLI
+  tool.
 
+Cache Variables
+^^^^^^^^^^^^^^^
 
-The module will also defines these cache variables:
+The following cache variables may also be set:
 
 ``Vulkan_INCLUDE_DIR``
-  the Vulkan include directory
+  The directory containing Vulkan headers.
+
 ``Vulkan_LIBRARY``
-  the path to the Vulkan library
+  The path to the Vulkan library.
+
 ``Vulkan_GLSLC_EXECUTABLE``
-  the path to the GLSL SPIR-V compiler
+  .. versionadded:: 3.19
+
+  The path to the GLSL SPIR-V compiler.
+
 ``Vulkan_GLSLANG_VALIDATOR_EXECUTABLE``
-  the path to the glslangValidator tool
+  .. versionadded:: 3.21
+
+  The path to the ``glslangValidator`` tool.
+
 ``Vulkan_glslang_LIBRARY``
   .. versionadded:: 3.24
 
-  Path to the glslang library.
+  The path to the ``glslang`` library.
+
 ``Vulkan_shaderc_combined_LIBRARY``
   .. versionadded:: 3.24
 
-  Path to the shaderc_combined library.
+  The path to the ``shaderc_combined`` library.
+
 ``Vulkan_SPIRV-Tools_LIBRARY``
   .. versionadded:: 3.24
 
-  Path to the SPIRV-Tools library.
+  The path to the SPIRV-Tools library.
+
 ``Vulkan_MoltenVK_LIBRARY``
   .. versionadded:: 3.24
 
-  Path to the MoltenVK library.
+  The path to the MoltenVK library.
 
 ``Vulkan_volk_LIBRARY``
   .. versionadded:: 3.25
 
-  Path to the volk library.
+  The path to the ``volk`` library.
 
 ``Vulkan_dxc_LIBRARY``
   .. versionadded:: 3.25
 
-  Path to the DirectX shader compiler library.
+  The path to the DirectX shader compiler library.
 
 ``Vulkan_dxc_EXECUTABLE``
   .. versionadded:: 3.25
 
-  Path to the DirectX shader compiler CLI tool.
+  The path to the DirectX shader compiler CLI tool.
 
 Hints
 ^^^^^
 
-.. versionadded:: 3.18
+This module accepts the following variables:
 
-The ``VULKAN_SDK`` environment variable optionally specifies the
-location of the Vulkan SDK root directory for the given
-architecture. It is typically set by sourcing the toplevel
-``setup-env.sh`` script of the Vulkan SDK directory into the shell
-environment.
+``VULKAN_SDK``
+  This environment variable can be optionally set to specify the location of the
+  Vulkan SDK root directory for the given architecture.  It is typically set by
+  sourcing the toplevel ``setup-env.sh`` script of the Vulkan SDK directory into
+  the shell environment.
 
+Examples
+^^^^^^^^
+
+Finding the Vulkan library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(Vulkan)
+  target_link_libraries(project_target PRIVATE Vulkan::Vulkan)
+
+Finding the Vulkan library along with additional components:
+
+.. code-block:: cmake
+
+  find_package(Vulkan COMPONENTS volk)
+  target_link_libraries(project_target PRIVATE Vulkan::Vulkan Vulkan::volk)
 #]=======================================================================]
 
 cmake_policy(PUSH)
@@ -458,23 +541,35 @@
 endif()
 if(volk IN_LIST Vulkan_FIND_COMPONENTS)
   find_library(Vulkan_volk_LIBRARY
-          NAMES volk
-          HINTS
-            ${_Vulkan_hint_library_search_paths})
-  mark_as_advanced(Vulkan_Volk_LIBRARY)
+    NAMES volk
+    HINTS
+      ${_Vulkan_hint_library_search_paths})
+  mark_as_advanced(Vulkan_volk_LIBRARY)
+
+  find_library(Vulkan_volk_DEBUG_LIBRARY
+    NAMES volkd
+    HINTS
+      ${_Vulkan_hint_library_search_paths})
+  mark_as_advanced(Vulkan_volk_DEBUG_LIBRARY)
 endif()
 
 if (dxc IN_LIST Vulkan_FIND_COMPONENTS)
   find_library(Vulkan_dxc_LIBRARY
-          NAMES dxcompiler
-          HINTS
-            ${_Vulkan_hint_library_search_paths})
+    NAMES dxcompiler
+    HINTS
+      ${_Vulkan_hint_library_search_paths})
   mark_as_advanced(Vulkan_dxc_LIBRARY)
 
+  find_library(Vulkan_dxc_DEBUG_LIBRARY
+    NAMES dxcompilerd
+    HINTS
+      ${_Vulkan_hint_library_search_paths})
+  mark_as_advanced(Vulkan_dxc_DEBUG_LIBRARY)
+
   find_program(Vulkan_dxc_EXECUTABLE
-          NAMES dxc
-          HINTS
-            ${_Vulkan_hint_executable_search_paths})
+    NAMES dxc
+    HINTS
+      ${_Vulkan_hint_executable_search_paths})
   mark_as_advanced(Vulkan_dxc_EXECUTABLE)
 endif()
 
@@ -828,36 +923,57 @@
     endif()
   endif()
 
-  if(Vulkan_volk_LIBRARY AND NOT TARGET Vulkan::volk)
+  if((Vulkan_volk_LIBRARY OR Vulkan_volk_DEBUG_LIBRARY) AND NOT TARGET Vulkan::volk)
     add_library(Vulkan::volk STATIC IMPORTED)
     set_property(TARGET Vulkan::volk
             PROPERTY
               INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}")
-    set_property(TARGET Vulkan::volk APPEND
-            PROPERTY
-              IMPORTED_CONFIGURATIONS Release)
-    set_property(TARGET Vulkan::volk APPEND
-            PROPERTY
-              IMPORTED_LOCATION_RELEASE "${Vulkan_volk_LIBRARY}")
+    if(Vulkan_volk_LIBRARY)
+      set_property(TARGET Vulkan::volk APPEND
+        PROPERTY
+          IMPORTED_CONFIGURATIONS Release)
+      set_property(TARGET Vulkan::volk
+        PROPERTY
+          IMPORTED_LOCATION_RELEASE "${Vulkan_volk_LIBRARY}")
+    endif()
+    if(Vulkan_volk_DEBUG_LIBRARY)
+      set_property(TARGET Vulkan::volk APPEND
+        PROPERTY
+          IMPORTED_CONFIGURATIONS Debug)
+      set_property(TARGET Vulkan::volk
+        PROPERTY
+          IMPORTED_LOCATION_DEBUG "${Vulkan_volk_DEBUG_LIBRARY}")
+    endif()
 
     if (NOT WIN32)
       set_property(TARGET Vulkan::volk APPEND
-              PROPERTY
-                IMPORTED_LINK_INTERFACE_LIBRARIES dl)
+        PROPERTY
+          IMPORTED_LINK_INTERFACE_LIBRARIES dl)
     endif()
   endif()
 
-  if (Vulkan_dxc_LIBRARY AND NOT TARGET Vulkan::dxc_lib)
+  if ((Vulkan_dxc_LIBRARY OR Vulkan_dxc_DEBUG_LIBRARY) AND NOT TARGET Vulkan::dxc_lib)
     add_library(Vulkan::dxc_lib STATIC IMPORTED)
     set_property(TARGET Vulkan::dxc_lib
       PROPERTY
         INTERFACE_INCLUDE_DIRECTORIES "${Vulkan_INCLUDE_DIRS}")
-    set_property(TARGET Vulkan::dxc_lib APPEND
-      PROPERTY
-        IMPORTED_CONFIGURATIONS Release)
-    set_property(TARGET Vulkan::dxc_lib APPEND
-      PROPERTY
-        IMPORTED_LOCATION_RELEASE "${Vulkan_dxc_LIBRARY}")
+    if(Vulkan_dxc_LIBRARY)
+      set_property(TARGET Vulkan::dxc_lib APPEND
+        PROPERTY
+          IMPORTED_CONFIGURATIONS Release)
+      set_property(TARGET Vulkan::dxc_lib
+        PROPERTY
+          IMPORTED_LOCATION_RELEASE "${Vulkan_dxc_LIBRARY}")
+    endif()
+    if(Vulkan_dxc_DEBUG_LIBRARY)
+      set_property(TARGET Vulkan::dxc_lib APPEND
+        PROPERTY
+          IMPORTED_CONFIGURATIONS Debug)
+      set_property(TARGET Vulkan::dxc_lib
+        PROPERTY
+          IMPORTED_LOCATION_DEBUG "${Vulkan_dxc_DEBUG_LIBRARY}")
+    endif()
+
   endif()
 
   if(Vulkan_dxc_EXECUTABLE AND NOT TARGET Vulkan::dxc_exe)
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index 9e3226a..ef63d1e 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -5,14 +5,42 @@
 FindWget
 --------
 
-Find wget
+This module finds the ``wget`` command-line tool for retrieving content from web
+servers.
 
-This module looks for wget.  This module defines the following values:
+Result Variables
+^^^^^^^^^^^^^^^^
 
-::
+This module defines the following local variables:
 
-  WGET_EXECUTABLE: the full path to the wget tool.
-  WGET_FOUND: True if wget has been found.
+``Wget_FOUND``
+  True if ``wget`` has been found.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``WGET_EXECUTABLE``
+  The full path to the ``wget`` tool.
+
+Examples
+^^^^^^^^
+
+Finding ``wget`` and executing it in a process:
+
+.. code-block:: cmake
+
+  find_package(Wget)
+  if(Wget_FOUND)
+    execute_process(COMMAND ${WGET_EXECUTABLE} -h)
+  endif()
+
+See Also
+^^^^^^^^
+
+* The :command:`file(DOWNLOAD)` command to download the given URL to a local
+  file.
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index 9e39d36..00b1201 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -5,19 +5,32 @@
 FindWish
 --------
 
-Find wish installation
+Finds ``wish``, a simple windowing shell command-line executable.
 
-This module finds if TCL is installed and determines where the include
-files and libraries are.  It also determines what the name of the
-library is.  This code sets the following variables:
+This module is commonly used in conjunction with finding a TCL installation (see
+the :module:`FindTCL` module).  It helps determine where the TCL include paths
+and libraries are, as well as identifying the name of the TCL library.
 
-::
+If the :variable:`UNIX` variable is defined, the module will prioritize looking
+for the Cygwin version of ``wish`` executable.
 
-  TK_WISH = the path to the wish executable
+Cache Variables
+^^^^^^^^^^^^^^^
 
+The following cache variables may be set:
 
+``TK_WISH``
+  The path to the ``wish`` executable.
 
-if UNIX is defined, then it will look for the cygwin version first
+Examples
+^^^^^^^^
+
+Finding ``wish``:
+
+.. code-block:: cmake
+
+  find_package(Wish)
+  message(STATUS "Found wish at: ${TK_WISH}")
 #]=======================================================================]
 
 if(UNIX)
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index cfbcc30..b2f23bd 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -359,7 +359,7 @@
   if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
     find_package(Freetype QUIET)
     find_package(Fontconfig QUIET)
-    if (FREETYPE_FOUND AND Fontconfig_FOUND)
+    if (Freetype_FOUND AND Fontconfig_FOUND)
       set(X11_Xft_FOUND TRUE)
     endif ()
     list(APPEND X11_INCLUDE_DIR ${X11_Xft_INCLUDE_PATH})
diff --git a/Modules/FindXCTest.cmake b/Modules/FindXCTest.cmake
index e6c846b..696718b 100644
--- a/Modules/FindXCTest.cmake
+++ b/Modules/FindXCTest.cmake
@@ -7,64 +7,111 @@
 
 .. versionadded:: 3.3
 
-Functions to help creating and executing XCTest bundles.
+Finds the XCTest framework for writing unit tests in Xcode projects.
 
-An XCTest bundle is a CFBundle with a special product-type
-and bundle extension. The Mac Developer Library provides more
-information in the `Testing with Xcode`_ document.
+.. note::
+
+  Xcode 16 and later includes the Swift Testing framework for writing unit tests
+  in the Swift programming language, which supersedes XCTest.
+
+An XCTest bundle is a CFBundle (Core Foundation Bundle) with a special
+product type and bundle extension.  See the Apple Developer Library for more
+information in the `Testing with Xcode`_ documentation.
 
 .. _Testing with Xcode: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/testing_with_xcode/
 
-Module Functions
+Result Variables
 ^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
+
+``XCTest_FOUND``
+  Boolean indicating whether the XCTest framework and executable are found.
+
+``XCTest_INCLUDE_DIRS``
+  Include directories containing the XCTest framework headers needed to use
+  XCTest.
+
+``XCTest_LIBRARIES``
+  Libraries needed to link against to use XCTest framework.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``XCTest_EXECUTABLE``
+  The path to the ``xctest`` command-line tool used to execute XCTest bundles.
+
+Commands
+^^^^^^^^
+
+When XCTest is found, this module provides the following commands to help
+create and run XCTest bundles:
+
 .. command:: xctest_add_bundle
 
-  The ``xctest_add_bundle`` function creates a XCTest bundle named
-  <target> which will test the target <testee>. Supported target types
-  for testee are Frameworks and App Bundles:
+  Creates an XCTest bundle to test a given target:
 
   .. code-block:: cmake
 
-    xctest_add_bundle(
-      <target>  # Name of the XCTest bundle
-      <testee>  # Target name of the testee
-      )
+    xctest_add_bundle(<bundle> <testee> [<sources>...])
+
+  This command creates an XCTest bundle named ``<bundle>`` that will test the
+  specified ``<testee>`` target.
+
+  The arguments are:
+
+  ``<bundle>``
+    Name of the XCTest bundle to create.  The :prop_tgt:`XCTEST` target
+    property will be set on this bundle.
+
+  ``<testee>``
+    Name of the target to test.  Supported types for the testee are Frameworks
+    and App Bundles.
+
+  ``<sources>...``
+    One or more source files to add to the bundle.  If not provided, they must
+    be added later using commands like :command:`target_sources`.
+
+  .. note::
+    The :variable:`CMAKE_OSX_SYSROOT` variable must be set before using this
+    command.
 
 .. command:: xctest_add_test
 
-  The ``xctest_add_test`` function adds an XCTest bundle to the
-  project to be run by :manual:`ctest(1)`. The test will be named
-  <name> and tests <bundle>:
+  Adds an XCTest bundle to the project to be run during the CTest phase:
 
   .. code-block:: cmake
 
-    xctest_add_test(
-      <name>    # Test name
-      <bundle>  # Target name of XCTest bundle
-      )
+    xctest_add_test(<name> <bundle>)
 
-Module Variables
-^^^^^^^^^^^^^^^^
+  This command registers an XCTest bundle to be executed by :manual:`ctest(1)`.
+  The test will be named ``<name>`` and will run the specified ``<bundle>``.
 
-The following variables are set by including this module:
+  The arguments are:
 
-.. variable:: XCTest_FOUND
+  ``<name>``
+    Name of the test as it will appear in CTest.
 
-  True if the XCTest Framework and executable were found.
+  ``<bundle>``
+    Target name of the XCTest bundle.
 
-.. variable:: XCTest_EXECUTABLE
+Examples
+^^^^^^^^
 
-  The path to the xctest command line tool used to execute XCTest bundles.
+Finding XCTest and adding tests:
 
-.. variable:: XCTest_INCLUDE_DIRS
+.. code-block:: cmake
 
-  The directory containing the XCTest Framework headers.
+  find_package(XCTest)
 
-.. variable:: XCTest_LIBRARIES
+  add_library(foo SHARED foo.c)
 
-  The location of the XCTest Framework.
-
+  if(XCTest_FOUND)
+    xctest_add_bundle(TestAppBundle foo source.swift)
+    xctest_add_test(app.TestAppBundle TestAppBundle)
+  endif()
 #]=======================================================================]
 
 set(_PRESERVED_CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}")
@@ -181,7 +228,7 @@
     message(FATAL_ERROR "XCTest executable is required to register a test.")
   endif()
 
-  # check that bundle is a XCTest Bundle
+  # check that bundle is an XCTest Bundle
 
   if(NOT TARGET ${bundle})
     message(FATAL_ERROR "${bundle} is not a target.")
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake
index edc4dfd..949f755 100644
--- a/Modules/FindXMLRPC.cmake
+++ b/Modules/FindXMLRPC.cmake
@@ -5,31 +5,74 @@
 FindXMLRPC
 ----------
 
-Find xmlrpc
+Finds the native XML-RPC library for C and C++.  XML-RPC is a standard network
+protocol that enables remote procedure calls (RPC) between systems.  It encodes
+requests and responses in XML and uses HTTP as the transport mechanism.
 
-Find the native XMLRPC headers and libraries.
+Components
+^^^^^^^^^^
 
-::
+The XML-RPC C/C++ library consists of various features (modules) that provide
+specific functionality.  The availability of these features depends on the
+installed XML-RPC library version and system configuration.  Some features also
+have dependencies on others.
 
-  XMLRPC_INCLUDE_DIRS      - where to find xmlrpc.h, etc.
-  XMLRPC_LIBRARIES         - List of libraries when using xmlrpc.
-  XMLRPC_FOUND             - True if xmlrpc found.
+To list the available features on a system, the ``xmlrpc-c-config`` command-line
+utility can be used.
 
-XMLRPC modules may be specified as components for this find module.
-Modules may be listed by running "xmlrpc-c-config".  Modules include:
-
-::
-
-  c++            C++ wrapper code
-  libwww-client  libwww-based client
-  cgi-server     CGI-based server
-  abyss-server   ABYSS-based server
-
-Typical usage:
+In CMake, these features can be specified as components with the
+``find_package()`` command:
 
 .. code-block:: cmake
 
-  find_package(XMLRPC REQUIRED libwww-client)
+  find_package(XMLRPC [COMPONENTS <components>...])
+
+Components may be:
+
+``c++2``
+  C++ wrapper API, replacing the legacy ``c++`` feature.
+``c++``
+  The legacy C++ wrapper API (superseded by ``c++2``).
+``client``
+  XML-RPC client functions (also available as the legacy libwww-based feature
+  named ``libwww-client``).
+``cgi-server``
+  CGI-based server functions.
+``abyss-server``
+  Abyss-based server functions.
+``pstream-server``
+  The pstream-based server functions.
+``server-util``
+  Basic server functions (they are automatically included with ``*-server``
+  features).
+``abyss``
+  Abyss HTTP server (not needed with ``abyss-server``).
+``openssl``
+  OpenSSL convenience functions.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``XMLRPC_INCLUDE_DIRS``
+  Include directories containing ``xmlrpc.h`` and other headers needed to use
+  the XML-RPC library.
+``XMLRPC_LIBRARIES``
+  List of libraries needed for linking to XML-RPC library and its requested
+  features.
+``XMLRPC_FOUND``
+  Boolean indicating whether the XML-RPC library and all its requested
+  components are found.
+
+Examples
+^^^^^^^^
+
+Finding XML-RPC library and its ``client`` feature to use in the project:
+
+.. code-block:: cmake
+
+  find_package(XMLRPC REQUIRED COMPONENTS client)
 #]=======================================================================]
 
 # First find the config script from which to obtain other values.
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index 11d2551..26d859b 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -7,41 +7,62 @@
 
 .. versionadded:: 3.5
 
-Find the Apache Xalan-C++ XSL transform processor headers and libraries.
+Finds the Apache Xalan-C++ XSL transform processor headers and libraries.
+
+.. note::
+
+  The Xalan-C++ library depends on the :module:`Xerces-C++ <FindXercesC>`
+  library, which must be found for this module to succeed.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module provides the following :ref:`Imported Targets`:
 
 ``XalanC::XalanC``
-  The Xalan-C++ ``xalan-c`` library, if found.
+  Target encapsulating the Xalan-C++ library usage requirements, available only
+  if Xalan-C++ is found.
 
-Result variables
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``XalanC_FOUND``
-  true if the Xalan headers and libraries were found
+  Boolean indicating whether the Xalan-C++ is found.
 ``XalanC_VERSION``
-  Xalan release version
+  The version of the found Xalan-C++ library.
 ``XalanC_INCLUDE_DIRS``
-  the directory containing the Xalan headers; note
-  ``XercesC_INCLUDE_DIRS`` is also required
+  Include directories needed for using Xalan-C++ library.  These contain the
+  Xalan-C++ and Xerces-C++ headers.
 ``XalanC_LIBRARIES``
-  Xalan libraries to be linked; note ``XercesC_LIBRARIES`` is also
-  required
+  Libraries needed to link against Xalan-C++.  These contain the Xalan-C++ and
+  Xerces-C++ libraries.
+``XalanC_LIBRARY``
+  The path to the Xalan-C++ library (``xalan-c``), either release or debug
+  variant.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``XalanC_INCLUDE_DIR``
-  the directory containing the Xalan headers
-``XalanC_LIBRARY``
-  the Xalan library
+  The directory containing the Xalan-C++ headers.
+``XalanC_LIBRARY_RELEASE``
+  The path to a release (optimized) variant of the Xalan-C++ library.
+``XalanC_LIBRARY_DEBUG``
+  The path to a debug variant of the Xalan-C++ library.
+
+Examples
+^^^^^^^^
+
+Finding Xalan-C++ library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(XalanC)
+  target_link_libraries(project_target PRIVATE XalanC::XalanC)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake
index 68e6e70..c172d28 100644
--- a/Modules/FindXercesC.cmake
+++ b/Modules/FindXercesC.cmake
@@ -7,44 +7,63 @@
 
 .. versionadded:: 3.1
 
-Find the Apache Xerces-C++ validating XML parser headers and libraries.
+Finds the Apache Xerces-C++ validating XML parser headers and libraries.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.5
-
-This module defines the following :prop_tgt:`IMPORTED` targets:
+This module defines the following :ref:`Imported Targets`:
 
 ``XercesC::XercesC``
-  The Xerces-C++ ``xerces-c`` library, if found.
+  .. versionadded:: 3.5
 
-Result variables
+  Target encapsulating the Xerces-C++ library (``xerces-c``) usage requirements,
+  available only if Xerces-C++ is found.
+
+Result Variables
 ^^^^^^^^^^^^^^^^
 
-This module will set the following variables in your project:
+This module defines the following variables:
 
 ``XercesC_FOUND``
-  true if the Xerces headers and libraries were found
+  Boolean indicating whether the Xerces-C++ is found.
 ``XercesC_VERSION``
-  Xerces release version
+  The version of the found Xerces-C++ library.
 ``XercesC_INCLUDE_DIRS``
-  the directory containing the Xerces headers
+  Include directories needed to use Xerces-C++.
 ``XercesC_LIBRARIES``
-  Xerces libraries to be linked
+  Libraries needed to link for using Xerces-C++.
+``XercesC_LIBRARY``
+  The path to the Xerces-C++ library (``xerces-c``), either release or debug
+  variant.
 
-Cache variables
+Cache Variables
 ^^^^^^^^^^^^^^^
 
 The following cache variables may also be set:
 
 ``XercesC_INCLUDE_DIR``
-  the directory containing the Xerces headers
-``XercesC_LIBRARY``
-  the Xerces library
+  The directory containing the Xerces-C++ headers.
 
-.. versionadded:: 3.4
-  Debug and Release variants are found separately.
+``XercesC_LIBRARY_RELEASE``
+  .. versionadded:: 3.4
+
+  The path to a release (optimized) variant of the Xerces-C++ library.
+
+``XercesC_LIBRARY_DEBUG``
+  .. versionadded:: 3.4
+
+  The path to a debug variant of the Xerces-C++ library.
+
+Examples
+^^^^^^^^
+
+Finding the Xerces-C++ library and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(XercesC)
+  target_link_libraries(project_target PRIVATE XercesC::XercesC)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 2920934..fd7d41d 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -5,15 +5,18 @@
 FindZLIB
 --------
 
-Find the native ZLIB includes and library.
+Finds the native zlib data compression library.
 
 Imported Targets
 ^^^^^^^^^^^^^^^^
 
-.. versionadded:: 3.1
+This module provides the following :ref:`Imported Targets`:
 
-This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
-ZLIB has been found.
+``ZLIB::ZLIB``
+  .. versionadded:: 3.1
+
+  Target that encapsulates the zlib usage requirements.  It is available only
+  when zlib is found.
 
 Result Variables
 ^^^^^^^^^^^^^^^^
@@ -21,19 +24,22 @@
 This module defines the following variables:
 
 ``ZLIB_INCLUDE_DIRS``
-  where to find zlib.h, etc.
+  Include directories containing ``zlib.h`` and other headers needed to use
+  zlib.
+
 ``ZLIB_LIBRARIES``
-  List of libraries when using zlib.
+  List of libraries needed to link to zlib.
+
+  .. versionchanged:: 3.4
+    Debug and Release library variants can be now found separately.
+
 ``ZLIB_FOUND``
-  True if zlib found.
+  True if zlib is found.
+
 ``ZLIB_VERSION``
   .. versionadded:: 3.26
-    the version of Zlib found.
 
-  See also legacy variable ``ZLIB_VERSION_STRING``.
-
-.. versionadded:: 3.4
-  Debug and Release variants are found separately.
+  The version of zlib found.
 
 Legacy Variables
 ^^^^^^^^^^^^^^^^
@@ -45,43 +51,64 @@
 
   .. versionchanged:: 3.26
     Superseded by ``ZLIB_VERSION``.
+
 ``ZLIB_VERSION_MINOR``
   The minor version of zlib.
 
   .. versionchanged:: 3.26
     Superseded by ``ZLIB_VERSION``.
+
 ``ZLIB_VERSION_PATCH``
   The patch version of zlib.
 
   .. versionchanged:: 3.26
     Superseded by ``ZLIB_VERSION``.
+
 ``ZLIB_VERSION_TWEAK``
   The tweak version of zlib.
 
   .. versionchanged:: 3.26
     Superseded by ``ZLIB_VERSION``.
+
 ``ZLIB_VERSION_STRING``
-  The version of zlib found (x.y.z)
+  The version of zlib found (x.y.z).
 
   .. versionchanged:: 3.26
     Superseded by ``ZLIB_VERSION``.
+
 ``ZLIB_MAJOR_VERSION``
   The major version of zlib.  Superseded by ``ZLIB_VERSION_MAJOR``.
+
 ``ZLIB_MINOR_VERSION``
   The minor version of zlib.  Superseded by ``ZLIB_VERSION_MINOR``.
+
 ``ZLIB_PATCH_VERSION``
   The patch version of zlib.  Superseded by ``ZLIB_VERSION_PATCH``.
 
 Hints
 ^^^^^
 
-A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
-module where to look.
+This module accepts the following variables:
 
-.. versionadded:: 3.24
-  Set ``ZLIB_USE_STATIC_LIBS`` to ``ON`` to look for static libraries.
-  Default is ``OFF``.
+``ZLIB_ROOT``
+  A user may set this variable to a zlib installation root to help locate zlib
+  in custom installation paths.
 
+``ZLIB_USE_STATIC_LIBS``
+  .. versionadded:: 3.24
+
+  Set this variable to ``ON`` before calling ``find_package(ZLIB)`` to look for
+  static libraries.  Default is ``OFF``.
+
+Examples
+^^^^^^^^
+
+Finding zlib and linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(ZLIB)
+  target_link_libraries(project_target PRIVATE ZLIB::ZLIB)
 #]=======================================================================]
 
 cmake_policy(PUSH)
diff --git a/Modules/Findosg.cmake b/Modules/Findosg.cmake
index 4256c19..dfcb0cd 100644
--- a/Modules/Findosg.cmake
+++ b/Modules/Findosg.cmake
@@ -5,49 +5,107 @@
 Findosg
 -------
 
-
+Finds the core OpenSceneGraph osg library (``libosg``).
 
 .. note::
-  It is highly recommended that you use the new
-  :module:`FindOpenSceneGraph` introduced in CMake 2.6.3 and not use this
-  Find module directly.
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead, which automatically finds the osg core library along with its
+  required dependencies like OpenThreads:
 
-Locate osg This module defines:
+  .. code-block:: cmake
 
-``OSG_FOUND``
-  Was the Osg found?
-``OSG_INCLUDE_DIR``
-  Where to find theheaders
+    find_package(OpenSceneGraph)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the osg
+library.  It is not intended to be included directly during typical use of the
+:command:`find_package` command.  However, it is available as a standalone
+module for advanced use cases where finer control over detection is needed, such
+as explicitly finding osg library or bypassing automatic component detection:
+
+.. code-block:: cmake
+
+  find_package(osg)
+
+OpenSceneGraph core library headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osg_FOUND``
+  Boolean indicating whether osg library is found.  For backward
+  compatibility, the ``OSG_FOUND`` variable is also set to the same value.
+
 ``OSG_LIBRARIES``
-  The libraries to link against for the OSG (use this)
+  The libraries needed to link against to use osg library.
+
 ``OSG_LIBRARY``
-  The OSG library
+  A result variable that is set to the same value as the ``OSG_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSG_INCLUDE_DIR``
+  The include directory containing headers needed to use osg library.
+
 ``OSG_LIBRARY_DEBUG``
-  The OSG debug library
+  The path to the osg debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osg library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding the osg library explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osg)
+
+  if(osg_FOUND AND NOT TARGET osg::osg)
+    add_library(osg::osg INTERFACE IMPORTED)
+    set_target_properties(
+      osg::osg
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSG_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSG_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osg::osg)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgUtil/SceneView>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSG osg/PositionAttitudeTransform)
diff --git a/Modules/FindosgAnimation.cmake b/Modules/FindosgAnimation.cmake
index 300022b..b2d506d 100644
--- a/Modules/FindosgAnimation.cmake
+++ b/Modules/FindosgAnimation.cmake
@@ -5,43 +5,111 @@
 FindosgAnimation
 ----------------
 
+Finds the osgAnimation library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgAnimation as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgAnimation This module defines:
+  .. code-block:: cmake
 
-``OSGANIMATION_FOUND``
-  Was osgAnimation found?
-``OSGANIMATION_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgAnimation)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgAnimation library.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgAnimation explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgAnimation)
+
+OpenSceneGraph and osgAnimation headers are intended to be included in C++
+project source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgAnimation/Animation>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgAnimation_FOUND``
+  Boolean indicating whether the osgAnimation library of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGANIMATION_FOUND``
+  variable is also set to the same value.
+
 ``OSGANIMATION_LIBRARIES``
-  The libraries to link against for the OSG (use this)
+  The libraries needed to link against to use osgAnimation.
+
 ``OSGANIMATION_LIBRARY``
-  The OSG library
+  A result variable that is set to the same value as the
+  ``OSGANIMATION_LIBRARIES`` variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGANIMATION_INCLUDE_DIR``
+  The include directory containing headers needed to use osgAnimation.
+
 ``OSGANIMATION_LIBRARY_DEBUG``
-  The OSG debug library
+  The path to the osgAnimation debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
-Created by Eric Wing.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgAnimation library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
+
+Examples
+^^^^^^^^
+
+Finding the osgAnimation library explicitly with this module and creating an
+interface :ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgAnimation)
+
+  if(osgAnimation_FOUND AND NOT TARGET osgAnimation::osgAnimation)
+    add_library(osgAnimation::osgAnimation INTERFACE IMPORTED)
+    set_target_properties(
+      osgAnimation::osgAnimation
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGANIMATION_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGANIMATION_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgAnimation::osgAnimation)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgAnimation/Animation>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGANIMATION osgAnimation/Animation)
diff --git a/Modules/FindosgDB.cmake b/Modules/FindosgDB.cmake
index 5d7fd5c..dadc27c 100644
--- a/Modules/FindosgDB.cmake
+++ b/Modules/FindosgDB.cmake
@@ -5,48 +5,110 @@
 FindosgDB
 ---------
 
+Finds the osgDB library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgDB as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgDB This module defines:
+  .. code-block:: cmake
 
-``OSGDB_FOUND``
-  Was osgDB found?
+    find_package(OpenSceneGraph COMPONENTS osgDB)
 
-``OSGDB_INCLUDE_DIR``
-  Where to find the headers
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgDB library.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgDB explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgDB)
+
+OpenSceneGraph and osgDB headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgDB/DatabasePager>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgDB_FOUND``
+  Boolean indicating whether the osgDB library of the OpenSceneGraph toolkit is
+  found.  For backward compatibility, the ``OSGDB_FOUND`` variable is also set
+  to the same value.
 
 ``OSGDB_LIBRARIES``
-  The libraries to link against for the osgDB
+  The libraries needed to link against to use osgDB.
 
 ``OSGDB_LIBRARY``
-  The osgDB library
+  A result variable that is set to the same value as the ``OSGDB_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGDB_INCLUDE_DIR``
+  The include directory containing headers needed to use osgDB.
 
 ``OSGDB_LIBRARY_DEBUG``
-  The osgDB debug library
+  The path to the osgDB debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgDB library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
+Examples
+^^^^^^^^
+
+Finding osgDB explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgDB)
+
+  if(osgDB_FOUND AND NOT TARGET osgDB::osgDB)
+    add_library(osgDB::osgDB INTERFACE IMPORTED)
+    set_target_properties(
+      osgDB::osgDB
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGDB_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGDB_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgDB::osgDB)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgDB/DatabasePager>
-
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGDB osgDB/DatabasePager)
 OSG_FIND_LIBRARY(OSGDB osgDB)
diff --git a/Modules/FindosgFX.cmake b/Modules/FindosgFX.cmake
index 191b65f..28a13cb 100644
--- a/Modules/FindosgFX.cmake
+++ b/Modules/FindosgFX.cmake
@@ -5,44 +5,111 @@
 FindosgFX
 ---------
 
+Finds the osgFX NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgFX as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgFX This module defines:
+  .. code-block:: cmake
 
-``OSGFX_FOUND``
-  Was osgFX found?
-``OSGFX_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgFX)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgFX NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgFX explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgFX)
+
+OpenSceneGraph and osgFX headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgFX/BumpMapping>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgFX_FOUND``
+  Boolean indicating whether the osgFX NodeKit of the OpenSceneGraph toolkit
+  is found.  For backward compatibility, the ``OSGFX_FOUND`` variable is also
+  set to the same value.
+
 ``OSGFX_LIBRARIES``
-  The libraries to link against for the osgFX (use this)
+  The libraries needed to link against to use osgFX.
+
 ``OSGFX_LIBRARY``
-  The osgFX library
+  A result variable that is set to the same value as the ``OSGFX_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGFX_INCLUDE_DIR``
+  The include directory containing headers needed to use osgFX.
+
 ``OSGFX_LIBRARY_DEBUG``
-  The osgFX debug library
+  The path to the osgFX debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgFX NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgFX explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgFX)
+
+  if(osgFX_FOUND AND NOT TARGET osgFX::osgFX)
+    add_library(osgFX::osgFX INTERFACE IMPORTED)
+    set_target_properties(
+      osgFX::osgFX
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGFX_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGFX_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgFX::osgFX)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgFX/BumpMapping>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGFX osgFX/BumpMapping)
diff --git a/Modules/FindosgGA.cmake b/Modules/FindosgGA.cmake
index 192da78..3c5ceb6 100644
--- a/Modules/FindosgGA.cmake
+++ b/Modules/FindosgGA.cmake
@@ -5,44 +5,111 @@
 FindosgGA
 ---------
 
+Finds the osgGA library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgGA as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgGA This module defines:
+  .. code-block:: cmake
 
-``OSGGA_FOUND``
-  Was osgGA found?
-``OSGGA_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgGA)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgGA library.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgGA explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgGA)
+
+OpenSceneGraph and osgGA headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgGA/FlightManipulator>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgGA_FOUND``
+  Boolean indicating whether the osgGA library of the OpenSceneGraph toolkit
+  is found.  For backward compatibility, the ``OSGGA_FOUND`` variable is also
+  set to the same value.
+
 ``OSGGA_LIBRARIES``
-  The libraries to link against for the osgGA (use this)
+  The libraries needed to link against to use osgGA.
+
 ``OSGGA_LIBRARY``
-  The osgGA library
+  A result variable that is set to the same value as the ``OSGGA_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGGA_INCLUDE_DIR``
+  The include directory containing headers needed to use osgGA.
+
 ``OSGGA_LIBRARY_DEBUG``
-  The osgGA debug library
+  The path to the osgGA debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgGA library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgGA explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgGA)
+
+  if(osgGA_FOUND AND NOT TARGET osgGA::osgGA)
+    add_library(osgGA::osgGA INTERFACE IMPORTED)
+    set_target_properties(
+      osgGA::osgGA
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGGA_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGGA_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgGA::osgGA)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgGA/FlightManipulator>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGGA osgGA/FlightManipulator)
diff --git a/Modules/FindosgIntrospection.cmake b/Modules/FindosgIntrospection.cmake
index fc40421..2b87a95 100644
--- a/Modules/FindosgIntrospection.cmake
+++ b/Modules/FindosgIntrospection.cmake
@@ -5,44 +5,116 @@
 FindosgIntrospection
 --------------------
 
+Finds the osgIntrospection library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  The osgIntrospection library has been removed from the OpenSceneGraph toolkit
+  as of OpenSceneGraph version 3.0.
 
-Locate osgINTROSPECTION This module defines:
+.. note::
 
-``OSGINTROSPECTION_FOUND``
-  Was osgIntrospection found?
-``OSGINTROSPECTION_INCLUDE_DIR``
-  Where to find the headers
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgIntrospection as a component.  This will automatically
+  handle dependencies such as the OpenThreads and core osg libraries:
+
+  .. code-block:: cmake
+
+    find_package(OpenSceneGraph COMPONENTS osgIntrospection)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgIntrospection library.  It is not intended to be included directly during
+typical use of the :command:`find_package` command.  However, it is available as
+a standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgIntrospection explicitly or bypass
+automatic component detection:
+
+.. code-block:: cmake
+
+  find_package(osgIntrospection)
+
+OpenSceneGraph and osgIntrospection headers are intended to be included in C++
+project source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgIntrospection/Reflection>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgIntrospection_FOUND``
+  Boolean indicating whether the osgIntrospection library of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGINTROSPECTION_FOUND``
+  variable is also set to the same value.
+
 ``OSGINTROSPECTION_LIBRARIES``
-  The libraries to link for osgIntrospection (use this)
+  The libraries needed to link against to use osgIntrospection.
+
 ``OSGINTROSPECTION_LIBRARY``
-  The osgIntrospection library
+  A result variable that is set to the same value as the
+  ``OSGINTROSPECTION_LIBRARIES`` variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGINTROSPECTION_INCLUDE_DIR``
+  The include directory containing headers needed to use osgIntrospection.
+
 ``OSGINTROSPECTION_LIBRARY_DEBUG``
-  The osgIntrospection debug library
+  The path to the osgIntrospection debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgIntrospection library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgIntrospection explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgIntrospection)
+
+  if(osgIntrospection_FOUND AND NOT TARGET osgIntrospection::osgIntrospection)
+    add_library(osgIntrospection::osgIntrospection INTERFACE IMPORTED)
+    set_target_properties(
+      osgIntrospection::osgIntrospection
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGINTROSPECTION_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGINTROSPECTION_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgIntrospection::osgIntrospection)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgIntrospection/Reflection>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGINTROSPECTION osgIntrospection/Reflection)
diff --git a/Modules/FindosgManipulator.cmake b/Modules/FindosgManipulator.cmake
index 908c767..34fc23a 100644
--- a/Modules/FindosgManipulator.cmake
+++ b/Modules/FindosgManipulator.cmake
@@ -5,44 +5,111 @@
 FindosgManipulator
 ------------------
 
+Finds the osgManipulator NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgManipulator as a component.  This will automatically
+  handle dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgManipulator This module defines:
+  .. code-block:: cmake
 
-``OSGMANIPULATOR_FOUND``
-  Was osgManipulator found?
-``OSGMANIPULATOR_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgManipulator)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgManipulator NodeKit.  It is not intended to be included directly during
+typical use of the :command:`find_package` command.  However, it is available as
+a standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgManipulator explicitly or bypass
+automatic component detection:
+
+.. code-block:: cmake
+
+  find_package(osgManipulator)
+
+OpenSceneGraph and osgManipulator headers are intended to be included in C++
+project source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgManipulator/TrackballDragger>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgManipulator_FOUND``
+  Boolean indicating whether the osgManipulator NodeKit of the
+  OpenSceneGraph toolkit is found.  For backward compatibility, the
+  ``OSGMANIPULATOR_FOUND`` variable is also set to the same value.
+
 ``OSGMANIPULATOR_LIBRARIES``
-  The libraries to link for osgManipulator (use this)
+  The libraries needed to link against to use osgManipulator.
+
 ``OSGMANIPULATOR_LIBRARY``
-  The osgManipulator library
+  A result variable that is set to the same value as the
+  ``OSGMANIPULATOR_LIBRARIES`` variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGMANIPULATOR_INCLUDE_DIR``
+  The include directory containing headers needed to use osgManipulator.
+
 ``OSGMANIPULATOR_LIBRARY_DEBUG``
-  The osgManipulator debug library
+  The path to the osgManipulator debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgManipulator NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgManipulator explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgManipulator)
+
+  if(osgManipulator_FOUND AND NOT TARGET osgManipulator::osgManipulator)
+    add_library(osgManipulator::osgManipulator INTERFACE IMPORTED)
+    set_target_properties(
+      osgManipulator::osgManipulator
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGMANIPULATOR_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGMANIPULATOR_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgManipulator::osgManipulator)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgManipulator/TrackballDragger>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGMANIPULATOR osgManipulator/TrackballDragger)
diff --git a/Modules/FindosgParticle.cmake b/Modules/FindosgParticle.cmake
index 1a9c278..637a893 100644
--- a/Modules/FindosgParticle.cmake
+++ b/Modules/FindosgParticle.cmake
@@ -5,44 +5,111 @@
 FindosgParticle
 ---------------
 
+Finds the osgParticle NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgParticle as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgParticle This module defines:
+  .. code-block:: cmake
 
-``OSGPARTICLE_FOUND``
-  Was osgParticle found?
-``OSGPARTICLE_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgParticle)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgParticle NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgParticle explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgParticle)
+
+OpenSceneGraph and osgParticle headers are intended to be included in C++
+project source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgParticle/FireEffect>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgParticle_FOUND``
+  Boolean indicating whether the osgParticle NodeKit of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGPARTICLE_FOUND``
+  variable is also set to the same value.
+
 ``OSGPARTICLE_LIBRARIES``
-  The libraries to link for osgParticle (use this)
+  The libraries needed to link against to use the osgParticle NodeKit
+
 ``OSGPARTICLE_LIBRARY``
-  The osgParticle library
+  A result variable that is set to the same value as the
+  ``OSGPARTICLE_LIBRARIES`` variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGPARTICLE_INCLUDE_DIR``
+  The include directory containing headers needed to use osgParticle NodeKit.
+
 ``OSGPARTICLE_LIBRARY_DEBUG``
-  The osgParticle debug library
+  The path to the osgParticle debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgParticle NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgParticle explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgParticle)
+
+  if(osgParticle_FOUND AND NOT TARGET osgParticle::osgParticle)
+    add_library(osgParticle::osgParticle INTERFACE IMPORTED)
+    set_target_properties(
+      osgParticle::osgParticle
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGPARTICLE_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGPARTICLE_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgParticle::osgParticle)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgParticle/FireEffect>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGPARTICLE osgParticle/FireEffect)
diff --git a/Modules/FindosgPresentation.cmake b/Modules/FindosgPresentation.cmake
index 07f022e..4a74de5 100644
--- a/Modules/FindosgPresentation.cmake
+++ b/Modules/FindosgPresentation.cmake
@@ -5,44 +5,113 @@
 FindosgPresentation
 -------------------
 
+Finds the osgPresentation NodeKit from the OpenSceneGraph toolkit, available
+since OpenSceneGraph version 3.0.0.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgPresentation as a component.  This will automatically
+  handle dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgPresentation This module defines:
+  .. code-block:: cmake
 
-``OSGPRESENTATION_FOUND``
-  Was osgPresentation found?
-``OSGPRESENTATION_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgPresentation)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgPresentation NodeKit.  It is not intended to be included directly during
+typical use of the :command:`find_package` command.  However, it is available as
+a standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgPresentation explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgPresentation)
+
+OpenSceneGraph and osgPresentation headers are intended to be included in C++
+project source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgPresentation/SlideEventHandler>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgPresentation_FOUND``
+  Boolean indicating whether the osgPresentation NodeKit of the
+  OpenSceneGraph toolkit is found.  For backward compatibility, the
+  ``OSGPRESENTATION_FOUND`` variable is also set to the same value.
+
 ``OSGPRESENTATION_LIBRARIES``
-  The libraries to link for osgPresentation (use this)
+  The libraries needed to link against to use osgPresentation.
+
 ``OSGPRESENTATION_LIBRARY``
-  The osgPresentation library
+  A result variable that is set to the same value as the
+  ``OSGPRESENTATION_LIBRARIES`` variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGPRESENTATION_INCLUDE_DIR``
+  The include directory containing headers needed to use osgPresentation.
+
 ``OSGPRESENTATION_LIBRARY_DEBUG``
-  The osgPresentation debug library
+  The path to the osgPresentation debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
-Created by Eric Wing.  Modified to work with osgPresentation by Robert
-Osfield, January 2012.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgPresentation NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
+
+Examples
+^^^^^^^^
+
+Finding osgPresentation explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgPresentation)
+
+  if(osgPresentation_FOUND AND NOT TARGET osgPresentation::osgPresentation)
+    add_library(osgPresentation::osgPresentation INTERFACE IMPORTED)
+    set_target_properties(
+      osgPresentation::osgPresentation
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGPRESENTATION_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGPRESENTATION_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgPresentation::osgPresentation)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgPresentation/SlideEventHandler>
+# Created by Eric Wing.
+# Modified to work with osgPresentation by Robert Osfield, January 2012.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGPRESENTATION osgPresentation/SlideEventHandler)
diff --git a/Modules/FindosgProducer.cmake b/Modules/FindosgProducer.cmake
index ca949b7..69f86d2 100644
--- a/Modules/FindosgProducer.cmake
+++ b/Modules/FindosgProducer.cmake
@@ -5,44 +5,120 @@
 FindosgProducer
 ---------------
 
+Finds the osgProducer utility library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  The osgProducer library has been removed from the OpenSceneGraph toolkit in
+  early OpenSceneGraph versions (pre 1.0 release) and replaced with osgViewer.
+  Its development has shifted at time to a standalone project and repository
+  Producer, which can be found with :module:`FindProducer` module.
 
-Locate osgProducer This module defines:
+.. note::
 
-``OSGPRODUCER_FOUND``
-  Was osgProducer found?
-``OSGPRODUCER_INCLUDE_DIR``
-  Where to find the headers
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgProducer as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
+
+  .. code-block:: cmake
+
+    find_package(OpenSceneGraph COMPONENTS osgProducer)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgProducer library.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgProducer explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgProducer)
+
+OpenSceneGraph and osgProducer headers are intended to be included in C++
+project source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgProducer/OsgSceneHandler>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgProducer_FOUND``
+  Boolean indicating whether the osgProducer library of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGPRODUCER_FOUND``
+  variable is also set to the same value.
+
 ``OSGPRODUCER_LIBRARIES``
-  The libraries to link for osgProducer (use this)
+  The libraries needed to link against to use osgProducer.
+
 ``OSGPRODUCER_LIBRARY``
-  The osgProducer library
+  A result variable that is set to the same value as the
+  ``OSGPRODUCER_LIBRARIES`` variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGPRODUCER_INCLUDE_DIR``
+  The include directory containing headers needed to use osgProducer.
+
 ``OSGPRODUCER_LIBRARY_DEBUG``
-  The osgProducer debug library
+  The path to the osgProducer debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgProducer library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgProducer explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgProducer)
+
+  if(osgProducer_FOUND AND NOT TARGET osgProducer::osgProducer)
+    add_library(osgProducer::osgProducer INTERFACE IMPORTED)
+    set_target_properties(
+      osgProducer::osgProducer
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGPRODUCER_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGPRODUCER_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgProducer::osgProducer)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
+* The :module:`FindProducer` module, which finds the standalone Producer library
+  that evolved from the legacy osgProducer.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgProducer/OsgSceneHandler>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGPRODUCER osgProducer/OsgSceneHandler)
diff --git a/Modules/FindosgQt.cmake b/Modules/FindosgQt.cmake
index 3f170fe..3fd817d 100644
--- a/Modules/FindosgQt.cmake
+++ b/Modules/FindosgQt.cmake
@@ -5,45 +5,112 @@
 FindosgQt
 ---------
 
+Finds the osgQt utility library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgQt as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgQt This module defines:
+  .. code-block:: cmake
 
-``OSGQT_FOUND``
-  Was osgQt found?
-``OSGQT_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgQt)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgQt library.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgQt explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgQt)
+
+OpenSceneGraph and osgQt headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgQt/GraphicsWindowQt>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgQt_FOUND``
+  Boolean indicating whether the osgQt library of the OpenSceneGraph toolkit
+  is found.  For backward compatibility, the ``OSGQT_FOUND`` variable is also
+  set to the same value.
+
 ``OSGQT_LIBRARIES``
-  The libraries to link for osgQt (use this)
+  The libraries needed to link against to use osgQt.
+
 ``OSGQT_LIBRARY``
-  The osgQt library
+  A result variable that is set to the same value as the ``OSGQT_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGQT_INCLUDE_DIR``
+  The include directory containing headers needed to use osgQt.
+
 ``OSGQT_LIBRARY_DEBUG``
-  The osgQt debug library
+  The path to the osgQt debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgQt library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.  Modified to work with osgQt by Robert Osfield,
-January 2012.
+Examples
+^^^^^^^^
+
+Finding osgQt explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgQt)
+
+  if(osgQt_FOUND AND NOT TARGET osgQt::osgQt)
+    add_library(osgQt::osgQt INTERFACE IMPORTED)
+    set_target_properties(
+      osgQt::osgQt
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGQT_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGQT_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgQt::osgQt)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgQt/GraphicsWindowQt>
+# Created by Eric Wing.
+# Modified to work with osgQt by Robert Osfield, January 2012.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGQT osgQt/GraphicsWindowQt)
diff --git a/Modules/FindosgShadow.cmake b/Modules/FindosgShadow.cmake
index e168146..d2f2ea7 100644
--- a/Modules/FindosgShadow.cmake
+++ b/Modules/FindosgShadow.cmake
@@ -5,44 +5,111 @@
 FindosgShadow
 -------------
 
+Finds the osgShadow NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgShadow as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgShadow This module defines:
+  .. code-block:: cmake
 
-``OSGSHADOW_FOUND``
-  Was osgShadow found?
-``OSGSHADOW_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgShadow)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgShadow NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgShadow explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgShadow)
+
+OpenSceneGraph and osgShadow headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgShadow/ShadowTexture>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgShadow_FOUND``
+  Boolean indicating whether the osgShadow NodeKit of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGSHADOW_FOUND``
+  variable is also set to the same value.
+
 ``OSGSHADOW_LIBRARIES``
-  The libraries to link for osgShadow (use this)
+  The libraries needed to link against to use osgShadow.
+
 ``OSGSHADOW_LIBRARY``
-  The osgShadow library
+  A result variable that is set to the same value as the ``OSGSHADOW_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGSHADOW_INCLUDE_DIR``
+  The include directory containing headers needed to use osgShadow.
+
 ``OSGSHADOW_LIBRARY_DEBUG``
-  The osgShadow debug library
+  The path to the osgShadow debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgShadow NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgShadow explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgShadow)
+
+  if(osgShadow_FOUND AND NOT TARGET osgShadow::osgShadow)
+    add_library(osgShadow::osgShadow INTERFACE IMPORTED)
+    set_target_properties(
+      osgShadow::osgShadow
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGSHADOW_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGSHADOW_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgShadow::osgShadow)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgShadow/ShadowTexture>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGSHADOW osgShadow/ShadowTexture)
diff --git a/Modules/FindosgSim.cmake b/Modules/FindosgSim.cmake
index b152584..d981d7d 100644
--- a/Modules/FindosgSim.cmake
+++ b/Modules/FindosgSim.cmake
@@ -5,44 +5,111 @@
 FindosgSim
 ----------
 
+Finds the osgSim NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgSim as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgSim This module defines:
+  .. code-block:: cmake
 
-``OSGSIM_FOUND``
-  Was osgSim found?
-``OSGSIM_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgSim)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgSim NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgSim explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgSim)
+
+OpenSceneGraph and osgSim headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgSim/ImpostorSprite>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgSim_FOUND``
+  Boolean indicating whether the osgSim NodeKit of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGSIM_FOUND`` variable
+  is also set to the same value.
+
 ``OSGSIM_LIBRARIES``
-  The libraries to link for osgSim (use this)
+  The libraries needed to link against to use osgSim.
+
 ``OSGSIM_LIBRARY``
-  The osgSim library
+  A result variable that is set to the same value as the ``OSGSIM_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGSIM_INCLUDE_DIR``
+  The include directory containing headers needed to use osgSim.
+
 ``OSGSIM_LIBRARY_DEBUG``
-  The osgSim debug library
+  The path to the osgSim debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgSim NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgSim explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgSim)
+
+  if(osgSim_FOUND AND NOT TARGET osgSim::osgSim)
+    add_library(osgSim::osgSim INTERFACE IMPORTED)
+    set_target_properties(
+      osgSim::osgSim
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGSIM_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGSIM_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgSim::osgSim)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgSim/ImpostorSprite>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGSIM osgSim/ImpostorSprite)
diff --git a/Modules/FindosgTerrain.cmake b/Modules/FindosgTerrain.cmake
index 4bebf87..ed0d858 100644
--- a/Modules/FindosgTerrain.cmake
+++ b/Modules/FindosgTerrain.cmake
@@ -5,44 +5,111 @@
 FindosgTerrain
 --------------
 
+Finds the osgTerrain NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgTerrain as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgTerrain This module defines:
+  .. code-block:: cmake
 
-``OSGTERRAIN_FOUND``
-  Was osgTerrain found?
-``OSGTERRAIN_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgTerrain)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgTerrain NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgTerrain explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgTerrain)
+
+OpenSceneGraph and osgTerrain headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgTerrain/Terrain>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgTerrain_FOUND``
+  Boolean indicating whether the osgTerrain NodeKit of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGTERRAIN_FOUND``
+  variable is also set to the same value.
+
 ``OSGTERRAIN_LIBRARIES``
-  The libraries to link for osgTerrain (use this)
+  The libraries needed to link against to use osgTerrain.
+
 ``OSGTERRAIN_LIBRARY``
-  The osgTerrain library
+  A result variable that is set to the same value as the
+  ``OSGTERRAIN_LIBRARIES`` variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGTERRAIN_INCLUDE_DIR``
+  The include directory containing headers needed to use osgTerrain.
+
 ``OSGTERRAIN_LIBRARY_DEBUG``
-  The osgTerrain debug library
+  The path to the osgTerrain debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgTerrain NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgTerrain explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgTerrain)
+
+  if(osgTerrain_FOUND AND NOT TARGET osgTerrain::osgTerrain)
+    add_library(osgTerrain::osgTerrain INTERFACE IMPORTED)
+    set_target_properties(
+      osgTerrain::osgTerrain
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGTERRAIN_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGTERRAIN_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgTerrain::osgTerrain)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgTerrain/Terrain>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGTERRAIN osgTerrain/Terrain)
diff --git a/Modules/FindosgText.cmake b/Modules/FindosgText.cmake
index 21e6a80..67f532a 100644
--- a/Modules/FindosgText.cmake
+++ b/Modules/FindosgText.cmake
@@ -5,44 +5,111 @@
 FindosgText
 -----------
 
+Finds the osgText NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgText as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgText This module defines:
+  .. code-block:: cmake
 
-``OSGTEXT_FOUND``
-  Was osgText found?
-``OSGTEXT_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgText)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgText NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgText explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgText)
+
+OpenSceneGraph and osgText headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgText/Text>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgText_FOUND``
+  Boolean indicating whether the osgText NodeKit of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGTEXT_FOUND``
+  variable is also set to the same value.
+
 ``OSGTEXT_LIBRARIES``
-  The libraries to link for osgText (use this)
+  The libraries needed to link against to use osgText.
+
 ``OSGTEXT_LIBRARY``
-  The osgText library
+  A result variable that is set to the same value as the ``OSGTEXT_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGTEXT_INCLUDE_DIR``
+  The include directory containing headers needed to use osgText.
+
 ``OSGTEXT_LIBRARY_DEBUG``
-  The osgText debug library
+  The path to the osgText debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgText NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgText explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgText)
+
+  if(osgText_FOUND AND NOT TARGET osgText::osgText)
+    add_library(osgText::osgText INTERFACE IMPORTED)
+    set_target_properties(
+      osgText::osgText
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGTEXT_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGTEXT_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgText::osgText)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgText/Text>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGTEXT osgText/Text)
diff --git a/Modules/FindosgUtil.cmake b/Modules/FindosgUtil.cmake
index 2ab0de7..2b6bc23 100644
--- a/Modules/FindosgUtil.cmake
+++ b/Modules/FindosgUtil.cmake
@@ -5,44 +5,111 @@
 FindosgUtil
 -----------
 
+Finds the osgUtil library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgUtil as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgUtil This module defines:
+  .. code-block:: cmake
 
-``OSGUTIL_FOUND``
-  Was osgUtil found?
-``OSGUTIL_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgUtil)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgUtil library.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgUtil explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgUtil)
+
+OpenSceneGraph and osgUtil headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgUtil/SceneView>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgUtil_FOUND``
+  Boolean indicating whether the osgUtil library of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGUTIL_FOUND`` variable
+  is also set to the same value.
+
 ``OSGUTIL_LIBRARIES``
-  The libraries to link for osgUtil (use this)
+  The libraries needed to link against to use osgUtil.
+
 ``OSGUTIL_LIBRARY``
-  The osgUtil library
+  A result variable that is set to the same value as the ``OSGUTIL_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGUTIL_INCLUDE_DIR``
+  The include directory containing headers needed to use osgUtil.
+
 ``OSGUTIL_LIBRARY_DEBUG``
-  The osgUtil debug library
+  The path to the osgUtil debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgUtil library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgUtil explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgUtil)
+
+  if(osgUtil_FOUND AND NOT TARGET osgUtil::osgUtil)
+    add_library(osgUtil::osgUtil INTERFACE IMPORTED)
+    set_target_properties(
+      osgUtil::osgUtil
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGUTIL_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGUTIL_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgUtil::osgUtil)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgUtil/SceneView>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGUTIL osgUtil/SceneView)
diff --git a/Modules/FindosgViewer.cmake b/Modules/FindosgViewer.cmake
index 23e7d6b33..bb4e676 100644
--- a/Modules/FindosgViewer.cmake
+++ b/Modules/FindosgViewer.cmake
@@ -5,44 +5,111 @@
 FindosgViewer
 -------------
 
+Finds the osgViewer library from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgViewer as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgViewer This module defines:
+  .. code-block:: cmake
 
-``OSGVIEWER_FOUND``
-  Was osgViewer found?
-``OSGVIEWER_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgViewer)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgViewer library.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgViewer explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgViewer)
+
+OpenSceneGraph and osgViewer headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgViewer/Viewer>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgViewer_FOUND``
+  Boolean indicating whether the osgViewer library of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGVIEWER_FOUND``
+  variable is also set to the same value.
+
 ``OSGVIEWER_LIBRARIES``
-  The libraries to link for osgViewer (use this)
+  The libraries needed to link against to use osgViewer.
+
 ``OSGVIEWER_LIBRARY``
-  The osgViewer library
+  A result variable that is set to the same value as the ``OSGVIEWER_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGVIEWER_INCLUDE_DIR``
+  The include directory containing headers needed to use osgViewer.
+
 ``OSGVIEWER_LIBRARY_DEBUG``
-  The osgViewer debug library
+  The path to the osgViewer debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgViewer library, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgViewer explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgViewer)
+
+  if(osgViewer_FOUND AND NOT TARGET osgViewer::osgViewer)
+    add_library(osgViewer::osgViewer INTERFACE IMPORTED)
+    set_target_properties(
+      osgViewer::osgViewer
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGVIEWER_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGVIEWER_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgViewer::osgViewer)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgViewer/Viewer>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGVIEWER osgViewer/Viewer)
diff --git a/Modules/FindosgVolume.cmake b/Modules/FindosgVolume.cmake
index da45d29..0e447e9 100644
--- a/Modules/FindosgVolume.cmake
+++ b/Modules/FindosgVolume.cmake
@@ -5,44 +5,111 @@
 FindosgVolume
 -------------
 
+Finds the osgVolume NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgVolume as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgVolume This module defines:
+  .. code-block:: cmake
 
-``OSGVOLUME_FOUND``
-  Was osgVolume found?
-``OSGVOLUME_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgVolume)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgVolume NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgVolume explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgVolume)
+
+OpenSceneGraph and osgVolume headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgVolume/Volume>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgVolume_FOUND``
+  Boolean indicating whether the osgVolume NodeKit of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGVOLUME_FOUND``
+  variable is also set to the same value.
+
 ``OSGVOLUME_LIBRARIES``
-  The libraries to link for osgVolume (use this)
+  The libraries needed to link against to use osgVolume.
+
 ``OSGVOLUME_LIBRARY``
-  The osgVolume library
+  A result variable that is set to the same value as the ``OSGVOLUME_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGVOLUME_INCLUDE_DIR``
+  The include directory containing headers needed to use osgVolume.
+
 ``OSGVOLUME_LIBRARY_DEBUG``
-  The osgVolume debug library
+  The path to the osgVolume debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgVolume NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-Created by Eric Wing.
+Examples
+^^^^^^^^
+
+Finding osgVolume explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgVolume)
+
+  if(osgVolume_FOUND AND NOT TARGET osgVolume::osgVolume)
+    add_library(osgVolume::osgVolume INTERFACE IMPORTED)
+    set_target_properties(
+      osgVolume::osgVolume
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGVOLUME_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGVOLUME_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgVolume::osgVolume)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgVolume/Volume>
+# Created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGVOLUME osgVolume/Volume)
diff --git a/Modules/FindosgWidget.cmake b/Modules/FindosgWidget.cmake
index 75dee17..cd5da96 100644
--- a/Modules/FindosgWidget.cmake
+++ b/Modules/FindosgWidget.cmake
@@ -5,45 +5,111 @@
 FindosgWidget
 -------------
 
+Finds the osgWidget NodeKit from the OpenSceneGraph toolkit.
 
+.. note::
 
-This is part of the ``Findosg*`` suite used to find OpenSceneGraph
-components.  Each component is separate and you must opt in to each
-module.  You must also opt into OpenGL and OpenThreads (and Producer
-if needed) as these modules won't do it for you.  This is to allow you
-control over your own system piece by piece in case you need to opt
-out of certain components or change the Find behavior for a particular
-module (perhaps because the default :module:`FindOpenGL` module doesn't
-work with your system as an example).  If you want to use a more
-convenient module that includes everything, use the
-:module:`FindOpenSceneGraph` instead of the ``Findosg*.cmake`` modules.
+  In most cases, it's recommended to use the :module:`FindOpenSceneGraph` module
+  instead and list osgWidget as a component.  This will automatically handle
+  dependencies such as the OpenThreads and core osg libraries:
 
-Locate osgWidget This module defines:
+  .. code-block:: cmake
 
-``OSGWIDGET_FOUND``
-  Was osgWidget found?
-``OSGWIDGET_INCLUDE_DIR``
-  Where to find the headers
+    find_package(OpenSceneGraph COMPONENTS osgWidget)
+
+This module is used internally by :module:`FindOpenSceneGraph` to find the
+osgWidget NodeKit.  It is not intended to be included directly during typical
+use of the :command:`find_package` command.  However, it is available as a
+standalone module for advanced use cases where finer control over detection is
+needed.  For example, to find the osgWidget explicitly or bypass automatic
+component detection:
+
+.. code-block:: cmake
+
+  find_package(osgWidget)
+
+OpenSceneGraph and osgWidget headers are intended to be included in C++ project
+source code as:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <osg/PositionAttitudeTransform>
+  #include <osgWidget/Widget>
+  // ...
+
+When working with the OpenSceneGraph toolkit, other libraries such as OpenGL may
+also be required.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``osgWidget_FOUND``
+  Boolean indicating whether the osgWidget NodeKit of the OpenSceneGraph
+  toolkit is found.  For backward compatibility, the ``OSGWIDGET_FOUND``
+  variable is also set to the same value.
+
 ``OSGWIDGET_LIBRARIES``
-  The libraries to link for osgWidget (use this)
+  The libraries needed to link against to use osgWidget.
+
 ``OSGWIDGET_LIBRARY``
-  The osgWidget library
+  A result variable that is set to the same value as the ``OSGWIDGET_LIBRARIES``
+  variable.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OSGWIDGET_INCLUDE_DIR``
+  The include directory containing headers needed to use osgWidget.
+
 ``OSGWIDGET_LIBRARY_DEBUG``
-  The osgWidget debug library
+  The path to the osgWidget debug library.
 
-``$OSGDIR`` is an environment variable that would correspond to::
+Hints
+^^^^^
 
-  ./configure --prefix=$OSGDIR
+This module accepts the following variables:
 
-used in building osg.
+``OSGDIR``
+  Environment variable that can be set to help locate the OpenSceneGraph
+  toolkit, including its osgWidget NodeKit, when installed in a custom
+  location.  It should point to the OpenSceneGraph installation prefix used when
+  it was configured, built, and installed: ``./configure --prefix=$OSGDIR``.
 
-FindosgWidget.cmake tweaked from Findosg* suite as created by Eric
-Wing.
+Examples
+^^^^^^^^
+
+Finding osgWidget explicitly with this module and creating an interface
+:ref:`imported target <Imported Targets>` that encapsulates its usage
+requirements for linking it to a project target:
+
+.. code-block:: cmake
+
+  find_package(osgWidget)
+
+  if(osgWidget_FOUND AND NOT TARGET osgWidget::osgWidget)
+    add_library(osgWidget::osgWidget INTERFACE IMPORTED)
+    set_target_properties(
+      osgWidget::osgWidget
+      PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${OSGWIDGET_INCLUDE_DIR}"
+        INTERFACE_LINK_LIBRARIES "${OSGWIDGET_LIBRARIES}"
+    )
+  endif()
+
+  target_link_libraries(example PRIVATE osgWidget::osgWidget)
+
+See Also
+^^^^^^^^
+
+* The :module:`FindOpenSceneGraph` module to find OpenSceneGraph toolkit.
 #]=======================================================================]
 
-# Header files are presumed to be included like
-# #include <osg/PositionAttitudeTransform>
-# #include <osgWidget/Widget>
+# FindosgWidget.cmake tweaked from Findosg* suite as created by Eric Wing.
 
 include(${CMAKE_CURRENT_LIST_DIR}/Findosg_functions.cmake)
 OSG_FIND_PATH   (OSGWIDGET osgWidget/Widget)
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index 9fdeb95..8fdfaeb 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -5,13 +5,13 @@
 Findosg_functions
 -----------------
 
+.. note::
 
-
-
-
-This CMake file contains two macros to assist with searching for OSG
-libraries and nodekits.  Please see :module:`FindOpenSceneGraph` for full
-documentation.
+  This module is not intended to be included or invoked directly by project code
+  during typical use of :command:`find_package` command.  It is internally used
+  by OpenSceneGraph (OSG) find modules to assist with searching for OSG
+  libraries and NodeKits.  For usage details refer to the
+  :module:`FindOpenSceneGraph` module.
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 86f34ee..fa2ad7b 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -963,6 +963,10 @@
     foreach(_wx_lib_ ${wxWidgets_LIBRARIES})
       if("${_wx_lib_}" MATCHES "^-l(.*)")
         set(_wx_lib_name "${CMAKE_MATCH_1}")
+        if(_wx_lib_name STREQUAL "atomic")
+          continue()
+        endif()
+
         unset(_wx_lib_found CACHE)
         find_library(_wx_lib_found NAMES ${_wx_lib_name} HINTS ${wxWidgets_LIBRARY_DIRS})
         if(_wx_lib_found STREQUAL _wx_lib_found-NOTFOUND)
@@ -1057,8 +1061,8 @@
 #
 # NOTE: This is a generic piece of code that should be renamed to
 # SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as
-# FindPackageStandardArgs.cmake. At the time of this writing
-# FindQt4.cmake has a QT4_EXTRACT_OPTIONS, which I basically copied
+# FindPackageHandleStandardArgs.cmake. At the time of this writing
+# FindQt4.cmake has a qt4_extract_options(), which I basically copied
 # here a bit more generalized. So, there are already two find modules
 # using this approach.
 #
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index 83d6018..88af70c 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -9,79 +9,112 @@
 
   Replaced by :module:`FindwxWidgets`.
 
-Find wxWindows (wxWidgets) installation
+Finds the wxWidgets (formerly known as wxWindows) installation and determines
+the locations of its include directories and libraries, as well as the name of
+the library.
 
-This module finds if wxWindows/wxWidgets is installed and determines
-where the include files and libraries are.  It also determines what
-the name of the library is.  This code sets the following variables:
+wxWidgets 2.6.x is supported for monolithic builds, such as those compiled in
+the ``wx/build/msw`` directory using:
 
-::
-
-  WXWINDOWS_FOUND     = system has WxWindows
-  WXWINDOWS_LIBRARIES = path to the wxWindows libraries
-                        on Unix/Linux with additional
-                        linker flags from
-                        "wx-config --libs"
-  CMAKE_WXWINDOWS_CXX_FLAGS  = Compiler flags for wxWindows,
-                               essentially "`wx-config --cxxflags`"
-                               on Linux
-  WXWINDOWS_INCLUDE_DIR      = where to find "wx/wx.h" and "wx/setup.h"
-  WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
-                                Unix
-  WXWINDOWS_DEFINITIONS      = extra defines
-
-
-
-OPTIONS If you need OpenGL support please
-
-.. code-block:: cmake
-
-  set(WXWINDOWS_USE_GL 1)
-
-in your CMakeLists.txt *before* you include this file.
-
-::
-
-  HAVE_ISYSTEM      - true required to replace -I by -isystem on g++
-
-
-
-For convenience include Use_wxWindows.cmake in your project's
-CMakeLists.txt using
-include(${CMAKE_CURRENT_LIST_DIR}/Use_wxWindows.cmake).
-
-USAGE
-
-.. code-block:: cmake
-
-  set(WXWINDOWS_USE_GL 1)
-  find_package(wxWindows)
-
-
-
-NOTES wxWidgets 2.6.x is supported for monolithic builds e.g.
-compiled in wx/build/msw dir as:
-
-::
+.. code-block:: shell
 
   nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
 
+Result Variables
+^^^^^^^^^^^^^^^^
 
+This module defines the following variables:
 
-DEPRECATED
+``WXWINDOWS_FOUND``
+  Boolean indicating whether the wxWidgets is found.
+``WXWINDOWS_LIBRARIES``
+  Libraries needed to link against to use wxWidgets.  This includes paths to
+  the wxWidgets libraries and any additional linker flags, typically derived
+  from the output of ``wx-config --libs`` on Unix/Linux systems.
+``CMAKE_WXWINDOWS_CXX_FLAGS``
+  Compiler options needed to use wxWidgets (if any).  On Linux, this corresponds
+  to the output of ``wx-config --cxxflags``.
+``WXWINDOWS_INCLUDE_DIR``
+  The directory containing the ``wx/wx.h`` and ``wx/setup.h`` header files.
+``WXWINDOWS_LINK_DIRECTORIES``
+  Link directories, useful for setting ``rpath`` on Unix-like platforms.
+``WXWINDOWS_DEFINITIONS``
+  Extra compile definitions needed to use wxWidgets (if any).
 
-::
+Hints
+^^^^^
 
-  CMAKE_WX_CAN_COMPILE
-  WXWINDOWS_LIBRARY
-  CMAKE_WX_CXX_FLAGS
-  WXWINDOWS_INCLUDE_PATH
+This module accepts the following variables before calling the
+``find_package(wxWindows)``:
 
+``WXWINDOWS_USE_GL``
+  Set this variable to boolean true to require OpenGL support.
 
+``HAVE_ISYSTEM``
+  Set this variable to boolean true to replace ``-I`` compiler options with
+  ``-isystem`` when the C++ compiler is GNU (``g++``).
 
-AUTHOR Jan Woetzel (07/2003-01/2006)
+Deprecated Variables
+^^^^^^^^^^^^^^^^^^^^
+
+These variables are provided for backward compatibility:
+
+``CMAKE_WX_CAN_COMPILE``
+  .. deprecated:: 1.8
+    Replaced by the ``WXWINDOWS_FOUND`` variable with the same value.
+
+``WXWINDOWS_LIBRARY``
+  .. deprecated:: 1.8
+    Replaced by the ``WXWINDOWS_LIBRARIES`` variable with the same value.
+
+``CMAKE_WX_CXX_FLAGS``
+  .. deprecated:: 1.8
+    Replaced by the ``CMAKE_WXWINDOWS_CXX_FLAGS`` variable with the same value.
+
+``WXWINDOWS_INCLUDE_PATH``
+  .. deprecated:: 1.8
+    Replaced by the ``WXWINDOWS_INCLUDE_DIR`` variable with the same value.
+
+Examples
+^^^^^^^^
+
+Example: Finding wxWidgets in earlier CMake versions
+""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+In earlier versions of CMake, wxWidgets (wxWindows) could be found using:
+
+.. code-block:: cmake
+
+  find_package(wxWindows)
+
+To request OpenGL support, the ``WXWINDOWS_USE_GL`` variable could be set before
+calling ``find_package()``:
+
+.. code-block:: cmake
+
+  set(WXWINDOWS_USE_GL ON)
+  find_package(wxWindows)
+
+Using wxWidgets (wxWindows) in CMake was commonly done by including the
+:module:`Use_wxWindows` module, which would find wxWidgets and set the
+appropriate libraries, include directories, and compiler flags:
+
+.. code-block:: cmake
+
+  include(Use_wxWindows)
+
+Example: Finding wxWidgets as of CMake 3.0
+""""""""""""""""""""""""""""""""""""""""""
+
+Starting with CMake 3.0, wxWidgets can be found using the
+:module:`FindwxWidgets` module:
+
+.. code-block:: cmake
+
+  find_package(wxWidgets)
 #]=======================================================================]
 
+# AUTHOR Jan Woetzel (07/2003-01/2006)
 # ------------------------------------------------------------------
 #
 # -removed OPTION for CMAKE_WXWINDOWS_USE_GL. Force the developer to SET it before calling this.
@@ -649,7 +682,7 @@
       # set CXXFLAGS to be fed into CMAKE_CXX_FLAGS by the user:
       if (HAVE_ISYSTEM) # does the compiler support -isystem ?
               if (NOT APPLE) # -isystem seems to be unsupported on Mac
-                if(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX )
+                if(CMAKE_C_COMPILER_ID MATCHES "^(GNU|LCC)$" AND CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|LCC)$")
             if (CMAKE_CXX_COMPILER MATCHES g\\+\\+)
               set(CMAKE_WXWINDOWS_CXX_FLAGS "`${CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE} --cxxflags|sed -e s/-I/-isystem/g`")
             else()
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 685f310..70ad3c7 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -59,6 +59,19 @@
   The case for a module symbol without an underscore,
   either ``UPPER`` or ``LOWER``.
 
+``FortranCInterface_MODULE_ORDER``
+  .. versionadded:: 4.1
+
+  Order of components for module symbols without an underscore:
+
+  ``MODULE_THEN_SYMBOL``
+    The module name appears *before* the symbol name, i.e.,
+    ``<PREFIX><module><MIDDLE><symbol><SUFFIX>``.
+
+  ``SYMBOL_THEN_MODULE``
+    The module name appears *after* the symbol name, i.e.,
+    ``<PREFIX><symbol><MIDDLE><module><SUFFIX>``.
+
 ``FortranCInterface_MODULE__PREFIX``
   Prefix for a module symbol with an underscore.
 
@@ -73,6 +86,19 @@
   The case for a module symbol with an underscore,
   either ``UPPER`` or ``LOWER``.
 
+``FortranCInterface_MODULE__ORDER``
+  .. versionadded:: 4.1
+
+  Order of components for module symbols with an underscore:
+
+  ``MODULE_THEN_SYMBOL``
+    The module name appears *before* the symbol name, i.e.,
+    ``<PREFIX><module><MIDDLE><symbol><SUFFIX>``.
+
+  ``SYMBOL_THEN_MODULE``
+    The module name appears *after* the symbol name, i.e.,
+    ``<PREFIX><symbol><MIDDLE><module><SUFFIX>``.
+
 Module Functions
 ^^^^^^^^^^^^^^^^
 
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index c0a9256..cabbb32 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -39,12 +39,16 @@
   my_module_my_sub_       # PGI
   my_module_MP_my_sub     # NAG
   mymodule$mysub          # HP
+  mysub$mymodule_         # Cray
+  my_sub$my_module_       # Cray
   mymodule_mp_mysub_      # Intel
   MYMODULE_mp_MYSUB       # Intel on Windows
   mymodule_mysub_         # PGI
   mymodule_MP_mysub       # NAG
   _QMmy_modulePmy_sub     # LLVMFlang
   _QMmymodulePmysub       # LLVMFlang
+  __module_my_module_my_sub # LFortran
+  __module_mymodule_mysub   # LFortran
   ${FortranCInterface_MODULE_SYMBOLS}
   )
 list(REMOVE_DUPLICATES module_symbols)
@@ -64,14 +68,13 @@
 
 # Generate C symbol sources.
 set(symbol_sources)
-if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(PathScale|Cray)$")
+if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(PathScale)$")
   # Provide mymodule_ and my_module_ init symbols because:
   #  - PGI Fortran uses module init symbols
+  #  - Cray Fortran >= 7.3.2 uses module init symbols
   # but not for:
   #  - PathScale Fortran uses module init symbols but module symbols
   #    use '.in.' so we cannot provide them anyway.
-  #  - Cray Fortran >= 7.3.2 uses module init symbols but module symbols
-  #    use 'mysub$mymodule_' so we cannot provide them anyway.
   list(APPEND symbol_sources mymodule_.c my_module_.c MY_MODULE.c MYMODULE.c)
 endif()
 foreach(symbol IN LISTS global_symbols module_symbols)
@@ -101,7 +104,12 @@
 set_property(TARGET symbols PROPERTY POSITION_INDEPENDENT_CODE 1)
 
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
-  add_compile_options(--implicit-interface --generate-object-code)
+  if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "0.55")
+    set(_LFORTRAN_SC_FLAG --separate-compilation)
+  else()
+    set(_LFORTRAN_SC_FLAG --generate-object-code)
+  endif()
+  add_compile_options(--implicit-interface ${_LFORTRAN_SC_FLAG})
 endif()
 
 # Require symbols through Fortran.
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index 177fdf8..a4ee521 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -92,6 +92,8 @@
 set(_global__regex "^(_*)(my_sub|MY_SUB)([_$]*)$")
 set(_module_regex "^([A-Za-z_$]*)(mymodule|MYMODULE)([A-Za-z_$]*)(mysub|MYSUB)([_$]*)$")
 set(_module__regex "^([A-Za-z_$]*)(my_module|MY_MODULE)([A-Za-z_$]*)(my_sub|MY_SUB)([_$]*)$")
+set(_module_reverse_regex "^([A-Za-z_$]*)(mysub|MYSUB)([A-Za-z_$]*)(mymodule|MYMODULE)([_$]*)$")
+set(_module_reverse__regex "^([A-Za-z_$]*)(my_sub|MY_SUB)([A-Za-z_$]*)(my_module|MY_MODULE)([_$]*)$")
 
 # Parse the symbol names.
 foreach(symbol ${FortranCInterface_SYMBOLS})
@@ -120,7 +122,24 @@
       list(GET pieces 3 name)
       list(GET pieces 4 FortranCInterface_MODULE_${form}SUFFIX)
       set(FortranCInterface_MODULE_${form}CASE "${_case_${name}}")
+      set(FortranCInterface_MODULE_${form}ORDER "MODULE_THEN_SYMBOL")
     endif()
+
+    # Look for module symbols with subroutine name first.
+    string(REGEX REPLACE "${_module_reverse_${form}regex}"
+                         "\\1;\\2;\\3;\\4;\\5" pieces "${symbol}")
+    list(LENGTH pieces len)
+    if(len EQUAL 5)
+      set(FortranCInterface_MODULE_${form}SYMBOL "${symbol}")
+      list(GET pieces 0 FortranCInterface_MODULE_${form}PREFIX)
+      list(GET pieces 1 name)
+      list(GET pieces 2 FortranCInterface_MODULE_${form}MIDDLE)
+      list(GET pieces 3 module)
+      list(GET pieces 4 FortranCInterface_MODULE_${form}SUFFIX)
+      set(FortranCInterface_MODULE_${form}CASE "${_case_${name}}")
+      set(FortranCInterface_MODULE_${form}ORDER "SYMBOL_THEN_MODULE")
+    endif()
+
   endforeach()
 endforeach()
 
@@ -156,8 +175,13 @@
     endif()
     set(_name "${_name_${FortranCInterface_MODULE_${form}CASE}}")
     set(_middle "##${FortranCInterface_MODULE_${form}MIDDLE}##")
-    set(FortranCInterface_MODULE${form}_MACRO
-      "(mod_name,name, mod_NAME,NAME) ${_prefix}mod_${_name}${_middle}${_name}${_suffix}")
+    if(FortranCInterface_MODULE_${form}ORDER STREQUAL "SYMBOL_THEN_MODULE")
+      set(FortranCInterface_MODULE${form}_MACRO
+        "(mod_name,name, mod_NAME,NAME) ${_prefix}${_name}${_middle}mod_${_name}${_suffix}")
+    else()
+      set(FortranCInterface_MODULE${form}_MACRO
+        "(mod_name,name, mod_NAME,NAME) ${_prefix}mod_${_name}${_middle}${_name}${_suffix}")
+    endif()
   endif()
 endforeach()
 
diff --git a/Modules/FortranCInterface/Output.cmake.in b/Modules/FortranCInterface/Output.cmake.in
index bce410e..8d79e8c 100644
--- a/Modules/FortranCInterface/Output.cmake.in
+++ b/Modules/FortranCInterface/Output.cmake.in
@@ -18,6 +18,7 @@
 set(FortranCInterface_MODULE_MIDDLE  "@FortranCInterface_MODULE_MIDDLE@")
 set(FortranCInterface_MODULE_SUFFIX  "@FortranCInterface_MODULE_SUFFIX@")
 set(FortranCInterface_MODULE_CASE    "@FortranCInterface_MODULE_CASE@")
+set(FortranCInterface_MODULE_ORDER   "@FortranCInterface_MODULE_ORDER@")
 set(FortranCInterface_MODULE_MACRO   "@FortranCInterface_MODULE_MACRO@")
 
 # Module symbol with underscore.
@@ -26,6 +27,7 @@
 set(FortranCInterface_MODULE__MIDDLE "@FortranCInterface_MODULE__MIDDLE@")
 set(FortranCInterface_MODULE__SUFFIX "@FortranCInterface_MODULE__SUFFIX@")
 set(FortranCInterface_MODULE__CASE   "@FortranCInterface_MODULE__CASE@")
+set(FortranCInterface_MODULE__ORDER  "@FortranCInterface_MODULE__ORDER@")
 set(FortranCInterface_MODULE__MACRO  "@FortranCInterface_MODULE__MACRO@")
 
 # Summarize what was found.
diff --git a/Modules/FortranCInterface/Verify/CMakeLists.txt b/Modules/FortranCInterface/Verify/CMakeLists.txt
index 7367968..04fa6aa 100644
--- a/Modules/FortranCInterface/Verify/CMakeLists.txt
+++ b/Modules/FortranCInterface/Verify/CMakeLists.txt
@@ -5,7 +5,12 @@
 project(VerifyFortranC C Fortran)
 
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
-  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:--generate-object-code>")
+  if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "0.55")
+    set(_LFORTRAN_SC_FLAG --separate-compilation)
+  else()
+    set(_LFORTRAN_SC_FLAG --generate-object-code)
+  endif()
+  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:${_LFORTRAN_SC_FLAG}>")
 endif()
 
 option(VERIFY_CXX "Whether to verify C++ and Fortran" OFF)
diff --git a/Modules/FortranCInterface/call_mod.f90 b/Modules/FortranCInterface/call_mod.f90
index 9b6af64..087dfd8 100644
--- a/Modules/FortranCInterface/call_mod.f90
+++ b/Modules/FortranCInterface/call_mod.f90
@@ -1,4 +1,5 @@
 subroutine call_mod
+  !DIR$ NOINLINE
   use mymodule
   use my_module
   call mysub()
diff --git a/Modules/FortranCInterface/call_sub.f b/Modules/FortranCInterface/call_sub.f
index ce3d50b..830396a 100644
--- a/Modules/FortranCInterface/call_sub.f
+++ b/Modules/FortranCInterface/call_sub.f
@@ -1,4 +1,5 @@
         subroutine call_sub
+          !DIR$ NOINLINE
           call mysub()
           call my_sub()
         end
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 162c829..f677c27 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -5,10 +5,15 @@
 GNUInstallDirs
 --------------
 
-Define GNU standard installation directories
+This module defines the installation directory variables according to the
+`GNU Coding Standards`_ and provides a command to compute
+installation-related absolute paths.
 
-Provides install directory variables as defined by the
-`GNU Coding Standards`_.
+Load this module in a CMake project with:
+
+.. code-block:: cmake
+
+  include(GNUInstallDirs)
 
 .. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
 
@@ -18,11 +23,11 @@
 Inclusion of this module defines the following variables:
 
 ``CMAKE_INSTALL_<dir>``
-
   Destination for files of a given type.  This value may be passed to
   the ``DESTINATION`` options of  :command:`install` commands for the
   corresponding file type.  It should be a path relative to the installation
   prefix so that it can be converted to an absolute path in a relocatable way.
+  However, there are some `special cases`_ as documented below.
 
   While absolute paths are allowed, they are not recommended as they
   do not work with the ``cmake --install`` command's
@@ -32,12 +37,11 @@
   this prefix is used by default if the DESTINATION is a relative path.
 
 ``CMAKE_INSTALL_FULL_<dir>``
-
   The absolute path generated from the corresponding ``CMAKE_INSTALL_<dir>``
   value.  If the value is not already an absolute path, an absolute path
   is constructed typically by prepending the value of the
-  :variable:`CMAKE_INSTALL_PREFIX` variable.  However, there are some
-  `special cases`_ as documented below.
+  :variable:`CMAKE_INSTALL_PREFIX` variable, except in `special cases`_
+  as documented below.
 
   These variables shouldn't be used in :command:`install` commands
   as they do not work with the ``cmake --install`` command's
@@ -54,13 +58,29 @@
   program executables (``libexec``)
 ``SYSCONFDIR``
   read-only single-machine data (``etc``)
+
+  .. versionchanged:: 4.1
+    If the :variable:`CMAKE_INSTALL_PREFIX` falls into the
+    `special cases`_,  the default paths for are the absolute
+    path variants as described there. See policy :policy:`CMP0192`.
 ``SHAREDSTATEDIR``
   modifiable architecture-independent data (``com``)
 ``LOCALSTATEDIR``
   modifiable single-machine data (``var``)
+
+  .. versionchanged:: 4.1
+    If the :variable:`CMAKE_INSTALL_PREFIX` falls into the
+    `special cases`_,  the default paths for are the absolute
+    path variants as described there. See policy :policy:`CMP0192`.
 ``RUNSTATEDIR``
+  run-time variable data (``LOCALSTATEDIR/run``)
+
   .. versionadded:: 3.9
-    run-time variable data (``LOCALSTATEDIR/run``)
+
+  .. versionchanged:: 4.1
+    If the :variable:`CMAKE_INSTALL_PREFIX` falls into the
+    `special cases`_,  the default paths for are the absolute
+    path variants as described there. See policy :policy:`CMP0192`.
 ``LIBDIR``
   object code libraries (``lib`` or ``lib64``)
 
@@ -86,6 +106,14 @@
 If the includer does not define a value the above-shown default will be
 used and the value will appear in the cache for editing by the user.
 
+If a default value for the ``CMAKE_INSTALL_<dir>`` is used and the
+:variable:`CMAKE_INSTALL_PREFIX` is changed, the new default value will
+be used calculated on the new :variable:`CMAKE_INSTALL_PREFIX` value.
+Using :option:`--prefix <cmake--install --prefix>` in ``cmake --install``
+will not alter these values.
+
+.. _`GNUInstallDirs special cases`:
+
 Special Cases
 ^^^^^^^^^^^^^
 
@@ -104,128 +132,293 @@
     When building the complete GNU system, the prefix will be empty
     and ``/usr`` will be a symbolic link to ``/``.
 
+  .. versionchanged:: 4.1
+    The ``CMAKE_INSTALL_<dir>`` variables are cached with the ``usr/`` prefix.
+    See policy :policy:`CMP0193`.
+
 ``/usr``
 
   For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
   ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
   prepending just ``/`` to the value of ``CMAKE_INSTALL_<dir>``
-  if it is not user-specified as an absolute path.
+  if it is not already an absolute path.
   For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc``.
   This is required by the `GNU Coding Standards`_.
 
+  .. versionchanged:: 4.1
+    The default values of ``CMAKE_INSTALL_<dir>`` for ``<dir>`` equal
+    to ``SYSCONFDIR``, ``LOCALSTATEDIR`` and ``RUNSTATEDIR`` are the
+    absolute paths ``/etc``, ``/var`` and ``/var/run`` respectively.
+    See policy :policy:`CMP0192`.
+
 ``/opt/...``
 
   For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
   ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
   *appending* the prefix to the value of ``CMAKE_INSTALL_<dir>``
-  if it is not user-specified as an absolute path.
+  if it is not already an absolute path.
   For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc/opt/...``.
   This is defined by the `Filesystem Hierarchy Standard`_.
 
   This behavior does not apply to paths under ``/opt/homebrew/...``.
 
+  .. versionchanged:: 4.1
+    The default values of ``CMAKE_INSTALL_<dir>`` for ``<dir>`` equal
+    to ``SYSCONFDIR``, ``LOCALSTATEDIR`` and ``RUNSTATEDIR`` are the
+    absolute paths ``/etc/opt/...``, ``/var/opt/...`` and
+    ``/var/run/opt/...`` respectively. See policy :policy:`CMP0192`.
+
 .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
 
-Macros
-^^^^^^
+Commands
+^^^^^^^^
+
+This module provides the following command:
 
 .. command:: GNUInstallDirs_get_absolute_install_dir
 
-  .. code-block:: cmake
-
-    GNUInstallDirs_get_absolute_install_dir(absvar var dirname)
-
   .. versionadded:: 3.7
 
-  Set the given variable ``absvar`` to the absolute path contained
-  within the variable ``var``.  This is to allow the computation of an
-  absolute path, accounting for all the special cases documented
-  above.  While this macro is used to compute the various
-  ``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
-  allow users who create additional path variables to also compute
-  absolute paths where necessary, using the same logic.  ``dirname`` is
-  the directory name to get, e.g. ``BINDIR``.
+  Computes an absolute installation path from a given relative path:
 
-  .. versionchanged:: 3.20
-    Added the ``<dirname>`` parameter.  Previous versions of CMake passed
-    this value through the variable ``${dir}``.
+  .. code-block:: cmake
+
+    GNUInstallDirs_get_absolute_install_dir(<result-var> <input-var> <dir>)
+
+  This command takes the value from the variable ``<input-var>`` and
+  computes its absolute path according to GNU standard installation
+  directories.  If the input path is relative, it is prepended with
+  :variable:`CMAKE_INSTALL_PREFIX` and may be adjusted for the
+  `special cases`_ described above.
+
+  The arguments are:
+
+  ``<result-var>``
+    Name of the variable in which to store the computed absolute path.
+
+  ``<input-var>``
+    Name of the variable containing the path that will be used to compute
+    its associated absolute installation path.
+
+    .. versionchanged:: 4.1
+      This variable is no longer altered.  See policy :policy:`CMP0193`.
+      In previous CMake versions, this command modified the ``<input-var>``
+      variable value based on the `special cases`_.
+
+  ``<dir>``
+    .. versionadded:: 3.20
+
+    The directory type name, e.g., ``SYSCONFDIR``, ``LOCALSTATEDIR``,
+    ``RUNSTATEDIR``, etc.  This argument determines whether `special cases`_
+    apply when computing the absolute path.
+
+    .. versionchanged:: 3.20
+
+      Before the ``<dir>`` argument was introduced, the directory type
+      could be specified by setting the ``dir`` variable prior to calling
+      this command.  As of CMake 3.20, if the ``<dir>`` argument is provided
+      explicitly, the ``dir`` variable is ignored.
+
+  While this command is used internally by this module to compute the
+  ``CMAKE_INSTALL_FULL_<dir>`` variables, it is also exposed publicly for
+  users to create additional custom installation path variables and compute
+  absolute paths where necessary, using the same logic.
+
+See Also
+^^^^^^^^
+
+* The :command:`install` command.
 #]=======================================================================]
 
+cmake_policy(SET CMP0140 NEW)
+
+# Note that even though we read the policy every time this file is `include`
+# only the first occurrence has effect because it is used for the initialization
+# of cache variables
+cmake_policy(GET CMP0192 _GNUInstallDirs_CMP0192)
+
 # Convert a cache variable to PATH type
 
-macro(_GNUInstallDirs_cache_convert_to_path var description)
-  get_property(_GNUInstallDirs_cache_type CACHE ${var} PROPERTY TYPE)
-  if(_GNUInstallDirs_cache_type STREQUAL "UNINITIALIZED")
-    file(TO_CMAKE_PATH "${${var}}" _GNUInstallDirs_cmakepath)
+function(_GNUInstallDirs_cache_convert_to_path var description)
+  get_property(cache_type CACHE ${var} PROPERTY TYPE)
+  if(cache_type STREQUAL "UNINITIALIZED")
+    file(TO_CMAKE_PATH "${${var}}" cmakepath)
     set_property(CACHE ${var} PROPERTY TYPE PATH)
-    set_property(CACHE ${var} PROPERTY VALUE "${_GNUInstallDirs_cmakepath}")
+    set_property(CACHE ${var} PROPERTY VALUE "${cmakepath}")
     set_property(CACHE ${var} PROPERTY HELPSTRING "${description}")
-    unset(_GNUInstallDirs_cmakepath)
   endif()
-  unset(_GNUInstallDirs_cache_type)
-endmacro()
+endfunction()
 
 # Create a cache variable with default for a path.
-macro(_GNUInstallDirs_cache_path var default description)
-  if(NOT DEFINED ${var})
-    set(${var} "${default}" CACHE PATH "${description}")
+function(_GNUInstallDirs_cache_path var description)
+  set(cmake_install_var "CMAKE_INSTALL_${var}")
+  set(default "${_GNUInstallDirs_${var}_DEFAULT}")
+  # Check if we have a special way to calculate the defaults
+  if(COMMAND _GNUInstallDirs_${var}_get_default)
+    # Check if the current CMAKE_INSTALL_PREFIX is the same as before
+    set(install_prefix_is_same TRUE)
+    unset(last_default)
+    if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
+        AND NOT _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX)
+      set(install_prefix_is_same FALSE)
+      # Recalculate what the last default would have been
+      cmake_language(CALL _GNUInstallDirs_${var}_get_default
+        last_default
+        "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}")
+    endif()
+
+    if(DEFINED CACHE{${cmake_install_var}} AND install_prefix_is_same)
+      # If the cache variable was already set from a previous run and the
+      # install prefix has not changed, we don't need to do anything
+      return()
+    else()
+      # Otherwise get the new default
+      cmake_language(CALL _GNUInstallDirs_${var}_get_default
+        default
+        "${CMAKE_INSTALL_PREFIX}")
+      # if the current value is the same as the cache value and the same as
+      # the old default, reset the value to the new default
+      if(${cmake_install_var} STREQUAL "$CACHE{${cmake_install_var}}"
+          AND DEFINED last_default
+          AND ${cmake_install_var} STREQUAL last_default)
+        set(full_description "${description} (${default})")
+        set_property(CACHE ${cmake_install_var} PROPERTY TYPE PATH)
+        set_property(CACHE ${cmake_install_var} PROPERTY VALUE "${default}")
+        set_property(CACHE ${cmake_install_var} PROPERTY HELPSTRING "${full_description}")
+      endif()
+      # Continue to normal flow
+    endif()
   endif()
-  _GNUInstallDirs_cache_convert_to_path("${var}" "${description}")
-endmacro()
+
+  # Normal flow
+  set(full_description "${description} (${default})")
+  if(NOT DEFINED ${cmake_install_var})
+    set(${cmake_install_var} "${default}" CACHE PATH "${full_description}")
+  endif()
+  _GNUInstallDirs_cache_convert_to_path("${cmake_install_var}" "${full_description}")
+endfunction()
 
 # Create a cache variable with not default for a path, with a fallback
 # when unset; used for entries slaved to other entries such as
 # DATAROOTDIR.
-macro(_GNUInstallDirs_cache_path_fallback var default description)
-  if(NOT ${var})
-    set(${var} "" CACHE PATH "${description}")
-    set(${var} "${default}")
+function(_GNUInstallDirs_cache_path_fallback var description)
+  set(cmake_install_var "CMAKE_INSTALL_${var}")
+  set(default "${_GNUInstallDirs_${var}_DEFAULT}")
+  # Check if there is a more special way to handle the default
+  if(COMMAND _GNUInstallDirs_${var}_get_default)
+    cmake_language(CALL _GNUInstallDirs_${var}_get_default
+      default
+      "${CMAKE_INSTALL_PREFIX}")
   endif()
-  _GNUInstallDirs_cache_convert_to_path("${var}" "${description}")
-endmacro()
+  if(NOT ${cmake_install_var})
+    set(${cmake_install_var} "" CACHE PATH "${description}")
+    set(${cmake_install_var} "${default}")
+  endif()
+  _GNUInstallDirs_cache_convert_to_path("${cmake_install_var}" "${description}")
+  return(PROPAGATE ${cmake_install_var})
+endfunction()
+
+# Other helpers
+# Check what system we are on for LIBDIR formatting
+function(_GNUInstallDirs_get_system_type_for_install out_var)
+  unset(${out_var})
+  # Check if we are building for conda
+  if(DEFINED ENV{CONDA_BUILD} AND DEFINED ENV{PREFIX})
+    set(conda_prefix "$ENV{PREFIX}")
+    cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
+    if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix)
+      set(${out_var} "conda")
+    endif()
+  elseif(DEFINED ENV{CONDA_PREFIX})
+    set(conda_prefix "$ENV{CONDA_PREFIX}")
+    cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
+    if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix AND
+        NOT ("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$" OR
+             "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$"))
+      set(${out_var} "conda")
+    endif()
+  endif()
+  # If we didn't detect conda from the previous step, check
+  # for the linux variant
+  if(NOT ${out_var})
+    if (EXISTS "/etc/alpine-release")
+      set(${out_var} "alpine")
+    elseif (EXISTS "/etc/arch-release")
+      set(${out_var} "arch linux")
+    elseif (EXISTS "/etc/debian_version")
+      set(${out_var} "debian")
+    endif()
+  endif()
+  return(PROPAGATE ${out_var})
+endfunction()
+
+# Special handler for `/`, `/usr`, `/opt/...` install prefixes
+# Used for SYSCONFDIR, LOCALSTATEDIR and RUNSTATEDIR paths
+function(_GNUInstallDirs_special_absolute out_var original_path install_prefix)
+  set(${out_var} "${original_path}")
+
+  if(install_prefix MATCHES "^/usr/?$")
+    set(${out_var} "/${original_path}")
+  elseif(install_prefix MATCHES "^/opt/" AND NOT install_prefix MATCHES "^/opt/homebrew/")
+    set(${out_var} "/${original_path}/${install_prefix}")
+  endif()
+
+  return(PROPAGATE ${out_var})
+endfunction()
+
+# Common handler for defaults that should be in /<dir>
+# i.e. SYSCONFDIR and LOCALSTATEDIR
+function(__GNUInstallDirs_default_in_root out_var original_path install_prefix)
+  if(_GNUInstallDirs_CMP0192 STREQUAL "NEW")
+    _GNUInstallDirs_special_absolute(${out_var}
+      "${original_path}" "${install_prefix}")
+  endif()
+  cmake_path(NORMAL_PATH ${out_var})
+  return(PROPAGATE ${out_var})
+endfunction()
+
+# Common handler for defaults that should be in usr/<dir>
+function(__GNUInstallDirs_default_in_usr out_var initial_value install_prefix)
+  set(${out_var} "${initial_value}")
+  if(install_prefix STREQUAL "/")
+    cmake_policy(GET CMP0193 cmp0193
+        PARENT_SCOPE # undocumented, do not use outside of CMake
+    )
+    if(cmp0193 STREQUAL "NEW")
+      set(${out_var} "usr/${${out_var}}")
+    endif()
+  endif()
+  return(PROPAGATE ${out_var})
+endfunction()
 
 # Installation directories
 #
 
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_BINDIR "bin"
-  "User executables (bin)")
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_SBINDIR "sbin"
-  "System admin executables (sbin)")
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_LIBEXECDIR "libexec"
-  "Program executables (libexec)")
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_SYSCONFDIR "etc"
-  "Read-only single-machine data (etc)")
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_SHAREDSTATEDIR "com"
-  "Modifiable architecture-independent data (com)")
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_LOCALSTATEDIR "var"
-  "Modifiable single-machine data (var)")
+# Set the standard default values before any special handling
+set(_GNUInstallDirs_BINDIR_DEFAULT "bin")
+set(_GNUInstallDirs_SBINDIR_DEFAULT "sbin")
+set(_GNUInstallDirs_LIBEXECDIR_DEFAULT "libexec")
+set(_GNUInstallDirs_SYSCONFDIR_DEFAULT "etc")
+set(_GNUInstallDirs_SHAREDSTATEDIR_DEFAULT "com")
+set(_GNUInstallDirs_LOCALSTATEDIR_DEFAULT "var")
+set(_GNUInstallDirs_LIBDIR_DEFAULT "lib")
+set(_GNUInstallDirs_INCLUDEDIR_DEFAULT "include")
+set(_GNUInstallDirs_OLDINCLUDEDIR_DEFAULT "/usr/include")
+set(_GNUInstallDirs_DATAROOTDIR_DEFAULT "share")
 
-# We check if the variable was manually set and not cached, in order to
-# allow projects to set the values as normal variables before including
-# GNUInstallDirs to avoid having the entries cached or user-editable. It
-# replaces the "if(NOT DEFINED CMAKE_INSTALL_XXX)" checks in all the
-# other cases.
-# If CMAKE_INSTALL_LIBDIR is defined, if _libdir_set is false, then the
-# variable is a normal one, otherwise it is a cache one.
-get_property(_libdir_set CACHE CMAKE_INSTALL_LIBDIR PROPERTY TYPE SET)
-if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set
-    AND DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
-    AND NOT "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" STREQUAL "${CMAKE_INSTALL_PREFIX}"))
-  # If CMAKE_INSTALL_LIBDIR is not defined, it is always executed.
-  # Otherwise:
-  #  * if _libdir_set is false it is not executed (meaning that it is
-  #    not a cache variable)
-  #  * if _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX is not defined it is
-  #    not executed
-  #  * if _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX and
-  #    CMAKE_INSTALL_PREFIX are the same string it is not executed.
-  #    _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX is updated after the
-  #    execution, of this part of code, therefore at the next inclusion
-  #    of the file, CMAKE_INSTALL_LIBDIR is defined, and the 2 strings
-  #    are equal, meaning that the if is not executed the code the
-  #    second time.
+# Define the special defaults handling
+# Signature
+#   _GNUInstallDirs_<Dir>_get_default(out_var install_prefix)
+#
+# ``out_var``
+#   Output variable with the calculated default
+#
+# ``install_prefix``
+#   The CMAKE_INSTALL_PREFIX used to calculate the default
 
-  set(_LIBDIR_DEFAULT "lib")
+function(_GNUInstallDirs_LIBDIR_get_default out_var install_prefix)
+  set(${out_var} "${_GNUInstallDirs_LIBDIR_DEFAULT}")
+
   # Override this default 'lib' with 'lib64' iff:
   #  - we are on Linux system but NOT cross-compiling
   #  - we are NOT on debian
@@ -236,125 +429,172 @@
   # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
   # and CMAKE_INSTALL_PREFIX is "/usr"
   # See http://wiki.debian.org/Multiarch
-  if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
-    set(__LAST_LIBDIR_DEFAULT "lib")
-    # __LAST_LIBDIR_DEFAULT is the default value that we compute from
-    # _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX, not a cache entry for
-    # the value that was last used as the default.
-    # This value is used to figure out whether the user changed the
-    # CMAKE_INSTALL_LIBDIR value manually, or if the value was the
-    # default one. When CMAKE_INSTALL_PREFIX changes, the value is
-    # updated to the new default, unless the user explicitly changed it.
-  endif()
   if (NOT DEFINED CMAKE_SYSTEM_NAME OR NOT DEFINED CMAKE_SIZEOF_VOID_P)
     message(AUTHOR_WARNING
       "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
       "Please enable at least one language before including GNUInstallDirs.")
   endif()
-
-  if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
-      AND NOT CMAKE_CROSSCOMPILING)
-    unset(__system_type_for_install)
-    if(DEFINED ENV{CONDA_BUILD} AND DEFINED ENV{PREFIX})
-      set(conda_prefix "$ENV{PREFIX}")
-      cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
-      if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix)
-        set(__system_type_for_install "conda")
-      endif()
-    elseif(DEFINED ENV{CONDA_PREFIX})
-      set(conda_prefix "$ENV{CONDA_PREFIX}")
-      cmake_path(ABSOLUTE_PATH conda_prefix NORMALIZE)
-      if("${CMAKE_INSTALL_PREFIX}" STREQUAL conda_prefix AND
-         NOT ("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$" OR
-              "${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$"))
-        set(__system_type_for_install "conda")
-      endif()
-    endif()
-    if(NOT __system_type_for_install)
-      if (EXISTS "/etc/alpine-release")
-        set(__system_type_for_install "alpine")
-      elseif (EXISTS "/etc/arch-release")
-        set(__system_type_for_install "arch linux")
-      elseif (EXISTS "/etc/debian_version")
-        set(__system_type_for_install "debian")
-      endif()
-    endif()
-
-    if(__system_type_for_install STREQUAL "debian")
+  if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|GNU)$" AND NOT CMAKE_CROSSCOMPILING)
+    _GNUInstallDirs_get_system_type_for_install(system_type)
+    if(system_type STREQUAL "debian")
       if(CMAKE_LIBRARY_ARCHITECTURE)
-        if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
-          set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
-        endif()
-        if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
-            AND "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
-          set(__LAST_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+        if("${install_prefix}" MATCHES "^/usr/?$")
+          set(${out_var} "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
         endif()
       endif()
-    elseif(NOT DEFINED __system_type_for_install)
+    elseif(NOT DEFINED system_type)
       # not debian, alpine, arch, or conda so rely on CMAKE_SIZEOF_VOID_P:
       if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-        set(_LIBDIR_DEFAULT "lib64")
-        if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
-          set(__LAST_LIBDIR_DEFAULT "lib64")
-        endif()
+        set(${out_var} "lib64")
       endif()
     endif()
   endif()
-  unset(__system_type_for_install)
+  __GNUInstallDirs_default_in_usr(${out_var} "${${out_var}}" "${install_prefix}")
 
-  if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
-    set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "Object code libraries (${_LIBDIR_DEFAULT})")
-  elseif(DEFINED __LAST_LIBDIR_DEFAULT
-      AND "${__LAST_LIBDIR_DEFAULT}" STREQUAL "${CMAKE_INSTALL_LIBDIR}")
-    set_property(CACHE CMAKE_INSTALL_LIBDIR PROPERTY VALUE "${_LIBDIR_DEFAULT}")
+  return(PROPAGATE ${out_var})
+endfunction()
+
+foreach(dir IN ITEMS
+    SYSCONFDIR
+    LOCALSTATEDIR
+)
+  # Cannot call function() directly because `dir` would not be accessible inside the function
+  # Using cmake_language(EVAL) to call a short wrapper function instead
+  cmake_language(EVAL CODE "
+    function(_GNUInstallDirs_${dir}_get_default out_var install_prefix)
+      set(\${out_var} \"\${_GNUInstallDirs_${dir}_DEFAULT}\")
+      __GNUInstallDirs_default_in_root(\${out_var} \"\${\${out_var}}\" \"\${install_prefix}\")
+      return(PROPAGATE \${out_var})
+    endfunction()
+  "
+  )
+endforeach()
+
+# Depends on current CMAKE_INSTALL_LOCALSTATEDIR value
+function(_GNUInstallDirs_RUNSTATEDIR_get_default out_var install_prefix)
+  set(${out_var} "${_GNUInstallDirs_RUNSTATEDIR_DEFAULT}")
+  if(_GNUInstallDirs_CMP0192 STREQUAL "NEW")
+    # In the /opt/ case we want the install_prefix to be appended as
+    # LOCALSTATEDIR/run/PREFIX
+    if(install_prefix MATCHES "^/opt/" AND NOT install_prefix MATCHES "^/opt/homebrew/")
+        string(REPLACE "${install_prefix}" "/run${install_prefix}"
+          ${out_var} "${CMAKE_INSTALL_LOCALSTATEDIR}"
+        )
+    endif()
   endif()
-endif()
-_GNUInstallDirs_cache_convert_to_path(CMAKE_INSTALL_LIBDIR "Object code libraries (lib)")
+  return(PROPAGATE ${out_var})
+endfunction()
 
-# Save for next run
-set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "CMAKE_INSTALL_PREFIX during last run")
-unset(_libdir_set)
-unset(__LAST_LIBDIR_DEFAULT)
+# All of the other (primitive) dirs are typically in usr/<dir>.
+# A special handling is needed for the `/` install_prefix
+foreach(dir IN ITEMS
+    BINDIR
+    SBINDIR
+    LIBEXECDIR
+    SHAREDSTATEDIR
+    INCLUDEDIR
+    OLDINCLUDEDIR
+    DATAROOTDIR
+    # Except all the previous ones that had a special handling:
+    # LIBDIR, SYSCONFDIR, LOCALSTATEDIR, OLDINCLUDEDIR
+)
+  # Cannot call function() directly because `dir` would not be accessible inside the function
+  # Using cmake_language(EVAL) to call a short wrapper function instead
+  cmake_language(EVAL CODE "
+    function(_GNUInstallDirs_${dir}_get_default out_var install_prefix)
+      set(\${out_var} \"\${_GNUInstallDirs_${dir}_DEFAULT}\")
+      __GNUInstallDirs_default_in_usr(\${out_var} \"\${\${out_var}}\" \"\${install_prefix}\")
+      return(PROPAGATE \${out_var})
+    endfunction()
+  "
+  )
+endforeach()
 
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_INCLUDEDIR "include"
-  "C header files (include)")
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include"
-  "C header files for non-gcc (/usr/include)")
-_GNUInstallDirs_cache_path(CMAKE_INSTALL_DATAROOTDIR "share"
-  "Read-only architecture-independent data root (share)")
+_GNUInstallDirs_cache_path(BINDIR
+  "User executables")
+_GNUInstallDirs_cache_path(SBINDIR
+  "System admin executables")
+_GNUInstallDirs_cache_path(LIBEXECDIR
+  "Program executables")
+_GNUInstallDirs_cache_path(SYSCONFDIR
+  "Read-only single-machine data")
+_GNUInstallDirs_cache_path(SHAREDSTATEDIR
+  "Modifiable architecture-independent data")
+_GNUInstallDirs_cache_path(LOCALSTATEDIR
+  "Modifiable single-machine data")
+_GNUInstallDirs_cache_path(LIBDIR
+  "Object code libraries")
+_GNUInstallDirs_cache_path(INCLUDEDIR
+  "C header files")
+_GNUInstallDirs_cache_path(OLDINCLUDEDIR
+  "C header files for non-gcc")
+_GNUInstallDirs_cache_path(DATAROOTDIR
+  "Read-only architecture-independent data root")
 
 #-----------------------------------------------------------------------------
 # Values whose defaults are relative to DATAROOTDIR.  Store empty values in
 # the cache and store the defaults in local variables if the cache values are
 # not set explicitly.  This auto-updates the defaults as DATAROOTDIR changes.
 
-_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}"
-  "Read-only architecture-independent data (DATAROOTDIR)")
-
 if(CMAKE_SYSTEM_NAME MATCHES "^(([^kF].*)?BSD|DragonFly)$")
-  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "info"
-    "Info documentation (info)")
+  set(_GNUInstallDirs_INFODIR_DEFAULT "info")
+  _GNUInstallDirs_cache_path(INFODIR
+    "Info documentation")
 else()
-  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info"
+  set(_GNUInstallDirs_INFODIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/info")
+  _GNUInstallDirs_cache_path_fallback(INFODIR
     "Info documentation (DATAROOTDIR/info)")
 endif()
 
 if(CMAKE_SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$" AND NOT CMAKE_SYSTEM_NAME MATCHES "^(FreeBSD)$")
-  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "man"
-    "Man documentation (man)")
+  set(_GNUInstallDirs_MANDIR_DEFAULT "man")
+  _GNUInstallDirs_cache_path(MANDIR
+    "Man documentation")
 else()
-  _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man"
+  set(_GNUInstallDirs_MANDIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/man")
+  _GNUInstallDirs_cache_path_fallback(MANDIR
     "Man documentation (DATAROOTDIR/man)")
 endif()
 
-_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale"
-  "Locale-dependent data (DATAROOTDIR/locale)")
-_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}"
-  "Documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
+set(_GNUInstallDirs_DATADIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}")
+set(_GNUInstallDirs_LOCALEDIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/locale")
+set(_GNUInstallDirs_DOCDIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
+set(_GNUInstallDirs_RUNSTATEDIR_DEFAULT "${CMAKE_INSTALL_LOCALSTATEDIR}/run")
 
-_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_RUNSTATEDIR "${CMAKE_INSTALL_LOCALSTATEDIR}/run"
+_GNUInstallDirs_cache_path_fallback(DATADIR
+  "Read-only architecture-independent data (DATAROOTDIR)")
+_GNUInstallDirs_cache_path_fallback(LOCALEDIR
+  "Locale-dependent data (DATAROOTDIR/locale)")
+_GNUInstallDirs_cache_path_fallback(DOCDIR
+  "Documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
+_GNUInstallDirs_cache_path_fallback(RUNSTATEDIR
   "Run-time variable data (LOCALSTATEDIR/run)")
 
+# Unset all the defaults used
+foreach(dir IN ITEMS
+    BINDIR
+    SBINDIR
+    LIBEXECDIR
+    SYSCONFDIR
+    SHAREDSTATEDIR
+    LOCALSTATEDIR
+    LIBDIR
+    INCLUDEDIR
+    OLDINCLUDEDIR
+    DATAROOTDIR
+    DATADIR
+    INFODIR
+    MANDIR
+    LOCALEDIR
+    DOCDIR
+    RUNSTATEDIR
+)
+  unset(_GNUInstallDirs_${dir}_DEFAULT)
+endforeach()
+
+# Save for next run
+set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "CMAKE_INSTALL_PREFIX during last run")
+
 #-----------------------------------------------------------------------------
 
 mark_as_advanced(
@@ -376,7 +616,7 @@
   CMAKE_INSTALL_DOCDIR
   )
 
-macro(GNUInstallDirs_get_absolute_install_dir absvar var)
+function(GNUInstallDirs_get_absolute_install_dir absvar var)
   set(GGAID_extra_args ${ARGN})
   list(LENGTH GGAID_extra_args GGAID_extra_arg_count)
   if(GGAID_extra_arg_count GREATER "0")
@@ -394,27 +634,23 @@
     # - CMAKE_INSTALL_PREFIX == /
     # - CMAKE_INSTALL_PREFIX == /usr
     # - CMAKE_INSTALL_PREFIX == /opt/...
-    if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
-      if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
-        set(${absvar} "/${${var}}")
-      else()
-        if (NOT "${${var}}" MATCHES "^usr/")
-          set(${var} "usr/${${var}}")
+    if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
+      _GNUInstallDirs_special_absolute(${absvar} "${${var}}" "${CMAKE_INSTALL_PREFIX}")
+      # If the CMAKE_INSTALL_PREFIX was not special, the output
+      # is still not absolute, so use the default logic.
+      if(NOT IS_ABSOLUTE "${${absvar}}")
+        # Make sure we account for any trailing `/`
+        if(CMAKE_INSTALL_PREFIX MATCHES "/$")
+          set(${absvar} "${CMAKE_INSTALL_PREFIX}${${var}}")
+        else()
+          set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
         endif()
-        set(${absvar} "/${${var}}")
       endif()
-    elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
-      if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
-        set(${absvar} "/${${var}}")
-      else()
-        set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
+    elseif("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")
+      if (NOT "${${var}}" MATCHES "^usr/")
+        set(${var} "usr/${${var}}")
       endif()
-    elseif("${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/" AND NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^/opt/homebrew/")
-      if("${GGAID_dir}" STREQUAL "SYSCONFDIR" OR "${GGAID_dir}" STREQUAL "LOCALSTATEDIR" OR "${GGAID_dir}" STREQUAL "RUNSTATEDIR")
-        set(${absvar} "/${${var}}${CMAKE_INSTALL_PREFIX}")
-      else()
-        set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
-      endif()
+      set(${absvar} "/${${var}}")
     else()
       set(${absvar} "${CMAKE_INSTALL_PREFIX}/${${var}}")
     endif()
@@ -422,10 +658,15 @@
     set(${absvar} "${${var}}")
   endif()
 
-  unset(GGAID_dir)
-  unset(GGAID_extra_arg_count)
-  unset(GGAID_extra_args)
-endmacro()
+  set(return_vars ${absvar})
+  cmake_policy(GET CMP0193 cmp0193
+    PARENT_SCOPE # undocumented, do not use outside of CMake
+  )
+  if(NOT cmp0193 STREQUAL "NEW")
+    list(APPEND return_vars ${var})
+  endif()
+  return(PROPAGATE ${return_vars})
+endfunction()
 
 # Result directories
 #
@@ -449,3 +690,5 @@
     )
   GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_${dir} CMAKE_INSTALL_${dir} ${dir})
 endforeach()
+
+unset(_GNUInstallDirs_CMP0192)
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index a4e904c..5467651 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -5,203 +5,472 @@
 GenerateExportHeader
 --------------------
 
-This module provides the ``generate_export_header()`` function to generate
-export macros for libraries.
+This module provides commands for generating a header file containing
+preprocessor macro definitions to control C/C++ symbol visibility.
+
+Load this module in CMake project with:
+
+.. code-block:: cmake
+
+  include(GenerateExportHeader)
 
 .. versionadded:: 3.12
-  Added support for C projects.  Previous versions supported C++ project only.
+  Support for C projects.  Previous versions supported C++ projects only.
+
+When developing C or C++ projects, especially for cross-platform use, symbol
+visibility determines which functions, classes, global variables, templates,
+and other symbols are made visible to users of the library.
+
+For example, on Windows, symbols must be explicitly marked with
+``__declspec(dllexport)`` when building a shared library, and
+``__declspec(dllimport)`` when using it.  Other platforms may use attributes
+like ``__attribute__((visibility("default")))``.
+
+This module simplifies the creation and usage of preprocessor macros to
+manage these requirements, avoiding repetitive and error-prone ``#ifdef``
+blocks in source code.
+
+Some symbol visibility can also be controlled with compiler options. In
+CMake, target properties such as :prop_tgt:`<LANG>_VISIBILITY_PRESET` and
+:prop_tgt:`VISIBILITY_INLINES_HIDDEN` enable compiler visibility flags,
+where appropriate.  See also related convenience variables
+:variable:`CMAKE_<LANG>_VISIBILITY_PRESET` and
+:variable:`CMAKE_VISIBILITY_INLINES_HIDDEN` to enable it for all targets in
+current scope.  These are commonly used in combination with this module to
+further simplify C/C++ code, removing the need for some of the preprocessor
+macros in the source code.
+
+Commands
+^^^^^^^^
+
+This module provides the following commands:
+
+Generating Export Header
+""""""""""""""""""""""""
 
 .. command:: generate_export_header
 
-  The ``generate_export_header()`` function can be used to generate a file
-  suitable for preprocessor inclusion which contains EXPORT macros to be
-  used in library classes:
+  Generates a header file suitable for inclusion in source code, containing
+  preprocessor *export* macros for controlling the visibility of symbols:
 
   .. code-block:: cmake
 
-    generate_export_header(LIBRARY_TARGET
-             [BASE_NAME <base_name>]
-             [EXPORT_MACRO_NAME <export_macro_name>]
-             [EXPORT_FILE_NAME <export_file_name>]
-             [DEPRECATED_MACRO_NAME <deprecated_macro_name>]
-             [NO_EXPORT_MACRO_NAME <no_export_macro_name>]
-             [INCLUDE_GUARD_NAME <include_guard_name>]
-             [STATIC_DEFINE <static_define>]
-             [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
-             [DEFINE_NO_DEPRECATED]
-             [PREFIX_NAME <prefix_name>]
-             [CUSTOM_CONTENT_FROM_VARIABLE <variable>]
+    generate_export_header(
+      <target>
+      [BASE_NAME <base-name>]
+      [EXPORT_FILE_NAME <export-file-name>]
+      [EXPORT_MACRO_NAME <export-macro-name>]
+      [NO_EXPORT_MACRO_NAME <no-export-macro-name>]
+      [DEPRECATED_MACRO_NAME <deprecated-macro-name>]
+      [DEFINE_NO_DEPRECATED]
+      [NO_DEPRECATED_MACRO_NAME <no-deprecated-macro-name>]
+      [STATIC_DEFINE <static-define>]
+      [PREFIX_NAME <prefix>]
+      [CUSTOM_CONTENT_FROM_VARIABLE <variable>]
+      [INCLUDE_GUARD_NAME <include-guard-name>]
     )
 
-The target properties :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>`
-and :prop_tgt:`VISIBILITY_INLINES_HIDDEN` can be used to add the appropriate
-compile flags for targets.  See the documentation of those target properties,
-and the convenience variables
-:variable:`CMAKE_CXX_VISIBILITY_PRESET <CMAKE_<LANG>_VISIBILITY_PRESET>` and
-:variable:`CMAKE_VISIBILITY_INLINES_HIDDEN`.
+  By default, this command generates a header file named
+  ``<target-name-lowercase>_export.h`` in the current binary directory
+  (:variable:`CMAKE_CURRENT_BINARY_DIR`).  This header defines a set of
+  preprocessor macros used to mark API symbols as exported, hidden, or
+  deprecated across different platforms and build types (e.g., static or
+  shared builds), and is intended to be installed along with the library's
+  public headers, because it affects public API declarations:
 
-By default ``generate_export_header()`` generates macro names in a file
-name determined by the name of the library.  This means that in the
-simplest case, users of ``GenerateExportHeader`` will be equivalent to:
+  * ``<MACRO>_EXPORT``: Marks symbols for export or import, making them
+    visible as part of the public API when building or consuming a shared
+    library.
 
-.. code-block:: cmake
+  * ``<MACRO>_NO_EXPORT``: Marks symbols that should not be exported.
+    If the :prop_tgt:`<LANG>_VISIBILITY_PRESET` target property is set to
+    ``hidden``, using this macro in source code is typically redundant.
 
-   set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-   set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-   add_library(somelib someclass.cpp)
-   generate_export_header(somelib)
-   install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
-   install(FILES
-    someclass.h
-    ${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}
-   )
+  * ``<MACRO>_DEPRECATED``: Marks symbols as deprecated.  When such symbols
+    are used, the compiler emits a warning at compile-time.
 
+  * ``<MACRO>_DEPRECATED_EXPORT``: Combines export/import and deprecation
+    markers for a symbol that is both part of the public API and deprecated.
 
-And in the ABI header files:
+  * ``<MACRO>_DEPRECATED_NO_EXPORT``: Marks a deprecated symbol that should
+    not be exported (internal and deprecated).
 
-.. code-block:: c++
+  * ``<MACRO>_NO_DEPRECATED``: A macro that can be used in source code to
+    conditionally exclude deprecated code parts from the build via
+    preprocessor logic.
 
-   #include "somelib_export.h"
-   class SOMELIB_EXPORT SomeClass {
-     ...
-   };
+  The ``<MACRO>`` part is derived by default from the uppercase name of the
+  target or the explicitly provided ``<base-name>``.  All macro names can be
+  customized using the optional arguments.
 
+  .. rubric:: The arguments are:
 
-The CMake fragment will generate a file in the
-``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
-macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
-``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``.
-They will be followed by content taken from the variable specified by
-the ``CUSTOM_CONTENT_FROM_VARIABLE`` option, if any.
-The resulting file should be installed with other headers in the library.
+  ``<target>``
+    Name of a target for which the export header will be generated.
+    Supported target types:
 
-The ``BASE_NAME`` argument can be used to override the file name and the
-names used for the macros:
+    * ``STATIC`` library (in this case, export-related macros are defined
+      without values)
+    * ``SHARED`` library
+    * ``MODULE`` library
+    * .. versionadded:: 3.1
+        ``OBJECT`` library
 
-.. code-block:: cmake
+  ``BASE_NAME <base-name>``
+    If specified, it overrides the default file name and macro names.
 
-   add_library(somelib someclass.cpp)
-   generate_export_header(somelib
-     BASE_NAME other_name
-   )
+  ``EXPORT_FILE_NAME <export-file-name>``
+    If specified, it overrides the full path and the name of the generated
+    export header file (``<base-name-lowercase>_export.h``) to
+    ``<export-file-name>``.  If given as a relative path, it will be
+    interpreted relative to the current binary directory
+    (:variable:`CMAKE_CURRENT_BINARY_DIR`).
 
+  ``EXPORT_MACRO_NAME <export-macro-name>``
+    If specified, it overrides the default macro name for the export
+    directive.
 
-Generates a file called ``other_name_export.h`` containing the macros
-``OTHER_NAME_EXPORT``, ``OTHER_NAME_NO_EXPORT`` and ``OTHER_NAME_DEPRECATED``
-etc.
+  ``NO_EXPORT_MACRO_NAME <no-export-macro-name>``
+    If specified, the ``<no-export-macro-name>`` will be used for the macro
+    name that designates the attribute for items that shouldn't be exported.
 
-The ``BASE_NAME`` may be overridden by specifying other options in the
-function.  For example:
+  ``DEPRECATED_MACRO_NAME <deprecated-macro-name>``
+    If specified, the following names will be used:
 
-.. code-block:: cmake
+    * ``<deprecated-macro-name>`` (macro for marking deprecated symbols)
+    * ``<deprecated-macro-name>_EXPORT`` (macro for deprecated symbols with
+      export markers)
+    * ``<deprecated-macro-name>_NO_EXPORT`` (macro for deprecated symbols
+      with no-export markers)
 
-   add_library(somelib someclass.cpp)
-   generate_export_header(somelib
-     EXPORT_MACRO_NAME OTHER_NAME_EXPORT
-   )
+    instead of the default names in format of
+    ``<MACRO>_DEPRECATED{,_EXPORT,_NO_EXPORT}``.
 
+  ``DEFINE_NO_DEPRECATED``
+    If specified, this will define a macro named ``<MACRO>_NO_DEPRECATED``.
 
-creates the macro ``OTHER_NAME_EXPORT`` instead of ``SOMELIB_EXPORT``, but
-other macros and the generated file name is as default:
+  ``NO_DEPRECATED_MACRO_NAME <no-deprecated-macro-name>``
+    Used in combination with ``DEFINE_NO_DEPRECATED`` option.  If specified,
+    then a macro named ``<no-deprecated-macro-name>`` is used instead of the
+    default ``<MACRO>_NO_DEPRECATED``.
 
-.. code-block:: cmake
+  ``STATIC_DEFINE <static-define>``
+    If specified, the ``<static-define>`` macro name will be used instead
+    of the default ``<MACRO>_STATIC_DEFINE``.  This macro controls the
+    symbol export behavior in the generated header for static libraries.
+    It is typically used when building both shared and static variants of a
+    library from the same sources using a single generated export header.
+    When this macro is defined for static library, the export-related macros
+    will expand to nothing.  This is important also on Windows, where symbol
+    decoration is required only for shared libraries, not for static ones.
 
-   add_library(somelib someclass.cpp)
-   generate_export_header(somelib
-     DEPRECATED_MACRO_NAME KDE_DEPRECATED
-   )
+  ``PREFIX_NAME <prefix>``
+    If specified, the additional ``<prefix>`` is prepended to all generated
+    macro names.
 
+  ``CUSTOM_CONTENT_FROM_VARIABLE <variable>``
+    .. versionadded:: 3.7
 
-creates the macro ``KDE_DEPRECATED`` instead of ``SOMELIB_DEPRECATED``.
+    If specified, the content from the ``<variable>`` value is appended to
+    the generated header file content after the preprocessor macros
+    definitions.
 
-If ``LIBRARY_TARGET`` is a static library, macros are defined without
-values.
+  ``INCLUDE_GUARD_NAME <include-guard-name>``
+    .. versionadded:: 3.11
 
-If the same sources are used to create both a shared and a static
-library, the uppercased symbol ``${BASE_NAME}_STATIC_DEFINE`` should be
-used when building the static library:
+    If specified, the ``<include-guard-name>`` is used as the preprocessor
+    macro name to guard multiple inclusions of the generated header instead
+    of the default name ``<export-macro-name>_H``.
 
-.. code-block:: cmake
+    .. code-block:: c++
+      :caption: ``<base-name-lowercase>_export.h``
 
-   add_library(shared_variant SHARED ${lib_SRCS})
-   add_library(static_variant ${lib_SRCS})
-   generate_export_header(shared_variant BASE_NAME libshared_and_static)
-   set_target_properties(static_variant PROPERTIES
-     COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
+      #ifndef <include-guard-name>
+      #define <include-guard-name>
+      // ...
+      #endif /* <include-guard-name> */
 
-This will cause the export macros to expand to nothing when building
-the static library.
-
-If ``DEFINE_NO_DEPRECATED`` is specified, then a macro
-``${BASE_NAME}_NO_DEPRECATED`` will be defined This macro can be used to
-remove deprecated code from preprocessor output:
-
-.. code-block:: cmake
-
-   option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
-   if (EXCLUDE_DEPRECATED)
-     set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
-   endif()
-   generate_export_header(somelib ${NO_BUILD_DEPRECATED})
-
-
-And then in somelib:
-
-.. code-block:: c++
-
-   class SOMELIB_EXPORT SomeClass
-   {
-   public:
-   #ifndef SOMELIB_NO_DEPRECATED
-     SOMELIB_DEPRECATED void oldMethod();
-   #endif
-   };
-
-.. code-block:: c++
-
-   #ifndef SOMELIB_NO_DEPRECATED
-   void SomeClass::oldMethod() {  }
-   #endif
-
-
-If ``PREFIX_NAME`` is specified, the argument will be used as a prefix to
-all generated macros.
-
-For example:
-
-.. code-block:: cmake
-
-   generate_export_header(somelib PREFIX_NAME VTK_)
-
-Generates the macros ``VTK_SOMELIB_EXPORT`` etc.
-
-.. versionadded:: 3.1
-  Library target can be an ``OBJECT`` library.
-
-.. versionadded:: 3.7
-  Added the ``CUSTOM_CONTENT_FROM_VARIABLE`` option.
-
-.. versionadded:: 3.11
-  Added the ``INCLUDE_GUARD_NAME`` option.
+Deprecated Command
+""""""""""""""""""
 
 .. command:: add_compiler_export_flags
 
-  .. code-block:: cmake
-
-    add_compiler_export_flags([<output_variable>])
-
   .. deprecated:: 3.0
 
     Set the target properties
     :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>` and
     :prop_tgt:`VISIBILITY_INLINES_HIDDEN` instead.
 
-The ``add_compiler_export_flags()`` function adds ``-fvisibility=hidden`` to
-:variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` if supported, and is a no-op
-on Windows which does not need extra compiler flags for exporting support.
-You may optionally pass a single argument to ``add_compiler_export_flags()``
-that will be populated with the ``CXX_FLAGS`` required to enable visibility
-support for the compiler/architecture in use.
+  Adds C++ compiler options ``-fvisibility=hidden`` (and
+  ``-fvisibility-inlines-hidden``, if supported) to hide all symbols by
+  default to either :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>`
+  variable or to a specified variable:
+
+  .. code-block:: cmake
+
+    add_compiler_export_flags([<output_variable>])
+
+  This command is a no-op on Windows which does not need extra compiler flags
+  for exporting support.
+
+  ``<output-variable>``
+    Optional variable name that will be populated with a string of
+    space-separated C++ compile options required to enable visibility
+    support for the compiler/architecture in use.  If this argument is
+    specified, the :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` variable
+    will not be modified.
+
+Examples
+^^^^^^^^
+
+Example: Generating Export Header
+"""""""""""""""""""""""""""""""""
+
+The following example demonstrates how to use this module to generate an
+export header in the current binary directory (``example_export.h``) and use
+it in a C++ library named ``example`` to control symbols visibility.  The
+generated header defines the preprocessor macros ``EXAMPLE_EXPORT``,
+``EXAMPLE_NO_EXPORT``, ``EXAMPLE_DEPRECATED``, ``EXAMPLE_DEPRECATED_EXPORT``,
+and ``EXAMPLE_DEPRECATED_NO_EXPORT``, and is installed along with the
+library's other public headers:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+  :emphasize-lines: 10,11
+
+  cmake_minimum_required(VERSION 3.24)
+  project(GenerateExportHeaderExample)
+
+  # Set default visibility of all symbols to hidden
+  set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
+  set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
+
+  add_library(example)
+
+  include(GenerateExportHeader)
+  generate_export_header(example)
+
+  target_sources(
+    example
+    PRIVATE example.cxx
+    PUBLIC
+      FILE_SET HEADERS
+        FILES example.h
+      FILE_SET generated_headers
+        TYPE HEADERS
+        BASE_DIRS $<TARGET_PROPERTY:example,BINARY_DIR>
+        FILES ${CMAKE_CURRENT_BINARY_DIR}/example_export.h
+  )
+
+  target_include_directories(example PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+
+  install(
+    TARGETS example
+    FILE_SET HEADERS
+    FILE_SET generated_headers
+  )
+
+And in the ABI header files:
+
+.. code-block:: c++
+  :caption: ``example.h``
+
+  #include "example_export.h"
+
+  // This class is part of the public API and is exported
+  class EXAMPLE_EXPORT SomeClass
+  {
+  public:
+    SomeClass();
+    void doSomething();
+
+    // This method is deprecated
+    EXAMPLE_DEPRECATED void legacyMethod();
+  };
+
+  // This function is exported and deprecated
+  EXAMPLE_DEPRECATED_EXPORT void legacyPublicFunction();
+
+  // This function is deprecated but not exported
+  EXAMPLE_DEPRECATED void legacyInternalFunction();
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include <iostream>
+  #include "example.h"
+
+  SomeClass::SomeClass() = default;
+
+  void SomeClass::doSomething()
+  {
+    std::cout << "SomeClass::doSomething() called" << std::endl;
+  }
+
+  void SomeClass::legacyMethod()
+  {
+    std::cout << "SomeClass::legacyMethod() is deprecated" << std::endl;
+  }
+
+  void legacyPublicFunction()
+  {
+    std::cout << "legacyPublicFunction() is deprecated" << std::endl;
+  }
+
+  void internalLegacyFunction()
+  {
+    std::cout << "legacyInternalFunction() is deprecated" << std::endl;
+  }
+
+Examples: Customizing Generated Header
+""""""""""""""""""""""""""""""""""""""
+
+The ``BASE_NAME`` argument can be used to override the generated file name
+and the names used for the macros.  The following will generate a file
+named ``other_name_export.h`` containing export-related macros such as
+``OTHER_NAME_EXPORT``, ``OTHER_NAME_NO_EXPORT``, ``OTHER_NAME_DEPRECATED``,
+etc.
+
+.. code-block:: cmake
+
+  add_library(example example.cxx)
+  include(GenerateExportHeader)
+  generate_export_header(example BASE_NAME "other_name")
+
+The ``BASE_NAME`` may be overridden by specifying other command options.
+For example, the following creates a macro ``OTHER_NAME_EXPORT`` instead of
+``EXAMPLE_EXPORT``, but other macros and the generated header file name are
+set to their default values:
+
+.. code-block:: cmake
+
+  add_library(example example.cxx)
+  include(GenerateExportHeader)
+  generate_export_header(example EXPORT_MACRO_NAME "OTHER_NAME_EXPORT")
+
+The following example creates ``KDE_DEPRECATED`` macro instead of
+default ``EXAMPLE_DEPRECATED``:
+
+.. code-block:: cmake
+
+  add_library(example example.cxx)
+  include(GenerateExportHeader)
+  generate_export_header(example DEPRECATED_MACRO_NAME "KDE_DEPRECATED")
+
+The ``DEFINE_NO_DEPRECATED`` option can be used to define a macro which can
+be used to remove deprecated code from preprocessor output:
+
+.. code-block:: cmake
+
+  option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library")
+  if(EXCLUDE_DEPRECATED)
+    set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
+  endif()
+
+  include(GenerateExportHeader)
+  generate_export_header(example ${NO_BUILD_DEPRECATED})
+
+.. code-block:: c++
+  :caption: ``example.h``
+
+  class EXAMPLE_EXPORT SomeClass
+  {
+  public:
+  #ifndef EXAMPLE_NO_DEPRECATED
+    EXAMPLE_DEPRECATED void legacyMethod();
+  #endif
+  };
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #ifndef EXAMPLE_NO_DEPRECATED
+  void SomeClass::legacyMethod() {  }
+  #endif
+
+The ``PREFIX_NAME`` argument can be used to prepend all generated macro names
+with some prefix.  For example, the following will generate macros such as
+``VTK_SOMELIB_EXPORT``, etc.
+
+.. code-block:: cmake
+
+  include(GenerateExportHeader)
+  generate_export_header(somelib PREFIX_NAME "VTK_")
+
+Appending additional content to generated header can be done with the
+``CUSTOM_CONTENT_FROM_VARIABLE`` argument:
+
+.. code-block:: cmake
+
+  include(GenerateExportHeader)
+  set(content [[#include "project_api.h"]])
+  generate_export_header(example CUSTOM_CONTENT_FROM_VARIABLE content)
+
+Example: Building Shared and Static Library
+"""""""""""""""""""""""""""""""""""""""""""
+
+In the following example both a shared and a static library are built from
+the same sources, and the ``<MACRO>_STATIC_DEFINE`` macro compile definition
+is defined to ensure the same generated export header works for both:
+
+.. code-block:: cmake
+
+  add_library(example_shared SHARED example.cxx)
+  add_library(example_static STATIC example.cxx)
+
+  include(GenerateExportHeader)
+  generate_export_header(example_shared BASE_NAME "example")
+
+  # Define macro to disable export attributes for static build
+  target_compile_definitions(example_static PRIVATE EXAMPLE_STATIC_DEFINE)
+
+Example: Upgrading Deprecated Command
+"""""""""""""""""""""""""""""""""""""
+
+In earlier versions of CMake, ``add_compiler_export_flags()`` command was
+used to add symbol visibility compile options:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  add_library(example example.cxx)
+
+  include(GenerateExportHeader)
+
+  add_compiler_export_flags(flags)
+  string(REPLACE " " ";" flags "${flags}")
+  set_property(TARGET example APPEND PROPERTY COMPILE_OPTIONS "${flags}")
+
+  generate_export_header(example)
+
+In new code, the following target properties are used to achieve the same
+functionality:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  add_library(example example.cxx)
+
+  include(GenerateExportHeader)
+
+  set_target_properties(
+    example
+    PROPERTIES
+      CXX_VISIBILITY_PRESET hidden
+      VISIBILITY_INLINES_HIDDEN TRUE
+  )
+
+  generate_export_header(example)
+
+See Also
+^^^^^^^^
+
+* The :prop_tgt:`DEFINE_SYMBOL` target property to customize the preprocessor
+  macro name used by the generated header.  This macro determines whether
+  the library header is being included during the library's own compilation
+  or when it is used by another project (e.g., after installation).
+* The :prop_tgt:`ENABLE_EXPORTS` target property.
+* The :prop_tgt:`WINDOWS_EXPORT_ALL_SYMBOLS` target property.
 #]=======================================================================]
 
 include(CheckCompilerFlag)
@@ -223,9 +492,11 @@
 
 macro(_test_compiler_hidden_visibility)
 
-  if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2")
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
+    AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2")
     set(GCC_TOO_OLD TRUE)
-  elseif(CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.2")
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU"
+    AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.2")
     set(GCC_TOO_OLD TRUE)
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0")
     set(_INTEL_TOO_OLD TRUE)
@@ -290,9 +561,6 @@
   endif()
 endmacro()
 
-get_filename_component(_GENERATE_EXPORT_HEADER_MODULE_DIR
-  "${CMAKE_CURRENT_LIST_FILE}" PATH)
-
 macro(_DO_SET_MACRO_VALUES TARGET_LIBRARY)
   set(DEFINE_DEPRECATED)
   set(DEFINE_EXPORT)
@@ -319,7 +587,7 @@
   endif()
 endmacro()
 
-macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
+function(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   # Option overrides
   set(options DEFINE_NO_DEPRECATED)
   set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
@@ -409,9 +677,9 @@
     endif()
   endif()
 
-  configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
+  configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/exportheader.cmake.in"
     "${EXPORT_FILE_NAME}" @ONLY)
-endmacro()
+endfunction()
 
 function(GENERATE_EXPORT_HEADER TARGET_LIBRARY)
   get_property(type TARGET ${TARGET_LIBRARY} PROPERTY TYPE)
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 4f9d3e7..f1f5db7 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -9,170 +9,239 @@
 
   Use :command:`file(GET_RUNTIME_DEPENDENCIES)` instead.
 
-Functions to analyze and list executable file prerequisites.
+This module provides functions to analyze and list the dependencies
+(prerequisites) of executable or shared library files.  These functions list the
+shared libraries (``.dll``, ``.dylib``, or ``.so`` files) required by an
+executable or shared library.
 
-This module provides functions to list the .dll, .dylib or .so files
-that an executable or shared library file depends on.  (Its
-prerequisites.)
+It determines dependencies using the following platform-specific tools:
 
-It uses various tools to obtain the list of required shared library
-files:
-
-::
-
-   dumpbin (Windows)
-   objdump (MinGW on Windows)
-   ldd (Linux/Unix)
-   otool (Mac OSX)
+* ``dumpbin`` (Windows)
+* ``objdump`` (MinGW on Windows)
+* ``ldd`` (Linux/Unix)
+* ``otool`` (Apple operating systems)
 
 .. versionchanged:: 3.16
-  The tool specified by the :variable:`CMAKE_OBJDUMP` variable
-  will be used, if set.
+  The tool specified by the :variable:`CMAKE_OBJDUMP` variable will be used, if
+  set.
 
 The following functions are provided by this module:
 
-::
+* :command:`get_prerequisites`
+* :command:`list_prerequisites`
+* :command:`list_prerequisites_by_glob`
+* :command:`gp_append_unique`
+* :command:`is_file_executable`
+* :command:`gp_item_default_embedded_path`
+  (projects can override it with ``gp_item_default_embedded_path_override()``)
+* :command:`gp_resolve_item`
+  (projects can override it with ``gp_resolve_item_override()``)
+* :command:`gp_resolved_file_type`
+  (projects can override it with ``gp_resolved_file_type_override()``)
+* :command:`gp_file_type`
 
-   get_prerequisites
-   list_prerequisites
-   list_prerequisites_by_glob
-   gp_append_unique
-   is_file_executable
-   gp_item_default_embedded_path
-     (projects can override with gp_item_default_embedded_path_override)
-   gp_resolve_item
-     (projects can override with gp_resolve_item_override)
-   gp_resolved_file_type
-     (projects can override with gp_resolved_file_type_override)
-   gp_file_type
+Functions
+^^^^^^^^^
+
+.. command:: get_prerequisites
+
+  .. code-block:: cmake
+
+    get_prerequisites(<target> <prerequisites-var> <exclude-system> <recurse>
+                      <exepath> <dirs> [<rpaths>])
+
+  Gets the list of shared library files required by ``<target>``.  The list
+  in the variable named ``<prerequisites-var>`` should be empty on first
+  entry to this function.  On exit, ``<prerequisites-var>`` will contain the
+  list of required shared library files.
+
+  The arguments are:
+
+  ``<target>``
+    The full path to an executable or shared library file.
+  ``<prerequisites-var>``
+    The name of a CMake variable to contain the results.
+  ``<exclude-system>``
+    If set to 1 system prerequisites will be excluded, if set to 0 they will be
+    included.
+  ``<recurse>``
+    If set to 1 all prerequisites will be found recursively, if set to 0 only
+    direct prerequisites are listed.
+  ``<exepath>``
+    The path to the top level executable used for ``@executable_path``
+    replacement on Apple operating systems.
+  ``<dirs>``
+    A list of paths where libraries might be found: these paths are searched
+    first when a target without any path info is given.  Then standard system
+    locations are also searched: PATH, Framework locations, /usr/lib...
+  ``<rpaths>``
+    Optional run-time search paths for an executable file or library to help
+    find files.
+
+  .. versionadded:: 3.14
+    The variable ``GET_PREREQUISITES_VERBOSE`` can be set to true before calling
+    this function to enable verbose output.
+
+.. command:: list_prerequisites
+
+  .. code-block:: cmake
+
+    list_prerequisites(<target> [<recurse> [<exclude-system> [<verbose>]]])
+
+  Prints a message listing the prerequisites of ``<target>``.
+
+  The arguments are:
+
+  ``<target>``
+    The name of a shared library or executable target or the full path to a
+    shared library or executable file.
+  ``<recurse>``
+    If set to 1 all prerequisites will be found recursively, if set to 0 only
+    direct prerequisites are listed.
+  ``<exclude-system>``
+    If set to 1 system prerequisites will be excluded, if set to 0 they will be
+    included.
+  ``<verbose>``
+    If set to 0 only the full path names of the prerequisites are printed. If
+    set to 1 extra information will be displayed.
+
+.. command:: list_prerequisites_by_glob
+
+  .. code-block:: cmake
+
+    list_prerequisites_by_glob(<GLOB|GLOB_RECURSE>
+                               <glob-exp>
+                               [<optional-args>...])
+
+  Prints the prerequisites of shared library and executable files matching a
+  globbing pattern.
+
+  The arguments are:
+
+  ``GLOB`` or ``GLOB_RECURSE``
+    The globbing mode, whether to traverse only the match or also its
+    subdirectories recursively.
+  ``<glob-exp>``
+    A globbing expression used with :command:`file(GLOB)` or
+    :command:`file(GLOB_RECURSE)` to retrieve a list of matching files.  If a
+    matching file is executable, its prerequisites are listed.
+  ``<optional-args>...``
+    Any additional (optional) arguments provided are passed along as the
+    optional arguments to the ``list_prerequisite()`` calls.
+
+.. command:: gp_append_unique
+
+  .. code-block:: cmake
+
+    gp_append_unique(<list-var> <value>)
+
+  Appends ``<value>`` to the list variable ``<list-var>`` only if the value is
+  not already in the list.
+
+.. command:: is_file_executable
+
+  .. code-block:: cmake
+
+    is_file_executable(<file> <result-var>)
+
+  Sets ``<result-var>`` to 1 if ``<file>`` is a binary executable; otherwise
+  sets it to 0.
+
+.. command:: gp_item_default_embedded_path
+
+  .. code-block:: cmake
+
+    gp_item_default_embedded_path(<item> <default-embedded-path-var>)
+
+  Determines the reference path for ``<item>`` when it is embedded inside a
+  bundle and stores it to a variable ``<default-embedded-path-var>``.
+
+  Projects can override this function by defining a custom
+  ``gp_item_default_embedded_path_override()`` function.
+
+.. command:: gp_resolve_item
+
+  .. code-block:: cmake
+
+    gp_resolve_item(<context> <item> <exepath> <dirs> <resolved-item-var>
+                    [<rpaths>])
+
+  Resolves a given ``<item>`` into an existing full path file and stores it to a
+  ``<resolved-item-var>`` variable.
+
+  The arguments are:
+
+  ``<context>``
+    The path to the top level loading path used for ``@loader_path`` replacement
+    on Apple operating systems.  When resolving item, ``@loader_path``
+    references will be resolved relative to the directory of the given context
+    value (presumably another library).
+  ``<item>``
+    The item to resolve.
+  ``<exepath>``
+    See the argument description in :command:`get_prerequisites`.
+  ``<dirs>``
+    See the argument description in :command:`get_prerequisites`.
+  ``<resolved-item-var>``
+    The result variable where the resolved item is stored into.
+  ``<rpaths>``
+    See the argument description in :command:`get_prerequisites`.
+
+  Projects can override this function by defining a custom
+  ``gp_resolve_item_override()`` function.
+
+.. command:: gp_resolved_file_type
+
+  .. code-block:: cmake
+
+    gp_resolved_file_type(<original-file> <file> <exepath> <dirs> <type-var>
+                          [<rpaths>])
+
+  Determines the type of ``<file>`` with respect to ``<original-file>``. The
+  resulting type of prerequisite is stored in the ``<type-var>`` variable.
+
+  Use ``<exepath>`` and ``<dirs>`` if necessary to resolve non-absolute
+  ``<file>`` values -- but only for non-embedded items.
+
+  ``<rpaths>``
+    See the argument description in :command:`get_prerequisites`.
+
+  The ``<type-var>`` variable will be set to one of the following values:
+
+  * ``system``
+  * ``local``
+  * ``embedded``
+  * ``other``
+
+  Projects can override this function by defining a custom
+  ``gp_resolved_file_type_override()`` function.
+
+.. command:: gp_file_type
+
+  .. code-block:: cmake
+
+    gp_file_type(<original-file> <file> <type-var>)
+
+  Determines the type of ``<file>`` with respect to ``<original-file>``. The
+  resulting type of prerequisite is stored in the ``<type-var>`` variable.
+
+  The ``<type-var>`` variable will be set to one of the following values:
+
+  * ``system``
+  * ``local``
+  * ``embedded``
+  * ``other``
+
+Examples
+^^^^^^^^
+
+Printing all dependencies of a shared library, including system libraries, with
+verbose output:
 
 .. code-block:: cmake
 
-  GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
-                    <exepath> <dirs> [<rpaths>])
-
-Get the list of shared library files required by <target>.  The list
-in the variable named <prerequisites_var> should be empty on first
-entry to this function.  On exit, <prerequisites_var> will contain the
-list of required shared library files.
-
-<target> is the full path to an executable file.  <prerequisites_var>
-is the name of a CMake variable to contain the results.
-<exclude_system> must be 0 or 1 indicating whether to include or
-exclude "system" prerequisites.  If <recurse> is set to 1 all
-prerequisites will be found recursively, if set to 0 only direct
-prerequisites are listed.  <exepath> is the path to the top level
-executable used for @executable_path replacement on the Mac.  <dirs> is
-a list of paths where libraries might be found: these paths are
-searched first when a target without any path info is given.  Then
-standard system locations are also searched: PATH, Framework
-locations, /usr/lib...
-
-.. versionadded:: 3.14
-  The variable GET_PREREQUISITES_VERBOSE can be set to true to enable verbose
-  output.
-
-.. code-block:: cmake
-
-  LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
-
-Print a message listing the prerequisites of <target>.
-
-<target> is the name of a shared library or executable target or the
-full path to a shared library or executable file.  If <recurse> is set
-to 1 all prerequisites will be found recursively, if set to 0 only
-direct prerequisites are listed.  <exclude_system> must be 0 or 1
-indicating whether to include or exclude "system" prerequisites.  With
-<verbose> set to 0 only the full path names of the prerequisites are
-printed, set to 1 extra information will be displayed.
-
-.. code-block:: cmake
-
-  LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
-
-Print the prerequisites of shared library and executable files
-matching a globbing pattern.  <glob_arg> is GLOB or GLOB_RECURSE and
-<glob_exp> is a globbing expression used with "file(GLOB" or
-"file(GLOB_RECURSE" to retrieve a list of matching files.  If a
-matching file is executable, its prerequisites are listed.
-
-Any additional (optional) arguments provided are passed along as the
-optional arguments to the list_prerequisites calls.
-
-.. code-block:: cmake
-
-  GP_APPEND_UNIQUE(<list_var> <value>)
-
-Append <value> to the list variable <list_var> only if the value is
-not already in the list.
-
-.. code-block:: cmake
-
-  IS_FILE_EXECUTABLE(<file> <result_var>)
-
-Return 1 in <result_var> if <file> is a binary executable, 0
-otherwise.
-
-.. code-block:: cmake
-
-  GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
-
-Return the path that others should refer to the item by when the item
-is embedded inside a bundle.
-
-Override on a per-project basis by providing a project-specific
-gp_item_default_embedded_path_override function.
-
-.. code-block:: cmake
-
-  GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>
-                  [<rpaths>])
-
-Resolve an item into an existing full path file.
-
-Override on a per-project basis by providing a project-specific
-gp_resolve_item_override function.
-
-.. code-block:: cmake
-
-  GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>
-                        [<rpaths>])
-
-Return the type of <file> with respect to <original_file>.  String
-describing type of prerequisite is returned in variable named
-<type_var>.
-
-Use <exepath> and <dirs> if necessary to resolve non-absolute <file>
-values -- but only for non-embedded items.
-
-Possible types are:
-
-::
-
-   system
-   local
-   embedded
-   other
-
-Override on a per-project basis by providing a project-specific
-gp_resolved_file_type_override function.
-
-.. code-block:: cmake
-
-  GP_FILE_TYPE(<original_file> <file> <type_var>)
-
-Return the type of <file> with respect to <original_file>.  String
-describing type of prerequisite is returned in variable named
-<type_var>.
-
-Possible types are:
-
-::
-
-   system
-   local
-   embedded
-   other
+  include(GetPrerequisites)
+  list_prerequisites("path/to/libfoo.dylib" 1 0 1)
 #]=======================================================================]
 
 function(gp_append_unique list_var value)
@@ -512,7 +581,8 @@
     string(TOLOWER "${resolved_file}" lower)
 
     if(UNIX)
-      if(resolved_file MATCHES "^/*(/lib/|/lib32/|/libx32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/libx32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)")
+      if(resolved_file MATCHES "^/*(/lib/|/lib32/|/libx32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/libx32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)" OR
+         resolved_file MATCHES "/cce/.*/lib/lib[^/]+\.so\\.[0-9][^/]*$")
         set(is_system 1)
       endif()
     endif()
diff --git a/Modules/Internal/CMakeInspectASMLinker.cmake b/Modules/Internal/CMakeInspectASMLinker.cmake
index 3f25676..1ae7a40 100644
--- a/Modules/Internal/CMakeInspectASMLinker.cmake
+++ b/Modules/Internal/CMakeInspectASMLinker.cmake
@@ -4,6 +4,8 @@
 # Re-configure to save learned information.
 block()
   foreach(_var IN ITEMS
+      # Compiler information.
+      # Keep in sync with CMakeDetermineASMCompiler.
       COMPILER
       COMPILER_ID
       COMPILER_ARG1
@@ -11,6 +13,8 @@
       COMPILER_AR
       COMPILER_RANLIB
       COMPILER_VERSION
+      COMPILER_ARCHITECTURE_ID
+      # Linker information.
       COMPILER_LINKER
       COMPILER_LINKER_ID
       COMPILER_LINKER_VERSION
diff --git a/Modules/Internal/CMakeParseCompilerArchitectureId.cmake b/Modules/Internal/CMakeParseCompilerArchitectureId.cmake
new file mode 100644
index 0000000..9200158
--- /dev/null
+++ b/Modules/Internal/CMakeParseCompilerArchitectureId.cmake
@@ -0,0 +1,74 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file LICENSE.rst or https://cmake.org/licensing for details.
+
+function(cmake_parse_compiler_architecture_id triple arch_id_var)
+  # Sync with:
+  #   Help/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.rst
+  #   Modules/CMakeCompilerABI.h
+  #   Modules/CMakeFortranCompilerABI.F
+  #   Modules/CMakeFortranCompilerABI.F90
+  if(_dumpmachine_triple MATCHES "^(aarch64|arm64)-apple-")
+    set(ARCHITECTURE_ID "arm64")
+  elseif(_dumpmachine_triple MATCHES "^(aarch64|arm64)_32-apple-")
+    set(ARCHITECTURE_ID "arm64_32")
+  elseif(_dumpmachine_triple MATCHES "^(aarch64|arm64)e-apple-")
+    set(ARCHITECTURE_ID "arm64e")
+  elseif(_dumpmachine_triple MATCHES "^(armv7k|armv7s)-apple-")
+    set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+  elseif(_dumpmachine_triple MATCHES "^(aarch64|arm64)-")
+    set(ARCHITECTURE_ID "aarch64")
+  elseif(_dumpmachine_triple MATCHES "^(armv[5-7])[^-]*-")
+    set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+  elseif(_dumpmachine_triple MATCHES "^alpha[^-]*-")
+    set(ARCHITECTURE_ID "alpha")
+  elseif(_dumpmachine_triple MATCHES "^(x86_64|amd64)-")
+    set(ARCHITECTURE_ID "x86_64")
+  elseif(_dumpmachine_triple MATCHES "^(i[3-6]86)-")
+    set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
+  elseif(_dumpmachine_triple MATCHES "^ia64-")
+    set(ARCHITECTURE_ID "ia64")
+  elseif(_dumpmachine_triple MATCHES "^loongarch64-")
+    set(ARCHITECTURE_ID "loongarch64")
+  elseif(_dumpmachine_triple MATCHES "^loongarch(32)?-")
+    set(ARCHITECTURE_ID "loongarch32")
+  elseif(_dumpmachine_triple MATCHES "^m68k-")
+    set(ARCHITECTURE_ID "m68k")
+  elseif(_dumpmachine_triple MATCHES "^mingw32$") # MinGW/MSYS 1.0: http://mingw.osdn.io/
+    set(ARCHITECTURE_ID "i386")
+  elseif(_dumpmachine_triple MATCHES "^mips[^-]*64[^-]*el-")
+    set(ARCHITECTURE_ID "mips64el")
+  elseif(_dumpmachine_triple MATCHES "^mips[^-]*64[^-]*-")
+    set(ARCHITECTURE_ID "mips64")
+  elseif(_dumpmachine_triple MATCHES "^mips[^-]*el[^-]*-")
+    set(ARCHITECTURE_ID "mipsel")
+  elseif(_dumpmachine_triple MATCHES "^mips[^-]*-")
+    set(ARCHITECTURE_ID "mips")
+  elseif(_dumpmachine_triple MATCHES "^riscv64-")
+    set(ARCHITECTURE_ID "riscv64")
+  elseif(_dumpmachine_triple MATCHES "^riscv32-")
+    set(ARCHITECTURE_ID "riscv32")
+  elseif(_dumpmachine_triple MATCHES "^s390x-")
+    set(ARCHITECTURE_ID "s390x")
+  elseif(_dumpmachine_triple MATCHES "^s390-")
+    set(ARCHITECTURE_ID "s390")
+  elseif(_dumpmachine_triple MATCHES "^(sparcv9|sparc64)-")
+    set(ARCHITECTURE_ID "sparcv9")
+  elseif(_dumpmachine_triple MATCHES "^sparc-")
+    set(ARCHITECTURE_ID "sparc")
+  elseif(_dumpmachine_triple MATCHES "^(hppa64|parisc64)-")
+    set(ARCHITECTURE_ID "parisc64")
+  elseif(_dumpmachine_triple MATCHES "^(hppa[0-9.]*|parisc)-")
+    set(ARCHITECTURE_ID "parisc")
+  elseif(_dumpmachine_triple MATCHES "^(powerpc64le|ppc64le)-")
+    set(ARCHITECTURE_ID "ppc64le")
+  elseif(_dumpmachine_triple MATCHES "^(powerpc64|ppc64)-")
+    set(ARCHITECTURE_ID "ppc64")
+  elseif(_dumpmachine_triple MATCHES "^(powerpcle|ppcle)-")
+    set(ARCHITECTURE_ID "ppcle")
+  elseif(_dumpmachine_triple MATCHES "^(powerpc|ppc)-")
+    set(ARCHITECTURE_ID "ppc")
+  else()
+    set(ARCHITECTURE_ID "")
+  endif()
+  set("${arch_id_var}" "${ARCHITECTURE_ID}" PARENT_SCOPE)
+endfunction()
diff --git a/Modules/Internal/CPack/CPackNuGet.cmake b/Modules/Internal/CPack/CPackNuGet.cmake
index 9b6cc91..5c3e451 100644
--- a/Modules/Internal/CPack/CPackNuGet.cmake
+++ b/Modules/Internal/CPack/CPackNuGet.cmake
@@ -468,6 +468,12 @@
     list(APPEND CPACK_NUGET_PACK_ADDITIONAL_OPTIONS "-Verbosity" "detailed")
 endif()
 
+# Generate symbol package
+if(CPACK_NUGET_SYMBOL_PACKAGE)
+    list(APPEND CPACK_NUGET_PACK_ADDITIONAL_OPTIONS "-Symbols")
+    list(APPEND CPACK_NUGET_PACK_ADDITIONAL_OPTIONS "-SymbolPackageFormat" "snupkg")
+endif()
+
 # Case one: ordinal all-in-one package
 if(CPACK_NUGET_ORDINAL_MONOLITIC)
     # This variable `CPACK_NUGET_ALL_IN_ONE` set by C++ code:
@@ -552,9 +558,19 @@
     endif()
 endif()
 
-file(GLOB_RECURSE GEN_CPACK_OUTPUT_FILES "${CPACK_TEMPORARY_DIRECTORY}/*.nupkg")
-if(NOT GEN_CPACK_OUTPUT_FILES)
+
+file(GLOB_RECURSE GEN_CPACK_NUGET_PACKAGE_FILES "${CPACK_TEMPORARY_DIRECTORY}/*.nupkg")
+if(NOT GEN_CPACK_NUGET_PACKAGE_FILES)
     message(FATAL_ERROR "NuGet package was not generated at `${CPACK_TEMPORARY_DIRECTORY}`!")
 endif()
+list(APPEND GEN_CPACK_OUTPUT_FILES "${GEN_CPACK_NUGET_PACKAGE_FILES}")
+
+if(CPACK_NUGET_SYMBOL_PACKAGE)
+  file(GLOB_RECURSE GEN_CPACK_NUGET_SYMBOL_PACKAGE_FILES "${CPACK_TEMPORARY_DIRECTORY}/*.snupkg")
+  if(NOT GEN_CPACK_NUGET_SYMBOL_PACKAGE_FILES)
+        message(FATAL_ERROR "NuGet symbol package was not generated at `${CPACK_TEMPORARY_DIRECTORY}`!")
+    endif()
+    list(APPEND GEN_CPACK_OUTPUT_FILES "${GEN_CPACK_NUGET_SYMBOL_PACKAGE_FILES}")
+endif()
 
 _cpack_nuget_debug("Generated files: ${GEN_CPACK_OUTPUT_FILES}")
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake
index 7776ee2..b733cfe 100644
--- a/Modules/Internal/CPack/CPackRPM.cmake
+++ b/Modules/Internal/CPack/CPackRPM.cmake
@@ -185,12 +185,12 @@
       string(SUBSTRING "${REL_PATH_}" 0 2 PREFIX_)
 
       if(NOT "${PREFIX_}" STREQUAL "..")
-        set(TPM_PATH_FOUND_ TRUE)
+        set(TMP_PATH_FOUND_ TRUE)
         break()
       endif()
     endforeach()
 
-    if(NOT TPM_PATH_FOUND_)
+    if(NOT TMP_PATH_FOUND_)
       message(AUTHOR_WARNING "CPackRPM:Warning: Path ${TMP_PATH} is not on one of the relocatable paths! Package will be partially relocatable.")
     endif()
   endforeach()
@@ -1112,7 +1112,7 @@
   # There may be some COMPONENT specific variables as well
   # If component specific var is not provided we use the global one
   # for each component
-  foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN)
+  foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS RECOMMENDS SUPPLEMENTS ENHANCES PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV REQUIRES_PRE REQUIRES_POST REQUIRES_PREUN REQUIRES_POSTUN)
 
     if(CPACK_RPM_PACKAGE_DEBUG)
       message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
@@ -1730,7 +1730,10 @@
 \@TMP_RPM_PROVIDES\@
 \@TMP_RPM_OBSOLETES\@
 \@TMP_RPM_CONFLICTS\@
+\@TMP_RPM_RECOMMENDS\@
 \@TMP_RPM_SUGGESTS\@
+\@TMP_RPM_SUPPLEMENTS\@
+\@TMP_RPM_ENHANCES\@
 \@TMP_RPM_AUTOPROV\@
 \@TMP_RPM_AUTOREQ\@
 \@TMP_RPM_AUTOREQPROV\@
@@ -1799,7 +1802,10 @@
 \@TMP_RPM_PROVIDES\@
 \@TMP_RPM_OBSOLETES\@
 \@TMP_RPM_CONFLICTS\@
+\@TMP_RPM_RECOMMENDS\@
 \@TMP_RPM_SUGGESTS\@
+\@TMP_RPM_SUPPLEMENTS\@
+\@TMP_RPM_ENHANCES\@
 \@TMP_RPM_AUTOPROV\@
 \@TMP_RPM_AUTOREQ\@
 \@TMP_RPM_AUTOREQPROV\@
diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in
index 6349f9d..c0b61e3 100644
--- a/Modules/Internal/CPack/NSIS.template.in
+++ b/Modules/Internal/CPack/NSIS.template.in
@@ -923,8 +923,9 @@
   ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString"
   StrCmp $0 "" inst
 
+  ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "DisplayName"
   MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
-  "@CPACK_NSIS_PACKAGE_NAME@ is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
+  "$1 is already installed. $\n$\nDo you want to uninstall the old version before installing the new one?" \
   /SD IDYES IDYES uninst IDNO inst
   Abort
 
diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index da65561..1bca52f 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -1,30 +1,12 @@
 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
 # file LICENSE.rst or https://cmake.org/licensing for details.
 
-#
+# This file contains KDE 3 macros. See FindKDE3.cmake for documentation.
+# Author: neundorf@kde.org
 
-# See FindKDE3.cmake for documentation.
-#
-# this file contains the following macros:
-# KDE3_ADD_DCOP_SKELS
-# KDE3_ADD_DCOP_STUBS
-# KDE3_ADD_MOC_FILES
-# KDE3_ADD_UI_FILES
-# KDE3_ADD_KCFG_FILES
-# KDE3_AUTOMOC
-# KDE3_INSTALL_LIBTOOL_FILE
-# KDE3_CREATE_FINAL_FILE
-# KDE3_ADD_KPART
-# KDE3_ADD_KDEINIT_EXECUTABLE
-# KDE3_ADD_EXECUTABLE
-
-
-#neundorf@kde.org
-
+# Included for backward compatibility, otherwise unused.
 include(AddFileDependencies)
 
-#create the kidl and skeletion file for dcop stuff
-#usage: KDE_ADD_COP_SKELS(foo_SRCS ${dcop_headers})
 macro(KDE3_ADD_DCOP_SKELS _sources)
   foreach (_current_FILE ${ARGN})
 
@@ -130,8 +112,6 @@
 endmacro()
 
 
-#create the moc files and add them to the list of sources
-#usage: KDE_ADD_MOC_FILES(foo_SRCS ${moc_headers})
 macro(KDE3_ADD_MOC_FILES _sources)
   foreach (_current_FILE ${ARGN})
 
@@ -154,8 +134,6 @@
 
 get_filename_component( KDE3_MODULE_DIR  ${CMAKE_CURRENT_LIST_FILE} PATH)
 
-#create the implementation files from the ui files and add them to the list of sources
-#usage: KDE_ADD_UI_FILES(foo_SRCS ${ui_files})
 macro(KDE3_ADD_UI_FILES _sources )
   foreach (_current_FILE ${ARGN})
 
@@ -234,7 +212,7 @@
           DEPENDS ${_header}
         )
 
-        ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+        set_property(SOURCE "${_abs_FILE}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
 
       endforeach ()
       unset(_match)
@@ -244,7 +222,7 @@
   endforeach ()
 endmacro()
 
-# only used internally by KDE3_INSTALL_ICONS
+# Only used internally by kde3_install_icons().
 macro (_KDE3_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME)
 
   # if the string doesn't match the pattern, the result is the full string, so all three have the same content
@@ -357,7 +335,7 @@
   endif ()
 
 #    if (KDE3_ENABLE_FINAL)
-#       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN})
+#       kde3_create_final_file(${_target_NAME}_final.cpp ${_first_SRC} ${ARGN})
 #       add_library(${_target_NAME} MODULE  ${_target_NAME}_final.cpp)
 #    else ()
   add_library(${_target_NAME} MODULE ${_first_SRC} ${ARGN})
@@ -367,15 +345,14 @@
     set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
   endif()
 
-  KDE3_INSTALL_LIBTOOL_FILE(${_target_NAME})
-
+  kde3_install_libtool_file(${_target_NAME})
 endmacro()
 
 
 macro(KDE3_ADD_KDEINIT_EXECUTABLE _target_NAME )
 
 #    if (KDE3_ENABLE_FINAL)
-#       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
+#       kde3_create_final_file(${_target_NAME}_final.cpp ${ARGN})
 #       add_library(kdeinit_${_target_NAME} SHARED  ${_target_NAME}_final.cpp)
 #    else ()
   add_library(kdeinit_${_target_NAME} SHARED ${ARGN} )
@@ -392,7 +369,7 @@
 macro(KDE3_ADD_EXECUTABLE _target_NAME )
 
 #    if (KDE3_ENABLE_FINAL)
-#       KDE3_CREATE_FINAL_FILE(${_target_NAME}_final.cpp ${ARGN})
+#       kde3_create_final_file(${_target_NAME}_final.cpp ${ARGN})
 #       add_executable(${_target_NAME} ${_target_NAME}_final.cpp)
 #    else ()
   add_executable(${_target_NAME} ${ARGN} )
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index 80f7b32..9dee09d 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -9,7 +9,7 @@
 
 .. code-block:: cmake
 
-  MACRO_ADD_FILE_DEPENDENCIES(<source> <files>...)
+  macro_add_file_dependencies(<source> <files>...)
 
 Do not use this command in new code.  It is just a wrapper around:
 
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index 111aa83..91cf2d7 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -26,7 +26,7 @@
   # that we export only the symbols actually provided by the sources.
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
     "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/exports.exp -c <CMAKE_${lang}_COMPILER> <AIX_EXPORTS> <OBJECTS>"
-    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
+    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
     )
 
   # Create an archive for shared library if CMAKE_AIX_SHARED_LIBRARY_ARCHIVE is used.
@@ -39,5 +39,5 @@
 
   set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
     "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -c <CMAKE_${lang}_COMPILER> -l . <AIX_EXPORTS> <OBJECTS>"
-    "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 endmacro()
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
index 24477ce..9dfd9e5 100644
--- a/Modules/Platform/AIX-XL.cmake
+++ b/Modules/Platform/AIX-XL.cmake
@@ -30,7 +30,7 @@
   # that we export only the symbols actually provided by the sources.
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
     "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <OBJECT_DIR>/exports.exp -c <CMAKE_${lang}_COMPILER> <AIX_EXPORTS>${_OBJECTS}"
-    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
+    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/exports.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
     )
 
   # Create an archive for shared library if CMAKE_AIX_SHARED_LIBRARY_ARCHIVE is used.
@@ -43,7 +43,7 @@
 
   set(CMAKE_${lang}_LINK_EXECUTABLE_WITH_EXPORTS
     "\"${CMAKE_ROOT}/Modules/Platform/AIX/ExportImportList\" -o <TARGET_IMPLIB> -c <CMAKE_${lang}_COMPILER> -l . <AIX_EXPORTS> <OBJECTS>"
-    "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <FLAGS> -Wl,-bE:<TARGET_IMPLIB> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
   unset(_OBJECTS)
 endmacro()
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index ff4290e..b7981d9 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -352,6 +352,10 @@
   set(NDK_ABI_x86_64_ARCH              "x86_64")
   set(NDK_ABI_x86_64_TRIPLE            "x86_64-linux-android")
   set(NDK_ABI_x86_64_LLVM_TRIPLE       "x86_64-none-linux-android")
+  set(NDK_ABI_riscv64_PROC             "riscv64")
+  set(NDK_ABI_riscv64_ARCH             "riscv64")
+  set(NDK_ABI_riscv64_TRIPLE           "riscv64-linux-android")
+  set(NDK_ABI_riscv64_LLVM_TRIPLE      "riscv64-none-linux-android")
 
   set(NDK_PROC_aarch64_ABI "arm64-v8a")
   set(NDK_PROC_armv7-a_ABI "armeabi-v7a")
@@ -361,13 +365,15 @@
   set(NDK_PROC_mips_ABI    "mips")
   set(NDK_PROC_mips64_ABI  "mips64")
   set(NDK_PROC_x86_64_ABI  "x86_64")
+  set(NDK_PROC_riscv64_ABI "riscv64")
 
-  set(NDK_ARCH_arm64_ABI  "arm64-v8a")
-  set(NDK_ARCH_arm_ABI    "armeabi")
-  set(NDK_ARCH_mips_ABI   "mips")
-  set(NDK_ARCH_mips64_ABI "mips64")
-  set(NDK_ARCH_x86_ABI    "x86")
-  set(NDK_ARCH_x86_64_ABI "x86_64")
+  set(NDK_ARCH_arm64_ABI   "arm64-v8a")
+  set(NDK_ARCH_arm_ABI     "armeabi")
+  set(NDK_ARCH_mips_ABI    "mips")
+  set(NDK_ARCH_mips64_ABI  "mips64")
+  set(NDK_ARCH_x86_ABI     "x86")
+  set(NDK_ARCH_x86_64_ABI  "x86_64")
+  set(NDK_ARCH_riscv64_ABI "riscv64")
 endif()
 
 # Validate inputs.
@@ -524,6 +530,9 @@
     if(CMAKE_ANDROID_ARCH_ABI MATCHES "64(-v8a)?$" AND CMAKE_SYSTEM_VERSION LESS 21)
       set(CMAKE_SYSTEM_VERSION 21)
     endif()
+    if(CMAKE_ANDROID_ARCH_ABI MATCHES "^riscv64$" AND CMAKE_SYSTEM_VERSION LESS 35)
+      set(CMAKE_SYSTEM_VERSION 35)
+    endif()
   else()
     file(GLOB _ANDROID_APIS_1 RELATIVE "${CMAKE_ANDROID_NDK}/platforms" "${CMAKE_ANDROID_NDK}/platforms/android-[0-9]")
     file(GLOB _ANDROID_APIS_2 RELATIVE "${CMAKE_ANDROID_NDK}/platforms" "${CMAKE_ANDROID_NDK}/platforms/android-[0-9][0-9]")
diff --git a/Modules/Platform/Android/abi-riscv64-Clang.cmake b/Modules/Platform/Android/abi-riscv64-Clang.cmake
new file mode 100644
index 0000000..7df6a36
--- /dev/null
+++ b/Modules/Platform/Android/abi-riscv64-Clang.cmake
@@ -0,0 +1 @@
+include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Apple-NAG-Fortran.cmake b/Modules/Platform/Apple-NAG-Fortran.cmake
index 41dd55b..801aaf0 100644
--- a/Modules/Platform/Apple-NAG-Fortran.cmake
+++ b/Modules/Platform/Apple-NAG-Fortran.cmake
@@ -17,4 +17,4 @@
 set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-Wl,-shared")
 set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-install_name -Wl,")
 set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
-  "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG><TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
+  "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG><TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
diff --git a/Modules/Platform/Apple-NVIDIA-CUDA.cmake b/Modules/Platform/Apple-NVIDIA-CUDA.cmake
index 35e759a..bc13ae3 100644
--- a/Modules/Platform/Apple-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Apple-NVIDIA-CUDA.cmake
@@ -15,5 +15,5 @@
 set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS "-shared -Wl,-headerpad_max_install_names")
 set(CMAKE_SHARED_MODULE_CREATE_CUDA_FLAGS "-shared -Wl,-headerpad_max_install_names")
 
-set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
-set(CMAKE_CUDA_CREATE_SHARED_MODULE "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+set(CMAKE_CUDA_CREATE_SHARED_LIBRARY "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
+set(CMAKE_CUDA_CREATE_SHARED_MODULE "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <CMAKE_SHARED_LIBRARY_CUDA_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
diff --git a/Modules/Platform/BlueGeneL.cmake b/Modules/Platform/BlueGeneL.cmake
index 0ed9975..9f3b745 100644
--- a/Modules/Platform/BlueGeneL.cmake
+++ b/Modules/Platform/BlueGeneL.cmake
@@ -21,20 +21,20 @@
 
 include(Platform/UnixPaths)
 
-if(CMAKE_COMPILER_IS_GNUCC)
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_C_LINK_EXECUTABLE
-    "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
+    "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
 else()
   # when using IBM xlc we probably don't want to link to -lgcc
   set(CMAKE_C_LINK_EXECUTABLE
-    "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv")
+    "<CMAKE_C_COMPILER> -Wl,-relax <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv")
 endif()
 
-if(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_CXX_LINK_EXECUTABLE
-    "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
+    "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
 else()
   # when using the IBM xlC we probably don't want to link to -lgcc
   set(CMAKE_CXX_LINK_EXECUTABLE
-    "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv")
+    "<CMAKE_CXX_COMPILER> -Wl,-relax <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv")
 endif()
diff --git a/Modules/Platform/BlueGeneP-base.cmake b/Modules/Platform/BlueGeneP-base.cmake
index 86078d7..7552fad 100644
--- a/Modules/Platform/BlueGeneP-base.cmake
+++ b/Modules/Platform/BlueGeneP-base.cmake
@@ -92,7 +92,7 @@
   set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP  ":") # : or empty
 
   set(BGP_${lang}_DEFAULT_EXE_FLAGS
-    "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_LINK_EXECUTABLE
     "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGP_${lang}_DYNAMIC_EXE_FLAGS} ${BGP_${lang}_DEFAULT_EXE_FLAGS}")
 endmacro()
@@ -103,7 +103,7 @@
 #
 macro(__BlueGeneP_set_static_flags compiler_id lang)
   set(BGP_${lang}_DEFAULT_EXE_FLAGS
-    "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_LINK_EXECUTABLE
     "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGP_${lang}_DEFAULT_EXE_FLAGS}")
 endmacro()
diff --git a/Modules/Platform/BlueGeneQ-base.cmake b/Modules/Platform/BlueGeneQ-base.cmake
index 555da9d..9f316a4 100644
--- a/Modules/Platform/BlueGeneQ-base.cmake
+++ b/Modules/Platform/BlueGeneQ-base.cmake
@@ -141,7 +141,7 @@
 
   # For dynamic executables, need to provide special BG/Q arguments.
   set(BGQ_${lang}_DEFAULT_EXE_FLAGS
-    "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_LINK_EXECUTABLE
     "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGQ_${lang}_DYNAMIC_EXE_FLAGS} ${BGQ_${lang}_DEFAULT_EXE_FLAGS}")
 endmacro()
@@ -155,7 +155,7 @@
 
   # For static executables, use default link settings.
   set(BGQ_${lang}_DEFAULT_EXE_FLAGS
-    "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_LINK_EXECUTABLE
     "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGQ_${lang}_DEFAULT_EXE_FLAGS}")
 endmacro()
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 925f51b..4331e16 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -19,11 +19,11 @@
 macro(__cygwin_compiler_gnu lang)
   # Binary link rules.
   set(CMAKE_${lang}_CREATE_SHARED_MODULE
-    "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_${lang}_FLAGS> <LINK_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
-    "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LINK_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
   set(CMAKE_${lang}_CREATE_WIN32_EXE "-mwindows")
 
   set(CMAKE_${lang}_VERBOSE_LINK_FLAG "-Wl,-v")
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 387abc8..42c6b35 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -95,13 +95,13 @@
   endif()
 
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
-    "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
 
   set(CMAKE_${lang}_CREATE_SHARED_MODULE
-      "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
   set(CMAKE_${lang}_CREATE_MACOSX_FRAMEWORK
-      "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
+      "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> -o <TARGET> <SONAME_FLAG> <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
 
   # Set default framework search path flag for languages known to use a
   # preprocessor that may find headers in frameworks.
diff --git a/Modules/Platform/Generic-ADSP-C.cmake b/Modules/Platform/Generic-ADSP-C.cmake
index c8597cd..f275871 100644
--- a/Modules/Platform/Generic-ADSP-C.cmake
+++ b/Modules/Platform/Generic-ADSP-C.cmake
@@ -13,10 +13,10 @@
 set(CMAKE_C_LINKER_WRAPPER_FLAG_SEP ",")
 
 set(CMAKE_C_CREATE_STATIC_LIBRARY
-    "<CMAKE_C_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_C_LINK_FLAGS> <OBJECTS>")
+    "<CMAKE_C_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <OBJECTS>")
 
 set(CMAKE_C_LINK_EXECUTABLE
-    "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_C_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
 set(CMAKE_C_CREATE_SHARED_LIBRARY)
 set(CMAKE_C_CREATE_MODULE_LIBRARY)
diff --git a/Modules/Platform/Generic-ADSP-CXX.cmake b/Modules/Platform/Generic-ADSP-CXX.cmake
index d76bb66..d21444f 100644
--- a/Modules/Platform/Generic-ADSP-CXX.cmake
+++ b/Modules/Platform/Generic-ADSP-CXX.cmake
@@ -11,10 +11,10 @@
 set(CMAKE_CXX_LINKER_WRAPPER_FLAG_SEP ",")
 
 set(CMAKE_CXX_CREATE_STATIC_LIBRARY
-     "<CMAKE_CXX_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <CMAKE_CXX_LINK_FLAGS> <OBJECTS>")
+     "<CMAKE_CXX_COMPILER> -build-lib -proc ${ADSP_PROCESSOR} -si-revision ${ADSP_PROCESSOR_SILICIUM_REVISION} -o <TARGET> <OBJECTS>")
 
 set(CMAKE_CXX_LINK_EXECUTABLE
-     "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+     "<CMAKE_CXX_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
 set(CMAKE_CXX_CREATE_SHARED_LIBRARY)
 set(CMAKE_CXX_CREATE_MODULE_LIBRARY)
diff --git a/Modules/Platform/Generic-SDCC-C.cmake b/Modules/Platform/Generic-SDCC-C.cmake
index c3fd186..6783346 100644
--- a/Modules/Platform/Generic-SDCC-C.cmake
+++ b/Modules/Platform/Generic-SDCC-C.cmake
@@ -46,7 +46,7 @@
 set(CMAKE_C_COMPILE_OBJECT  "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
 
 # link object files to an executable
-set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> -o <TARGET> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>")
+set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <OBJECTS> -o <TARGET> <LINK_FLAGS> <LINK_LIBRARIES>")
 
 # needs sdcc + sdar/sdcclib
 set(CMAKE_C_CREATE_STATIC_LIBRARY
diff --git a/Modules/Platform/Linux-NVHPC.cmake b/Modules/Platform/Linux-NVHPC.cmake
index f6a0f3d..c5662d8 100644
--- a/Modules/Platform/Linux-NVHPC.cmake
+++ b/Modules/Platform/Linux-NVHPC.cmake
@@ -10,7 +10,11 @@
   set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
   set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
   set(CMAKE_${lang}_LINK_OPTIONS_PIE "-fPIE")
-  set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
+  if(CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 25.07)
+    set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-fno-pie")
+  else()
+    set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
+  endif()
   set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
   set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
   set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "")
diff --git a/Modules/Platform/Linux-como.cmake b/Modules/Platform/Linux-como.cmake
index f6db34c..0ac71cf 100644
--- a/Modules/Platform/Linux-como.cmake
+++ b/Modules/Platform/Linux-como.cmake
@@ -1,7 +1,7 @@
 # create a shared C++ library
 set(CMAKE_CXX_CREATE_SHARED_LIBRARY
     "<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
-    "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+    "<CMAKE_CXX_COMPILER> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 
 # create a C++ static library
 set(CMAKE_CXX_CREATE_STATIC_LIBRARY
@@ -11,7 +11,7 @@
 
 set(CMAKE_CXX_LINK_EXECUTABLE
     "<CMAKE_CXX_COMPILER> --prelink_objects <OBJECTS>"
-    "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_CXX_COMPILER> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
 set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")
 set(CMAKE_SHARED_LIBRARY_C_FLAGS "")
diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake
index f2ad612..b400313 100644
--- a/Modules/Platform/OSF1.cmake
+++ b/Modules/Platform/OSF1.cmake
@@ -14,12 +14,12 @@
 
 if(CMAKE_SYSTEM MATCHES "OSF1-V")
   set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*")       # -shared
-  if(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,-rpath,")
   else()
     set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-rpath ")
   endif()
-  if(CMAKE_COMPILER_IS_GNUCC)
+  if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
   else()
     set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-rpath ")
@@ -29,7 +29,7 @@
 
 set(CMAKE_MAKE_INCLUDE_FROM_ROOT 1) # include $(CMAKE_BINARY_DIR)/...
 
-if(CMAKE_COMPILER_IS_GNUCXX)
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   # include the gcc flags
 else ()
   # use default OSF compiler flags
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index c6dc423..9ca8d6f 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -33,7 +33,8 @@
   set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
   set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib")
   set(CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS 1)
-  set (CMAKE_LINK_DEF_FILE_FLAG "-Xlinker /DEF:")
+  set(CMAKE_${lang}_LINK_DEF_FILE_FLAG "-Xlinker /DEF:")
+  set(CMAKE_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINK_DEF_FILE_FLAG}")
 
   set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
   set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
@@ -84,10 +85,10 @@
   set(CMAKE_${lang}_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
   set(CMAKE_${lang}_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
-    "<CMAKE_${lang}_COMPILER> -nostartfiles -nostdlib <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} -Xlinker /MANIFEST:EMBED -Xlinker /implib:<TARGET_IMPLIB> -Xlinker /pdb:<TARGET_PDB> -Xlinker /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <OBJECTS> <LINK_LIBRARIES> <MANIFESTS>")
+    "<CMAKE_${lang}_COMPILER> -nostartfiles -nostdlib <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} -Xlinker /MANIFEST:EMBED -Xlinker /implib:<TARGET_IMPLIB> -Xlinker /pdb:<TARGET_PDB> -Xlinker /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <OBJECTS> <LINK_LIBRARIES> <MANIFESTS>")
   set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "<CMAKE_${lang}_COMPILER> -nostartfiles -nostdlib <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Xlinker /MANIFEST:EMBED -Xlinker /implib:<TARGET_IMPLIB> -Xlinker /pdb:<TARGET_PDB> -Xlinker /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES> <MANIFESTS>")
+    "<CMAKE_${lang}_COMPILER> -nostartfiles -nostdlib <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Xlinker /MANIFEST:EMBED -Xlinker /implib:<TARGET_IMPLIB> -Xlinker /pdb:<TARGET_PDB> -Xlinker /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES> <MANIFESTS>")
 
   set(CMAKE_${lang}_CREATE_WIN32_EXE "-Xlinker /subsystem:windows")
   set(CMAKE_${lang}_CREATE_CONSOLE_EXE "-Xlinker /subsystem:console")
@@ -228,7 +229,7 @@
       set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-imsvc")
 
       set(CMAKE_${lang}_LINK_MODE LINKER)
-endmacro()
+    endmacro()
   else()
     cmake_policy(GET CMP0091 __WINDOWS_CLANG_CMP0091)
     if(__WINDOWS_CLANG_CMP0091 STREQUAL "NEW")
diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index ad5bb1c..568b995 100644
--- a/Modules/Platform/Windows-Embarcadero.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -74,6 +74,8 @@
 macro(__embarcadero_language lang)
   set(CMAKE_${lang}_COMPILE_OPTIONS_DLL "${_tD}") # Note: This variable is a ';' separated list
   set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}") # ... while this is a space separated string.
+  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "")
+  set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "")
   set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
 
   set (CMAKE_${lang}_LINKER_WRAPPER_FLAG "-l")
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index ea7b77b..37d5cf1 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -127,13 +127,15 @@
     set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")
   endif()
 
+  set(CMAKE_${lang}_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough
+
   # Binary link rules.
   set(CMAKE_${lang}_CREATE_SHARED_MODULE
-    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_MODULE_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_MODULE_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
-    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
+    "<CMAKE_${lang}_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
   set(CMAKE_${lang}_CREATE_WIN32_EXE "-mwindows")
 
   list(APPEND CMAKE_${lang}_ABI_FILES "Platform/Windows-GNU-${lang}-ABI")
diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake
index 2b9d83b..1800482 100644
--- a/Modules/Platform/Windows-IntelLLVM.cmake
+++ b/Modules/Platform/Windows-IntelLLVM.cmake
@@ -35,18 +35,19 @@
 
   set(CMAKE_${lang}_CREATE_WIN32_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:windows")
   set(CMAKE_${lang}_CREATE_CONSOLE_EXE "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/subsystem:console")
-  set(CMAKE_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/DEF:")
+  set(CMAKE_${lang}_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/DEF:")
+  set(CMAKE_LINK_DEF_FILE_FLAG "${CMAKE_${lang}_LINK_DEF_FILE_FLAG}")
   set(CMAKE_LIBRARY_PATH_FLAG "${CMAKE_${lang}_LINKER_WRAPPER_FLAG}/LIBPATH:")
 
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} <LINK_FLAGS> <LINK_LIBRARIES> /link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
+    "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <LINK_FLAGS> <LINK_LIBRARIES> /link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
-    "${_CMAKE_VS_LINK_DLL}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -LD <LINK_FLAGS> <LINK_LIBRARIES> -link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
+    "${_CMAKE_VS_LINK_DLL}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} -LD <LINK_FLAGS> <LINK_LIBRARIES> -link /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
   if (NOT "${lang}" STREQUAL "Fortran" OR CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL 2022.1)
     # The Fortran driver does not support -fuse-ld=llvm-lib before compiler version 2022.1
     set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
-      "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o <TARGET> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+      "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO}${_PLATFORM_ARCHIVE_FLAGS} <OBJECTS> ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o <TARGET> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
   endif()
 
   set(CMAKE_DEPFILE_FLAGS_${lang} "-QMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 6dce85b..48c7b49 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -26,14 +26,6 @@
   set(CMAKE_CL_NOLOGO "/nologo")
 endif()
 
-if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE")
-  set(_PLATFORM_LINK_FLAGS " /subsystem:windowsce")
-elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver")
-  set(_PLATFORM_LINK_FLAGS " -subsystem:native -kernel -MANIFEST:NO")
-else()
-  set(_PLATFORM_LINK_FLAGS "")
-endif()
-
 set(CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS 1)
 if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
   set (CMAKE_NO_BUILD_TYPE 1)
@@ -284,35 +276,42 @@
 
 set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 
+cmake_policy(GET CMP0197 CMAKE_MSVC_CMP0197)
+if(CMAKE_MSVC_CMP0197 STREQUAL "NEW")
+  set(_machine "-machine")
+else()
+  set(_machine "/machine")
+endif()
+
 # executable linker flags
 set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
 # set the machine type
 if(MSVC_C_ARCHITECTURE_ID)
   if(MSVC_C_ARCHITECTURE_ID MATCHES "^ARMV.I")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:THUMB")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:THUMB")
   elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:ARM64")
   elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64EC")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:ARM64EC")
   elseif(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:ARM")
   else()
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:${MSVC_C_ARCHITECTURE_ID}")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:${MSVC_C_ARCHITECTURE_ID}")
   endif()
 elseif(MSVC_CXX_ARCHITECTURE_ID)
   if(MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARMV.I")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:THUMB")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:THUMB")
   elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:ARM64")
   elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM64EC")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:ARM64EC")
   elseif(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM")
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:ARM")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:ARM")
   else()
-    set(_MACHINE_ARCH_FLAG "${_Wl}/machine:${MSVC_CXX_ARCHITECTURE_ID}")
+    set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:${MSVC_CXX_ARCHITECTURE_ID}")
   endif()
 elseif(MSVC_Fortran_ARCHITECTURE_ID)
-  set(_MACHINE_ARCH_FLAG "${_Wl}/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
+  set(_MACHINE_ARCH_FLAG "${_Wl}${_machine}:${MSVC_Fortran_ARCHITECTURE_ID}")
 endif()
 
 # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
@@ -327,7 +326,9 @@
 endif()
 
 foreach(t EXE SHARED MODULE)
-  string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
+  if(NOT CMAKE_MSVC_CMP0197 STREQUAL "NEW")
+    string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
+  endif()
   if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
     string(APPEND CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT " ${_Wl}/debug ${_Wl}/pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
     string(APPEND CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT " ${_Wl}/debug ${_Wl}/pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
@@ -340,12 +341,27 @@
   string(APPEND CMAKE_${t}_LINKER_FLAGS_RELEASE_INIT " ${_Wl}/INCREMENTAL:NO")
 endforeach()
 
+set(_PLATFORM_LINK_FLAGS "")
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE")
+  string(APPEND _PLATFORM_LINK_FLAGS " /subsystem:windowsce")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver")
+  string(APPEND _PLATFORM_LINK_FLAGS " -subsystem:native -kernel -MANIFEST:NO")
+endif()
+if(CMAKE_MSVC_CMP0197 STREQUAL "NEW")
+  string(APPEND _PLATFORM_LINK_FLAGS " ${_MACHINE_ARCH_FLAG}")
+endif()
+
+set(_PLATFORM_ARCHIVE_FLAGS "")
 if((_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM64EC") OR (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC"))
-  string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_Wl}/machine:ARM64X")
+  set(_MACHINE_ARCH_FLAG " ${_Wl}${_machine}:ARM64X")
+endif()
+if(CMAKE_MSVC_CMP0197 STREQUAL "NEW")
+  string(APPEND _PLATFORM_ARCHIVE_FLAGS " ${_MACHINE_ARCH_FLAG}")
 else()
   string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
 endif()
 unset(_MACHINE_ARCH_FLAG)
+unset(_machine)
 
 cmake_policy(GET CMP0091 __WINDOWS_MSVC_CMP0091)
 if(__WINDOWS_MSVC_CMP0091 STREQUAL "NEW")
@@ -377,6 +393,7 @@
     set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --msvc-ver=${MSVC_VERSION} --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ")
     set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --msvc-ver=${MSVC_VERSION} --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ")
   endif()
+  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "")
   if(CMAKE_SYSTEM_NAME STREQUAL "WindowsKernelModeDriver")
     set(_DLL_DRIVER "-driver")
   else()
@@ -387,7 +404,7 @@
   unset(_DLL_DRIVER)
 
   set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
-  set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+  set(CMAKE_${lang}_CREATE_STATIC_LIBRARY  "<CMAKE_AR> ${CMAKE_CL_NOLOGO}${_PLATFORM_ARCHIVE_FLAGS} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
 
   set(CMAKE_${lang}_COMPILE_OBJECT
     "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <DEFINES> <INCLUDES> <FLAGS> /Fo<OBJECT> /Fd<TARGET_COMPILE_PDB>${_FS_${lang}} -c <SOURCE>${CMAKE_END_TEMP_FILE}")
@@ -396,9 +413,10 @@
   set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
     "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <DEFINES> <INCLUDES> <FLAGS> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
 
+  set(CMAKE_${lang}_LINK_DEF_FILE_FLAG "/DEF:")
   set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
   set(CMAKE_${lang}_LINK_EXECUTABLE
-    "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+    "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
 
   if(CMAKE_SYSTEM_NAME STREQUAL "WindowsCE")
     set(CMAKE_${lang}_CREATE_WIN32_EXE "/entry:WinMainCRTStartup")
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
index 224aa8e..cc6b687 100644
--- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
@@ -10,8 +10,6 @@
 foreach(lib ${CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES})
   string(APPEND __IMPLICIT_LINKS " \"${lib}\"")
 endforeach()
-set(CMAKE_CUDA_LINK_EXECUTABLE
-   "<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_LIBRARIES>${__IMPLICIT_LINKS}")
 
 set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ")
 set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --rc=<CMAKE_RC_COMPILER> --mt=<CMAKE_MT> --manifests <MANIFESTS> -- ")
@@ -19,7 +17,7 @@
   "${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICIT_LINKS} ${CMAKE_END_TEMP_FILE}")
 
 set(CMAKE_CUDA_CREATE_SHARED_MODULE ${CMAKE_CUDA_CREATE_SHARED_LIBRARY})
-set(CMAKE_CUDA_CREATE_STATIC_LIBRARY  "<CMAKE_AR> ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+set(CMAKE_CUDA_CREATE_STATIC_LIBRARY  "<CMAKE_AR> ${CMAKE_CL_NOLOGO}${_PLATFORM_ARCHIVE_FLAGS} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
 set(CMAKE_CUDA_LINKER_SUPPORTS_PDB ON)
 set(CMAKE_CUDA_LINK_EXECUTABLE
   "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${__IMPLICIT_LINKS} ${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/Platform/Windows-PGI.cmake b/Modules/Platform/Windows-PGI.cmake
index ae68eba..e117f23 100644
--- a/Modules/Platform/Windows-PGI.cmake
+++ b/Modules/Platform/Windows-PGI.cmake
@@ -37,11 +37,13 @@
 endif()
 
 macro(__windows_compiler_pgi lang)
+  set(CMAKE_${lang}_LINK_DEF_FILE_FLAG "-def:")
+
   # Shared library compile and link rules.
   set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
   set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} -Mmakedll -implib:<TARGET_IMPLIB> -Xlinker -pdb:<TARGET_PDB> -Xlinker -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
   set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
-  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} -implib:<TARGET_IMPLIB> -Xlinker -pdb:<TARGET_PDB> -Xlinker -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+  set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} -implib:<TARGET_IMPLIB> -Xlinker -pdb:<TARGET_PDB> -Xlinker -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
 
   if("${lang}" MATCHES "C|CXX")
     set(CMAKE_${lang}_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index c823423..511ed2e 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -25,7 +25,7 @@
     "<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /object:<OBJECT> <FLAGS> /compile_only <SOURCE>${CMAKE_END_TEMP_FILE}")
 
 set(CMAKE_Fortran_LINK_EXECUTABLE
-    "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /exe:<TARGET> <OBJECTS> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+    "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /exe:<TARGET> <OBJECTS> /link <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
 
 set(CMAKE_Fortran_CREATE_WIN32_EXE /winapp)
 set(CMAKE_Fortran_CREATE_CONSOLE_EXE )
diff --git a/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake b/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake
index eb43935..9ba33d0 100644
--- a/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake
+++ b/Modules/Platform/WindowsKernelModeDriver-Initialize.cmake
@@ -1,7 +1 @@
-# undocumented, do not use outside of CMake
-cmake_language(GET_EXPERIMENTAL_FEATURE_ENABLED "WindowsKernelModeDriver" _cmake_windows_kernel_mode_driver_enabled)
-if(NOT _cmake_windows_kernel_mode_driver_enabled)
-  message(FATAL_ERROR "Windows kernel-mode driver experimental support is not enabled.")
-endif()
-
 set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY)
diff --git a/Modules/Platform/eCos.cmake b/Modules/Platform/eCos.cmake
index d6407d0..7021dde 100644
--- a/Modules/Platform/eCos.cmake
+++ b/Modules/Platform/eCos.cmake
@@ -52,8 +52,8 @@
 add_definitions(-D__ECOS__=1 -D__ECOS=1)
 
 # special link commands for eCos executables
-set(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
-set(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
+set(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
+set(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
 
 # eCos doesn't support shared libs
 set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
diff --git a/Modules/Platform/gas.cmake b/Modules/Platform/gas.cmake
index 12060f7..c7fdcf8 100644
--- a/Modules/Platform/gas.cmake
+++ b/Modules/Platform/gas.cmake
@@ -11,7 +11,7 @@
       "<CMAKE_RANLIB> <TARGET> ")
 
 set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
-    "<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    "<CMAKE_LINKER> <FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 
 # to be done
 set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
diff --git a/Modules/Platform/kFreeBSD-Initialize.cmake b/Modules/Platform/kFreeBSD-Initialize.cmake
deleted file mode 100644
index f5d7b0a..0000000
--- a/Modules/Platform/kFreeBSD-Initialize.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-# kFreeBSD is a Debian GNU distribution with a kernel from FreeBSD,
-# and should be marked as LINUX
-include(Platform/Linux-Initialize)
-
-set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-kfreebsd-gnu[a-z0-9_]*")
diff --git a/Modules/Platform/kFreeBSD.cmake b/Modules/Platform/kFreeBSD.cmake
deleted file mode 100644
index 171c1ac..0000000
--- a/Modules/Platform/kFreeBSD.cmake
+++ /dev/null
@@ -1,2 +0,0 @@
-# kFreeBSD is a Debian GNU distribution with a kernel from FreeBSD.
-include(Platform/Linux)
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 13d708f..260b663 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -5,49 +5,70 @@
 ProcessorCount
 --------------
 
-ProcessorCount(var)
+This module provides a command to determine the number of processors/cores.
 
-Determine the number of processors/cores and save value in ${var}
-
-Sets the variable named ${var} to the number of physical cores
-available on the machine if the information can be determined.
-Otherwise it is set to 0.  Currently this functionality is implemented
-for AIX, cygwin, FreeBSD, HPUX, Linux, macOS, QNX, Sun and
-Windows.
-
-.. versionchanged:: 3.15
-  On Linux, returns the container CPU count instead of the host CPU count.
-
-This function is guaranteed to return a positive integer (>=1) if it
-succeeds.  It returns 0 if there's a problem determining the processor
-count.
-
-More generally accurate physical CPU count can be obtained via
-:command:`cmake_host_system_information`:
+Load this module in CMake with:
 
 .. code-block:: cmake
 
-  cmake_host_system_information(RESULT N
-                                QUERY NUMBER_OF_PHYSICAL_CORES)
+  include(ProcessorCount)
 
-Example use, in a ctest -S dashboard script:
+Commands
+^^^^^^^^
+
+This module provides the following command:
+
+.. command:: ProcessorCount
+
+  Determines the number of logical CPU cores available on the machine:
+
+  .. code-block:: cmake
+
+    ProcessorCount(<variable>)
+
+  This command sets a variable named ``<variable>`` to the number of logical
+  CPU cores available on the machine, if the information can be determined.
+  If successful, the variable is guaranteed to be set to a positive integer
+  (>=1).  If the processor count cannot be determined, it is set to 0.
+
+  Currently, this functionality is implemented for AIX, Cygwin, FreeBSD, Haiku,
+  HPUX, Linux, macOS, QNX, Sun and Windows.
+
+  This command provides an approximation of the number of compute cores
+  available on the current machine, making it useful for parallel building and
+  testing.  It is meant to help utilize as much of the machine as seems
+  reasonable, though users should consider other workloads running on the
+  machine before using its full capacity for parallel tasks.
+
+  .. versionchanged:: 3.15
+    On Linux, returns the container CPU count instead of the host CPU count.
+
+.. note::
+
+  This module relies on system-dependent commands to determine the number of
+  processors, which may not always provide accurate information in certain
+  environments.  A more generally accurate logical CPU count can be also
+  obtained with the :command:`cmake_host_system_information`:
+
+  .. code-block:: cmake
+
+    cmake_host_system_information(RESULT n QUERY NUMBER_OF_LOGICAL_CORES)
+
+Examples
+^^^^^^^^
+
+In the following example this module is used in a :option:`ctest -S`
+dashboard script to determine number of cores to use for a parallel
+:ref:`CTest Build Step`:
 
 .. code-block:: cmake
 
-   include(ProcessorCount)
-   ProcessorCount(N)
-   if(NOT N EQUAL 0)
-     set(CTEST_BUILD_FLAGS -j${N})
-     set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
-   endif()
-
-This function is intended to offer an approximation of the value of
-the number of compute cores available on the current machine, such
-that you may use that value for parallel building and parallel
-testing.  It is meant to help utilize as much of the machine as seems
-reasonable.  Of course, knowledge of what else might be running on the
-machine simultaneously should be used when deciding whether to request
-a machine's full capacity all for yourself.
+  include(ProcessorCount)
+  ProcessorCount(n)
+  if(NOT n EQUAL 0)
+    set(CTEST_BUILD_FLAGS -j${n})
+    set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${n})
+  endif()
 #]=======================================================================]
 
 # A more reliable way might be to compile a small C program that uses the CPUID
@@ -219,6 +240,7 @@
   if(NOT count)
     # Haiku
     find_program(ProcessorCount_cmd_sysinfo sysinfo)
+    mark_as_advanced(ProcessorCount_cmd_sysinfo)
     if(ProcessorCount_cmd_sysinfo)
       execute_process(COMMAND ${ProcessorCount_cmd_sysinfo}
         ERROR_QUIET
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index eee413b..8f44b97 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -141,7 +141,7 @@
 
 macro (QT4_GENERATE_MOC infile outfile )
   # get include dirs and flags
-  QT4_GET_MOC_FLAGS(moc_flags)
+  qt4_get_moc_flags(moc_flags)
   get_filename_component(abs_infile ${infile} ABSOLUTE)
   set(_outfile "${outfile}")
   if(NOT IS_ABSOLUTE "${outfile}")
@@ -151,23 +151,22 @@
   if (${ARGC} GREATER 3 AND "x${ARGV2}" STREQUAL "xTARGET")
     set(moc_target ${ARGV3})
   endif()
-  QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
+  qt4_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
   set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE)  # don't run automoc on this file
   set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE)  # don't run autouic on this file
 endmacro ()
 
 
-# QT4_WRAP_CPP(outfiles inputfile ... )
-
+# qt4_wrap_cpp(outfiles inputfile ... )
 macro (QT4_WRAP_CPP outfiles )
   # get include dirs
-  QT4_GET_MOC_FLAGS(moc_flags)
-  QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN})
+  qt4_get_moc_flags(moc_flags)
+  qt4_extract_options(moc_files moc_options moc_target ${ARGN})
 
   foreach (it ${moc_files})
     get_filename_component(it ${it} ABSOLUTE)
-    QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
-    QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
+    qt4_make_output_file(${it} moc_ cxx outfile)
+    qt4_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
     set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOMOC TRUE)  # don't run automoc on this file
     set_property(SOURCE ${outfile} PROPERTY SKIP_AUTOUIC TRUE)  # don't run autouic on this file
     set(${outfiles} ${${outfiles}} ${outfile})
@@ -176,10 +175,9 @@
 endmacro ()
 
 
-# QT4_WRAP_UI(outfiles inputfile ... )
-
+# qt4_wrap_ui(outfiles inputfile ... )
 macro (QT4_WRAP_UI outfiles )
-  QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
+  qt4_extract_options(ui_files ui_options ui_target ${ARGN})
 
   foreach (it ${ui_files})
     get_filename_component(outfile ${it} NAME_WE)
@@ -197,10 +195,9 @@
 endmacro ()
 
 
-# QT4_ADD_RESOURCES(outfiles inputfile ... )
-
+# qt4_add_resources(outfiles inputfile ... )
 macro (QT4_ADD_RESOURCES outfiles )
-  QT4_EXTRACT_OPTIONS(rcc_files rcc_options rcc_target ${ARGN})
+  qt4_extract_options(rcc_files rcc_options rcc_target ${ARGN})
 
   foreach (it ${rcc_files})
     get_filename_component(outfilename ${it} NAME_WE)
@@ -226,7 +223,7 @@
       # Since this cmake macro is doing the dependency scanning for these files,
       # let's make a configured file and add it as a dependency so cmake is run
       # again when dependencies need to be recomputed.
-      QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
+      qt4_make_output_file("${infile}" "" "qrc.depends" out_depends)
       configure_file("${infile}" "${out_depends}" COPYONLY)
     else()
       # The .qrc file does not exist (yet). Let's add a dependency and hope
@@ -277,10 +274,10 @@
   set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE)  # don't run automoc on this file
   set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE)  # don't run autouic on this file
 
-  QT4_GENERATE_MOC("${_header}" "${_moc}")
+  qt4_generate_moc("${_header}" "${_moc}")
 
   list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
-  MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
+  set_property(SOURCE "${_impl}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
 
 endmacro()
 
@@ -292,13 +289,13 @@
     # get the part before the ".xml" suffix
     string(TOLOWER ${_basename} _basename)
     string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
-    QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
+    qt4_add_dbus_interface(${_sources} ${_infile} ${_basename}interface)
   endforeach ()
 endmacro()
 
 
 macro(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
-  QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options _qt4_dbus_target ${ARGN})
+  qt4_extract_options(_customName _qt4_dbus_options _qt4_dbus_target ${ARGN})
 
   get_filename_component(_in_file ${_header} ABSOLUTE)
   get_filename_component(_basename ${_header} NAME_WE)
@@ -358,10 +355,10 @@
      )
   endif()
 
-  QT4_GENERATE_MOC("${_header}" "${_moc}")
+  qt4_generate_moc("${_header}" "${_moc}")
   set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOMOC TRUE)  # don't run automoc on this file
   set_property(SOURCE ${_impl} PROPERTY SKIP_AUTOUIC TRUE)  # don't run autouic on this file
-  MACRO_ADD_FILE_DEPENDENCIES("${_impl}" "${_moc}")
+  set_property(SOURCE "${_impl}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
 
   list(APPEND ${_sources} "${_impl}" "${_header}" "${_moc}")
 endmacro()
@@ -371,7 +368,7 @@
   if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
     message(DEPRECATION "The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.")
   endif()
-  QT4_GET_MOC_FLAGS(_moc_INCS)
+  qt4_get_moc_flags(_moc_INCS)
 
   set(_matching_FILES )
   foreach (_current_FILE ${ARGN})
@@ -404,8 +401,8 @@
             set(_header ${_abs_PATH}/${_basename}.h)
           endif()
           set(_moc    ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
-          QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "" "")
-          MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+          qt4_create_moc_command(${_header} ${_moc} "${_moc_INCS}" "" "")
+          set_property(SOURCE "${_abs_FILE}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
         endforeach ()
       endif()
     endif ()
@@ -414,7 +411,7 @@
 
 
 macro(QT4_CREATE_TRANSLATION _qm_files)
-  QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options _lupdate_target ${ARGN})
+  qt4_extract_options(_lupdate_files _lupdate_options _lupdate_target ${ARGN})
   set(_my_sources)
   set(_my_dirs)
   set(_my_tsfiles)
@@ -456,7 +453,7 @@
         ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
         DEPENDS ${_my_sources} ${_ts_pro} VERBATIM)
   endforeach()
-  QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
+  qt4_add_translation(${_qm_files} ${_my_tsfiles})
 endmacro()
 
 
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index 7227367..e26c908 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -5,35 +5,140 @@
 SelectLibraryConfigurations
 ---------------------------
 
+This module is intended for use in :ref:`Find Modules` and provides a
+command to automatically set library variables when package is available
+with multiple :ref:`Build Configurations`.
+
+Load it in a CMake find module with:
+
 .. code-block:: cmake
 
-  select_library_configurations(basename)
+  include(SelectLibraryConfigurations)
 
-This macro takes a library base name as an argument, and will choose
-good values for the variables
+Supported build configurations are ``Release`` and ``Debug`` as these are
+the most common ones in such packages.
 
-::
+.. note::
 
-  basename_LIBRARY
-  basename_LIBRARIES
-  basename_LIBRARY_DEBUG
-  basename_LIBRARY_RELEASE
+  This module has been available since early versions of CMake, when the
+  ``<PackageName>_LIBRARIES`` result variable was used for linking found
+  packages.  When writing standard find modules, :ref:`Imported Targets` should
+  be preferred.  In addition to or as an alternative to this module, imported
+  targets provide finer control over linking through the
+  :prop_tgt:`IMPORTED_CONFIGURATIONS` property.
 
-depending on what has been found and set.
+Commands
+^^^^^^^^
 
-If only ``basename_LIBRARY_RELEASE`` is defined, ``basename_LIBRARY`` will
-be set to the release value, and ``basename_LIBRARY_DEBUG`` will be set
-to ``basename_LIBRARY_DEBUG-NOTFOUND``.  If only ``basename_LIBRARY_DEBUG``
-is defined, then ``basename_LIBRARY`` will take the debug value, and
-``basename_LIBRARY_RELEASE`` will be set to ``basename_LIBRARY_RELEASE-NOTFOUND``.
+This module provides the following command:
 
-If the generator supports configuration types, then ``basename_LIBRARY``
-and ``basename_LIBRARIES`` will be set with debug and optimized flags
-specifying the library to be used for the given configuration.  If no
-build type has been set or the generator in use does not support
-configuration types, then ``basename_LIBRARY`` and ``basename_LIBRARIES``
-will take only the release value, or the debug value if the release one
-is not set.
+.. command:: select_library_configurations
+
+  Sets and adjusts library variables based on debug and release build
+  configurations:
+
+  .. code-block:: cmake
+
+    select_library_configurations(<basename>)
+
+  This command is a helper for setting the ``<basename>_LIBRARY`` and
+  ``<basename>_LIBRARIES`` result variables when a library might be provided
+  with multiple build configurations.
+
+  The argument is:
+
+  ``<basename>``
+    The base name of the library, used as a prefix for variable names.  This is
+    the name of the package as used in the ``Find<PackageName>.cmake`` module
+    filename, or the component name, when find module provides them.
+
+  Prior to calling this command the following cache variables should be set
+  in the find module (for example, by the :command:`find_library` command):
+
+  ``<basename>_LIBRARY_RELEASE``
+    A cache variable storing the full path to the ``Release`` build of the
+    library.  If not set or found, this command will set its value to
+    ``<basename>_LIBRARY_RELEASE-NOTFOUND``.
+
+  ``<basename>_LIBRARY_DEBUG``
+    A cache variable storing the full path to the ``Debug`` build of the
+    library.  If not set or found, this command will set its value to
+    ``<basename>_LIBRARY_DEBUG-NOTFOUND``.
+
+  This command then sets the following local result variables:
+
+  ``<basename>_LIBRARY``
+    A result variable that is set to the value of
+    ``<basename>_LIBRARY_RELEASE`` variable if found, otherwise it is set to the
+    value of ``<basename>_LIBRARY_DEBUG`` variable if found.  If both are found,
+    the release library value takes precedence. If both are not found, it is set
+    to value ``<basename>_LIBRARY-NOTFOUND``.
+
+    If the :manual:`CMake Generator <cmake-generators(7)>` in use supports
+    build configurations, then this variable will be a list of found libraries
+    each prepended with the ``optimized`` or ``debug`` keywords specifying which
+    library should be linked for the given configuration.  These keywords are
+    used by the :command:`target_link_libraries` command.  If a build
+    configuration has not been set or the generator in use does not support
+    build configurations, then this variable value will not contain these
+    keywords.
+
+  ``<basename>_LIBRARIES``
+    A result variable that is set to the same value as the
+    ``<basename>_LIBRARY`` variable.
+
+  .. note::
+
+    The ``select_library_configurations()`` command should be called before
+    handling standard find module arguments with
+    :command:`find_package_handle_standard_args` to ensure that the
+    ``<PackageName>_FOUND`` result variable is correctly set based on
+    ``<basename>_LIBRARY`` or other related variables.
+
+Examples
+^^^^^^^^
+
+Setting library variables based on the build configuration inside a find module
+file:
+
+.. code-block:: cmake
+  :caption: ``FindFoo.cmake``
+
+  # Find release and debug build of the library
+  find_library(Foo_LIBRARY_RELEASE ...)
+  find_library(Foo_LIBRARY_DEBUG ...)
+
+  # Set Foo_LIBRARY and Foo_LIBRARIES result variables
+  include(SelectLibraryConfigurations)
+  select_library_configurations(Foo)
+
+  # Set Foo_FOUND variable and print result message.
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(
+    Foo
+    REQUIRED_VARS Foo_LIBRARY ...
+  )
+
+When find module provides components with multiple build configurations:
+
+.. code-block:: cmake
+  :caption: ``FindFoo.cmake``
+
+  include(SelectLibraryConfigurations)
+  foreach(component IN LISTS Foo_FIND_COMPONENTS)
+    # ...
+    select_library_configurations(Foo_${component})
+    # ...
+  endforeach()
+
+A project can then use this find module as follows:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  find_package(Foo)
+  target_link_libraries(project_target PRIVATE ${Foo_LIBRARIES})
+  # ...
 #]=======================================================================]
 
 # This macro was adapted from the FindQt4 CMake module and is maintained by Will
diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake
index 784939e..c4b45dc 100644
--- a/Modules/SquishTestScript.cmake
+++ b/Modules/SquishTestScript.cmake
@@ -6,13 +6,12 @@
 ----------------
 .. deprecated:: 3.0
 
-This script launches a GUI test using Squish.  You should not call the
-script directly; instead, you should access it via the SQUISH_ADD_TEST
-macro that is defined in FindSquish.cmake.
+.. note::
 
-This script starts the Squish server, launches the test on the client,
-and finally stops the squish server.  If any of these steps fail
-(including if the tests do not pass) then a fatal error is raised.
+  This module is not intended to be included directly in a CMake project.  It is
+  an internal CMake test script used to launch GUI tests with Squish.  For usage
+  details, refer to the :command:`squish_add_test` command documentation in the
+  ``FindSquish`` module.
 #]=======================================================================]
 
 # print out the variable that we are using
diff --git a/Modules/SystemInformation.in b/Modules/SystemInformation.in
index 50b5720..8d4b046 100644
--- a/Modules/SystemInformation.in
+++ b/Modules/SystemInformation.in
@@ -18,8 +18,14 @@
 CMAKE_SYSTEM_INFO_FILE == "${CMAKE_SYSTEM_INFO_FILE}"
 CMAKE_SYSTEM_NAME == "${CMAKE_SYSTEM_NAME}"
 CMAKE_SYSTEM == "${CMAKE_SYSTEM}"
-CMAKE_CXX_COMPILER == "${CMAKE_CXX_COMPILER}"
 CMAKE_C_COMPILER == "${CMAKE_C_COMPILER}"
+CMAKE_C_COMPILER_ID == "${CMAKE_C_COMPILER_ID}"
+CMAKE_C_COMPILER_VERSION == "${CMAKE_C_COMPILER_VERSION}"
+CMAKE_C_COMPILER_ARCHITECTURE_ID == "${CMAKE_C_COMPILER_ARCHITECTURE_ID}"
+CMAKE_CXX_COMPILER == "${CMAKE_CXX_COMPILER}"
+CMAKE_CXX_COMPILER_ID == "${CMAKE_CXX_COMPILER_ID}"
+CMAKE_CXX_COMPILER_VERSION == "${CMAKE_CXX_COMPILER_VERSION}"
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID == "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}"
 CMAKE_COMPILER_IS_GNUCC == "${CMAKE_COMPILER_IS_GNUCC}"
 CMAKE_COMPILER_IS_GNUCXX == "${CMAKE_COMPILER_IS_GNUCXX}"
 
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 239db61..a39f8b3 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -7,18 +7,49 @@
 
 .. deprecated:: 3.0
 
-  See :module:`CheckCXXCompilerFlag`.
+  This module should no longer be used.  It has been superseded by the
+  :module:`CheckCXXCompilerFlag` module.  As of CMake 3.19, the
+  :module:`CheckCompilerFlag` module is also available for checking flags across
+  multiple languages.
 
-Check if the CXX compiler accepts a flag.
+This module provides a macro to test whether the C++ (CXX) compiler supports
+specific flags.
+
+Macros
+^^^^^^
+
+.. command:: check_cxx_accepts_flag
+
+  Checks whether the CXX compiler accepts the specified flags:
+
+  .. code-block:: cmake
+
+    check_cxx_accepts_flag(<flags> <result-variable>)
+
+  ``<flags>``
+    One or more compiler flags to test.  For multiple flags, provide them as a
+    space-separated string.
+
+  ``<result-variable>``
+    Name of an internal cache variable that stores the result.  It is set to
+    boolean true if the compiler accepts the flags and false otherwise.
+
+Examples
+^^^^^^^^
+
+Checking if the C++ compiler supports specific flags:
 
 .. code-block:: cmake
 
- CHECK_CXX_ACCEPTS_FLAG(<flags> <variable>)
+  include(TestCXXAcceptsFlag)
+  check_cxx_accepts_flag("-fno-common -fstack-clash-protection" HAVE_FLAGS)
 
-``<flags>``
- the flags to try
-``<variable>``
- variable to store the result
+Migrating to the :module:`CheckCompilerFlag` module:
+
+.. code-block:: cmake
+
+  include(CheckCompilerFlag)
+  check_compiler_flag(CXX "-fno-common;-fstack-clash-protection" HAVE_FLAGS)
 #]=======================================================================]
 
 macro(CHECK_CXX_ACCEPTS_FLAG FLAGS  VARIABLE)
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index 1224a21..24672c3 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -5,14 +5,61 @@
 TestForANSIForScope
 -------------------
 
-Check for ANSI for scope support
+This module checks whether the ``CXX`` compiler restricts the scope of variables
+declared in a for-init-statement to the loop body.
 
-Check if the compiler restricts the scope of variables declared in a
-for-init-statement to the loop body.
+Load this module in a CMake project with:
 
-::
+.. code-block:: cmake
 
-  CMAKE_NO_ANSI_FOR_SCOPE - holds result
+  include(TestForANSIForScope)
+
+In early C++ (pre-C++98), variables declared in ``for(<init-statement> ...)``
+could remain accessible outside the loop after its body (``for() { <body> }``).
+
+This module defines the following cache variable:
+
+``CMAKE_NO_ANSI_FOR_SCOPE``
+  A cache variable containing the result of the check.  It will be set to value
+  ``0`` if the for-init-statement has restricted scope (``C++ 98`` and newer),
+  and to value ``1`` if not (``ANSI C++``).
+
+.. note::
+
+  As of the ``C++ 98`` standard, variables declared in a for-init-statement are
+  restricted to the loop body, making this behavior obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module will check the ``for()`` loop scope behavior and define
+the ``CMAKE_NO_ANSI_FOR_SCOPE`` cache variable:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(TestForANSIForScope)
+  file(
+    CONFIGURE
+    OUTPUT config.h
+    CONTENT "#cmakedefine CMAKE_NO_ANSI_FOR_SCOPE"
+  )
+
+which can be then used in a C++ program:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include "config.h"
+
+  #ifdef CMAKE_NO_ANSI_FOR_SCOPE
+  #  define for if(false) {} else for
+  #endif
+
+See Also
+^^^^^^^^
+
+* The :module:`CMakeBackwardCompatibilityCXX` module.
 #]=======================================================================]
 
 if(NOT DEFINED CMAKE_ANSI_FOR_SCOPE)
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index d156991..6db6a1d 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -5,14 +5,66 @@
 TestForANSIStreamHeaders
 ------------------------
 
-Test for compiler support of ANSI stream headers iostream, etc.
+This module checks whether the ``CXX`` compiler supports standard library
+headers without the ``.h`` extension (e.g. ``<iostream>``).
 
-check if the compiler supports the standard ANSI iostream header
-(without the .h)
+Load this module in a CMake project with:
 
-::
+.. code-block:: cmake
 
-  CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
+  include(TestForANSIStreamHeaders)
+
+Early versions of C++ (pre-C++98) didn't support including standard headers
+without extensions.
+
+This module defines the following cache variable:
+
+``CMAKE_NO_ANSI_STREAM_HEADERS``
+  A cache variable containing the result of the check.  It will be set to value
+  ``0`` if the standard headers can be included without the ``.h`` extension
+  (``C++ 98`` and newer), and to value ``1`` if ``.h`` is required
+  (``ANSI C++``).
+
+.. note::
+
+  The C++ standard headers without extensions got formally introduced in the
+  ``C++ 98`` standard, making this issue obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module will check how the C++ standard headers can be included
+and define the ``CMAKE_NO_ANSI_STREAM_HEADERS`` cache variable:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(TestForANSIStreamHeaders)
+  file(
+    CONFIGURE
+    OUTPUT config.h
+    CONTENT "#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS"
+  )
+
+C++ program can then include the available header conditionally:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include "config.h"
+
+  #ifdef CMAKE_NO_ANSI_STREAM_HEADERS
+  #  include <iostream.h>
+  #else
+  #  include <iostream>
+  #endif
+
+  int main() { ... }
+
+See Also
+^^^^^^^^
+
+* The :module:`CMakeBackwardCompatibilityCXX` module.
 #]=======================================================================]
 
 include(${CMAKE_CURRENT_LIST_DIR}/CheckIncludeFileCXX.cmake)
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index 40fb373..eddc8b6 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -5,13 +5,67 @@
 TestForSSTREAM
 --------------
 
-Test for compiler support of ANSI sstream header
+This module checks whether the C++ standard header ``<sstream>`` exists and
+functions correctly.
 
-check if the compiler supports the standard ANSI sstream header
+Load this module in a CMake project with:
 
-::
+.. code-block:: cmake
 
-  CMAKE_NO_ANSI_STRING_STREAM - defined by the results
+  include(TestForSSTREAM)
+
+In early versions of C++ (pre-C++98), the ``<sstream>`` header was not
+formally standardized and may not have been available.
+
+This module defines the following cache variables:
+
+``CMAKE_NO_ANSI_STRING_STREAM``
+  A cache variable indicating whether the ``<sstream>`` header is available. It
+  will be set to value ``0`` if ``<sstream>`` is available (``C++ 98`` and
+  newer), and to value ``1`` if ``<sstream>`` is missing (``ANSI C++``).
+
+``CMAKE_HAS_ANSI_STRING_STREAM``
+  A cache variable that is the opposite of ``CMAKE_NO_ANSI_STRING_STREAM``
+  (true if ``<sstream>`` is available and false if ``<sstream>`` is missing).
+
+.. note::
+
+  The ``<sstream>`` header was formally introduced in the ``C++ 98`` standard,
+  making this check obsolete for modern compilers.
+
+Examples
+^^^^^^^^
+
+Including this module will check for ``<sstream>`` support and define the
+``CMAKE_NO_ANSI_STRING_STREAM`` cache variable:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(TestForSSTREAM)
+  file(
+    CONFIGURE
+    OUTPUT config.h
+    CONTENT "#cmakedefine CMAKE_NO_ANSI_STRING_STREAM"
+  )
+
+Then it can be used in a C++ program:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include "config.h"
+
+  #ifndef CMAKE_NO_ANSI_STRING_STREAM
+  #  include <sstream>
+  #endif
+
+  int main() { ... }
+
+See Also
+^^^^^^^^
+
+* The :module:`CMakeBackwardCompatibilityCXX` module.
 #]=======================================================================]
 
 if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM)
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index e565e5c..ed064da 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -5,13 +5,63 @@
 TestForSTDNamespace
 -------------------
 
-Test for std:: namespace support
+This module checks whether the ``CXX`` compiler supports the ``std`` namespace
+for the C++ Standard Library.
 
-check if the compiler supports std:: on stl classes
+Load this module in a CMake project with:
 
-::
+.. code-block:: cmake
 
-  CMAKE_NO_STD_NAMESPACE - defined by the results
+  include(TestForSTDNamespace)
+
+Early versions of C++ (pre-C++98) did not have a requirement for a dedicated
+namespace of C++ Standard Template Library (STL) components (e.g. ``list``,
+etc.) and other parts of the C++ Standard Library (such as I/O streams
+``cout``, ``endl``, etc), so they were available globally.
+
+This module defines the following cache variable:
+
+``CMAKE_NO_STD_NAMESPACE``
+  A cache variable containing the result of the check.  It will be set to value
+  ``0`` if the ``std`` namespace is supported (``C++ 98`` and newer), and to
+  value ``1`` if not (``ANSI C++``).
+
+.. note::
+
+  The ``std`` namespace got formally introduced in ``C++ 98`` standard, making
+  this issue obsolete.
+
+Examples
+^^^^^^^^
+
+Including this module will check for the ``std`` namespace support and define
+the ``CMAKE_NO_STD_NAMESPACE`` cache variable:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(TestForSTDNamespace)
+  file(
+    CONFIGURE
+    OUTPUT config.h
+    CONTENT "#cmakedefine CMAKE_NO_STD_NAMESPACE"
+  )
+
+which can be then used in a C++ program to define the missing namespace:
+
+.. code-block:: c++
+  :caption: ``example.cxx``
+
+  #include "config.h"
+
+  #ifdef CMAKE_NO_STD_NAMESPACE
+  #  define std
+  #endif
+
+See Also
+^^^^^^^^
+
+* The :module:`CMakeBackwardCompatibilityCXX` module.
 #]=======================================================================]
 
 if(NOT DEFINED CMAKE_STD_NAMESPACE)
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index c217dcc..9c8811b 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -5,155 +5,240 @@
 UseEcos
 -------
 
-This module defines variables and macros required to build eCos application.
+This module defines variables and provides commands required to build an eCos
+application.
 
-This file contains the following macros:
+Load this module in CMake project with:
 
-``ECOS_ADD_INCLUDE_DIRECTORIES()``
-  add the eCos include dirs
-``ECOS_ADD_EXECUTABLE(name source1 ...  sourceN )``
-  create an eCos executable
-``ECOS_ADJUST_DIRECTORY(VAR source1 ...  sourceN )``
-  adjusts the path of the source files and puts the result into ``VAR``
+.. code-block:: cmake
 
-Macros for selecting the toolchain:
+  include(UseEcos)
 
-``ECOS_USE_ARM_ELF_TOOLS()``
-  enable the ARM ELF toolchain for the directory where it is called
-``ECOS_USE_I386_ELF_TOOLS()``
-  enable the i386 ELF toolchain for the directory where it is called
-``ECOS_USE_PPC_EABI_TOOLS()``
-  enable the PowerPC toolchain for the directory where it is called
+Commands
+^^^^^^^^
 
-It contains the following variables:
+This module provides the following commands:
 
-``ECOS_DEFINITIONS``
+Building an eCos Application
+""""""""""""""""""""""""""""
+
+.. command:: ecos_add_include_directories
+
+  Adds the eCos include directories for the current ``CMakeLists.txt`` file:
+
+  .. code-block:: cmake
+
+    ecos_add_include_directories()
+
+.. command:: ecos_adjust_directory
+
+  Adjusts the paths of given source files:
+
+  .. code-block:: cmake
+
+    ecos_adjust_directory(<var> <sources>...)
+
+  This command modifies the paths of the source files ``<sources>...`` to
+  make them suitable for use with ``ecos_add_executable()``, and stores them
+  in the variable ``<var>``.
+
+  ``<var>``
+    Result variable name holding a new list of source files with adjusted paths.
+  ``<sources>...``
+    A list of relative or absolute source files to adjust their paths.
+
+  Use this command when the actual sources are located one level upwards. A
+  ``../`` has to be prepended in front of every source file that is given as a
+  relative path.
+
+.. command:: ecos_add_executable
+
+  Creates an eCos application executable:
+
+  .. code-block:: cmake
+
+    ecos_add_executable(<name> <sources>...)
+
+  ``<name>``
+    The name of the executable.
+  ``<sources>...``
+    A list of all source files, where the path has been adjusted beforehand by
+    calling the ``ecos_adjust_directory()``.
+
+  This command also sets the ``ECOS_DEFINITIONS`` local variable, holding some
+  common compile definitions.
+
+Selecting the Toolchain
+"""""""""""""""""""""""
+
+.. command:: ecos_use_arm_elf_tools
+
+  Enables the ARM ELF toolchain for the directory where it is called:
+
+  .. code-block:: cmake
+
+    ecos_use_arm_elf_tools()
+
+  Use this command, when compiling for the xscale processor.
+
+.. command:: ecos_use_i386_elf_tools
+
+  Enables the i386 ELF toolchain for the directory where it is called:
+
+  .. code-block:: cmake
+
+    ecos_use_i386_elf_tools()
+
+.. command:: ecos_use_ppc_eabi_tools
+
+  Enables the PowerPC toolchain for the directory where it is called:
+
+  .. code-block:: cmake
+
+    ecos_use_ppc_eabi_tools()
+
+Variables
+^^^^^^^^^
+
+This module also defines the following variables:
 
 ``ECOSCONFIG_EXECUTABLE``
+  Cache variable that contains a path to the ``ecosconfig`` executable (the eCos
+  configuration program).
 
 ``ECOS_CONFIG_FILE``
-  defaults to ecos.ecc, if your eCos configuration file has a different name, adjust this variable for internal use only:
+  A local variable that defaults to ``ecos.ecc``.  If eCos configuration file
+  has a different name, adjust this variable before calling the
+  ``ecos_add_executable()``.
 
-::
+Examples
+^^^^^^^^
 
-  ECOS_ADD_TARGET_LIB
+The following example demonstrates defining an eCos executable target in a
+project that follows the common eCos convention of listing source files in
+a ``ProjectSources.txt`` file, located one directory above the current
+``CMakeLists.txt``:
+
+.. code-block:: cmake
+  :caption: ``CMakeLists.txt``
+
+  include(UseEcos)
+
+  # Add the eCos include directories.
+  ecos_add_include_directories()
+
+  # Include the file with the eCos sources list. This file, for example, defines
+  # a list of eCos sources:
+  #   set(sources file_1.cxx file_2.cxx file_3.cxx)
+  include(../ProjectSources.txt)
+
+  # When using such directory structure, relative source paths must be adjusted:
+  ecos_adjust_directory(adjusted_sources ${sources})
+
+  # Create eCos executable.
+  ecos_add_executable(ecos_app ${adjusted_sources})
 #]=======================================================================]
 
-# first check that ecosconfig is available
+# First check that ecosconfig is available.
 find_program(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
+mark_as_advanced(ECOSCONFIG_EXECUTABLE)
 if(NOT ECOSCONFIG_EXECUTABLE)
   message(SEND_ERROR "ecosconfig was not found. Either include it in the system path or set it manually using ccmake.")
 else()
   message(STATUS "Found ecosconfig: ${ECOSCONFIG_EXECUTABLE}")
 endif()
 
-# check that ECOS_REPOSITORY is set correctly
+# Check that ECOS_REPOSITORY is set correctly.
 if (NOT EXISTS $ENV{ECOS_REPOSITORY}/ecos.db)
   message(SEND_ERROR "The environment variable ECOS_REPOSITORY is not set correctly. Set it to the directory which contains the file ecos.db")
 else ()
   message(STATUS "ECOS_REPOSITORY is set to $ENV{ECOS_REPOSITORY}")
 endif ()
 
-# check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't work
+# Check that tclsh (coming with TCL) is available, otherwise ecosconfig doesn't
+# work.
 find_package(Tclsh)
-if (NOT TCL_TCLSH)
+if (NOT Tclsh_FOUND)
   message(SEND_ERROR "The TCL tclsh was not found. Please install TCL, it is required for building eCos applications.")
-else ()
-  message(STATUS "tlcsh found: ${TCL_TCLSH}")
 endif ()
 
-#add the global include-directories
-#usage: ECOS_ADD_INCLUDE_DIRECTORIES()
 macro(ECOS_ADD_INCLUDE_DIRECTORIES)
-#check for ProjectSources.txt one level higher
+  # Check for ProjectSources.txt one level higher.
   if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../ProjectSources.txt)
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)
   else ()
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
   endif ()
 
-#the ecos include directory
+  # The ecos include directory.
   include_directories(${CMAKE_CURRENT_BINARY_DIR}/ecos/install/include/)
-
 endmacro()
 
-
-#we want to compile for the xscale processor, in this case the following macro has to be called
-#usage: ECOS_USE_ARM_ELF_TOOLS()
 macro (ECOS_USE_ARM_ELF_TOOLS)
   set(CMAKE_CXX_COMPILER "arm-elf-c++")
   set(CMAKE_COMPILER_IS_GNUCXX 1)
   set(CMAKE_C_COMPILER "arm-elf-gcc")
   set(CMAKE_AR "arm-elf-ar")
   set(CMAKE_RANLIB "arm-elf-ranlib")
-#for linking
+  # For linking.
   set(ECOS_LD_MCPU "-mcpu=xscale")
-#for compiling
+  # For compiling.
   add_definitions(-mcpu=xscale -mapcs-frame)
-#for the obj-tools
+  # For the obj-tools.
   set(ECOS_ARCH_PREFIX "arm-elf-")
 endmacro ()
 
-#usage: ECOS_USE_PPC_EABI_TOOLS()
 macro (ECOS_USE_PPC_EABI_TOOLS)
   set(CMAKE_CXX_COMPILER "powerpc-eabi-c++")
   set(CMAKE_COMPILER_IS_GNUCXX 1)
   set(CMAKE_C_COMPILER "powerpc-eabi-gcc")
   set(CMAKE_AR "powerpc-eabi-ar")
   set(CMAKE_RANLIB "powerpc-eabi-ranlib")
-#for linking
+  # For linking.
   set(ECOS_LD_MCPU "")
-#for compiling
+  # For compiling.
   add_definitions()
-#for the obj-tools
+  # For the obj-tools.
   set(ECOS_ARCH_PREFIX "powerpc-eabi-")
 endmacro ()
 
-#usage: ECOS_USE_I386_ELF_TOOLS()
 macro (ECOS_USE_I386_ELF_TOOLS)
   set(CMAKE_CXX_COMPILER "i386-elf-c++")
   set(CMAKE_COMPILER_IS_GNUCXX 1)
   set(CMAKE_C_COMPILER "i386-elf-gcc")
   set(CMAKE_AR "i386-elf-ar")
   set(CMAKE_RANLIB "i386-elf-ranlib")
-#for linking
+  # For linking.
   set(ECOS_LD_MCPU "")
-#for compiling
+  # For compiling.
   add_definitions()
-#for the obj-tools
+  # For the obj-tools.
   set(ECOS_ARCH_PREFIX "i386-elf-")
 endmacro ()
 
-
-#since the actual sources are located one level upwards
-#a "../" has to be prepended in front of every source file
-#call the following macro to achieve this, the first parameter
-#is the name of the new list of source files with adjusted paths,
-#followed by all source files
-#usage: ECOS_ADJUST_DIRECTORY(adjusted_SRCS ${my_srcs})
 macro(ECOS_ADJUST_DIRECTORY _target_FILES )
   foreach (_current_FILE ${ARGN})
     get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
-      if (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
-        get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
-      endif ()
+    if (NOT ${_abs_FILE} STREQUAL ${_current_FILE})
+      get_filename_component(_abs_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../${_current_FILE} ABSOLUTE)
+    endif ()
     list(APPEND ${_target_FILES} ${_abs_FILE})
   endforeach ()
 endmacro()
 
-# the default ecos config file name
-# maybe in future also out-of-source builds may be possible
+# The default eCos config file name. Maybe in future also out-of-source builds
+# may be possible.
 set(ECOS_CONFIG_FILE ecos.ecc)
 
-#creates the dependency from all source files on the ecos target.ld,
-#adds the command for compiling ecos
+# Internal macro that creates the dependency from all source files on the eCos
+# target.ld and adds the command for compiling eCos.
 macro(ECOS_ADD_TARGET_LIB)
-# when building out-of-source, create the ecos/ subdir
+  # When building out-of-source, create the ecos/ subdir.
   if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ecos)
     file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ecos)
   endif()
 
-#sources depend on target.ld
+  # Sources depend on target.ld.
   set_source_files_properties(
     ${ARGN}
     PROPERTIES
@@ -174,40 +259,37 @@
   add_custom_target( ecos make -C ${CMAKE_CURRENT_BINARY_DIR}/ecos/ DEPENDS  ${CMAKE_CURRENT_BINARY_DIR}/ecos/makefile )
 endmacro()
 
-# get the directory of the current file, used later on in the file
+# Get the directory of the current file, used later on in the file.
 get_filename_component( ECOS_CMAKE_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
 
-#macro for creating an executable ecos application
-#the first parameter is the name of the executable,
-#the second is the list of all source files (where the path
-#has been adjusted beforehand by calling ECOS_ADJUST_DIRECTORY()
-#usage: ECOS_ADD_EXECUTABLE(my_app ${adjusted_SRCS})
 macro(ECOS_ADD_EXECUTABLE _exe_NAME )
-  #definitions, valid for all ecos projects
-  #the optimization and "-g" for debugging has to be enabled
-  #in the project-specific CMakeLists.txt
+  # Definitions, valid for all eCos projects.
+  # The optimization and "-g" for debugging has to be enabled in the
+  # project-specific CMakeLists.txt.
   add_definitions(-D__ECOS__=1 -D__ECOS=1)
   set(ECOS_DEFINITIONS -Wall -Wno-long-long -pipe -fno-builtin)
 
-#the executable depends on ecos target.ld
-  ECOS_ADD_TARGET_LIB(${ARGN})
+  # The executable depends on eCos target.ld.
+  ecos_add_target_lib(${ARGN})
 
-# when using nmake makefiles, the custom buildtype suppresses the default cl.exe flags
-# and the rules for creating objects are adjusted for gcc
+  # When using nmake makefiles, the custom buildtype suppresses the default
+  # cl.exe flags and the rules for creating objects are adjusted for gcc.
   set(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD)
   set(CMAKE_C_COMPILE_OBJECT     "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
   set(CMAKE_CXX_COMPILE_OBJECT   "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
-# special link commands for ecos-executables
-  set(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
-  set(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
-# some strict compiler flags
+
+  # Special link commands for eCos executables.
+  set(CMAKE_CXX_LINK_EXECUTABLE  "<CMAKE_CXX_COMPILER> <LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
+  set(CMAKE_C_LINK_EXECUTABLE    "<CMAKE_C_COMPILER> <LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
+
+  # Some strict compiler flags.
   set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes")
   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
 
   add_executable(${_exe_NAME} ${ARGN})
   set_target_properties(${_exe_NAME} PROPERTIES SUFFIX ".elf")
 
-#create a binary file
+  # Create a binary file.
   add_custom_command(
     TARGET ${_exe_NAME}
     POST_BUILD
@@ -215,7 +297,7 @@
     ARGS -O binary ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin
   )
 
-#and an srec file
+  # And an srec file.
   add_custom_command(
     TARGET ${_exe_NAME}
     POST_BUILD
@@ -223,7 +305,7 @@
     ARGS -O srec ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec
   )
 
-#add the created files to the clean-files
+  # Add the created files to the clean-files.
   set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
     "${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin"
     "${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec"
@@ -233,7 +315,6 @@
   add_custom_target(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
   add_dependencies (ecosclean normalclean)
 
-
   add_custom_target( listing
     COMMAND echo -e   \"\\n--- Symbols sorted by address ---\\n\" > ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
     COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -n ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
@@ -241,5 +322,4 @@
     COMMAND ${ECOS_ARCH_PREFIX}nm -S -C -r --size-sort ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
     COMMAND echo -e \"\\n--- Full assembly listing ---\\n\" >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst
     COMMAND ${ECOS_ARCH_PREFIX}objdump -S -x -d -C ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.elf >> ${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst )
-
 endmacro()
diff --git a/Modules/UseJava/javaTargets.cmake.in b/Modules/UseJava/javaTargets.cmake.in
index 11f1f06..4aa6560 100644
--- a/Modules/UseJava/javaTargets.cmake.in
+++ b/Modules/UseJava/javaTargets.cmake.in
@@ -1,5 +1,5 @@
 cmake_policy(PUSH)
-cmake_policy(VERSION 2.8.12...3.30)
+cmake_policy(VERSION 2.8.12...3.31)
 
 #----------------------------------------------------------------
 # Generated CMake Java target import file.
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake
index 3771db1..2c34c26 100644
--- a/Modules/UsePkgConfig.cmake
+++ b/Modules/UsePkgConfig.cmake
@@ -6,18 +6,81 @@
 ------------
 
 .. deprecated:: 3.0
-  Use :module:`FindPkgConfig` instead.
+
+  This module should no longer be used.  Instead, use the
+  :module:`FindPkgConfig` module or the :command:`cmake_pkg_config` command.
+
+  This module provided a macro for finding external packages using
+  ``pkg-config`` command-line utility.  It has been replaced by the more
+  convenient ``FindPkgConfig`` module, which is commonly used in
+  :ref:`Find Modules`.
+
+  As of CMake 3.31, the built-in :command:`cmake_pkg_config` command provides
+  even more features to extract package information.
+
+Macros
+^^^^^^
 
 This module defines the following macro:
 
-PKGCONFIG(package includedir libdir linkflags cflags)
+.. command:: pkgconfig
 
-Calling PKGCONFIG will fill the desired information into the 4 given
-arguments, e.g.  PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR
-LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config was NOT
-found or the specified software package doesn't exist, the variable
-will be empty when the function returns, otherwise they will contain
-the respective information
+  Finds external package using ``pkg-config`` and sets result variables:
+
+  .. code-block:: cmake
+
+    pkgconfig(<package> <includedir> <libdir> <linkflags> <cflags>)
+
+  This macro invokes ``pkg-config`` command-line utility to retrieve the package
+  information into specified variables.  If ``pkg-config`` or the specified
+  package ``<package>`` is NOT found, the result variables remain empty.
+
+  The arguments are:
+
+  ``<package>``
+    Name of the package as defined in its PC metadata file (``<package>.pc``).
+
+  ``<includedir>``
+    Variable name to store the package's include directory.
+
+  ``<libdir>``
+    Variable name to store the directory containing the package library.
+
+  ``<linkflags>``
+    Variable name to store the linker flags for the package.
+
+  ``<cflags>``
+    Variable name to store the compiler flags for the package.
+
+Examples
+^^^^^^^^
+
+Using this module fills the desired information into the four given variables:
+
+.. code-block:: cmake
+
+  include(UsePkgConfig)
+  pkgconfig(
+    libart-2.0
+    LIBART_INCLUDEDIR
+    LIBART_LIBDIR
+    LIBART_LDFLAGS
+    LIBART_CFLAGS
+  )
+
+Migrating to the :module:`FindPkgConfig`  would look something like this:
+
+.. code-block:: cmake
+
+  find_package(PkgConfig QUIET)
+  if(PKG_CONFIG_FOUND)
+    pkg_check_modules(LIBART QUIET libart-2.0)
+  endif()
+
+  message(STATUS "LIBART_INCLUDEDIR=${LIBART_INCLUDEDIR}")
+  message(STATUS "LIBART_LIBDIR=${LIBART_LIBDIR}")
+  message(STATUS "LIBART_LDFLAGS=${LIBART_LDFLAGS}")
+  message(STATUS "LIBART_CFLAGS=${LIBART_CFLAGS}")
 #]=======================================================================]
 
 find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config )
diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake
index 5f46784..e3c1870 100644
--- a/Modules/Use_wxWindows.cmake
+++ b/Modules/Use_wxWindows.cmake
@@ -7,39 +7,41 @@
 
 .. deprecated:: 2.8.10
 
-  Use ``find_package(wxWidgets)`` and ``include(${wxWidgets_USE_FILE})`` instead.
+  Use :module:`find_package(wxWidgets) <FindwxWidgets>` instead.
 
-This convenience include finds if wxWindows is installed and set the
-appropriate libs, incdirs, flags etc.  author Jan Woetzel <jw -at-
-mip.informatik.uni-kiel.de> (07/2003)
+This convenience include finds if wxWindows library is installed and sets the
+appropriate libraries, include directories, flags, etc.
 
-USAGE:
+Examples
+^^^^^^^^
 
-::
+Include ``Use_wxWindows`` module in project's ``CMakeLists.txt``:
 
-   just include Use_wxWindows.cmake
-   in your projects CMakeLists.txt
+.. code-block:: cmake
 
-include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
+  # CMakeLists.txt
+  include(Use_wxWindows)
 
-::
+When the GL support is required, set ``WXWINDOWS_USE_GL`` *before* including
+this module:
 
-   if you are sure you need GL then
+.. code-block:: cmake
 
-set(WXWINDOWS_USE_GL 1)
-
-::
-
-   *before* you include this file.
+  set(WXWINDOWS_USE_GL ON)
+  include(Use_wxWindows)
 #]=======================================================================]
 
+# Author: Jan Woetzel <jw -at- mip.informatik.uni-kiel.de> (07/2003)
+
 # -----------------------------------------------------
 # 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
 # 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibility JW
 
-message(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
-"Please use find_package(wxWidgets) and include(${wxWidgets_USE_FILE}) instead. (JW)")
-
+message(
+  DEPRECATION
+  "Use_wxWindows module is DEPRECATED.\n"
+  "Please use find_package(wxWidgets) instead. (JW)"
+)
 
 # ------------------------
 
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index 7152afe..3751025 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -5,39 +5,46 @@
 UsewxWidgets
 ------------
 
-Convenience include for using wxWidgets library.
+This module calls :command:`include_directories` and
+:command:`link_directories`, sets compile definitions for the current directory
+and appends some compile flags to use wxWidgets library after calling the
+:module:`find_package(wxWidgets) <FindwxWidgets>`.
 
-Determines if wxWidgets was FOUND and sets the appropriate libs,
-incdirs, flags, etc.  INCLUDE_DIRECTORIES and LINK_DIRECTORIES are
-called.
+Examples
+^^^^^^^^
 
-USAGE
+Include ``UsewxWidgets`` module in project's ``CMakeLists.txt``:
 
 .. code-block:: cmake
 
-  # Note that for MinGW users the order of libs is important!
+  # Note that for MinGW users the order of libraries is important.
   find_package(wxWidgets REQUIRED net gl core base)
+
+  # Above also sets the wxWidgets_USE_FILE variable that points to this module.
   include(${wxWidgets_USE_FILE})
-  # and for each of your dependent executable/library targets:
-  target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
 
+  # Link wxWidgets libraries for each dependent executable/library target.
+  target_link_libraries(<ProjectTarget> ${wxWidgets_LIBRARIES})
 
+As of CMake 3.27, a better approach is to link only the
+:module:`wxWidgets::wxWidgets <FindwxWidgets>` ``IMPORTED`` target to specific
+targets that require it, rather than including this module. Imported targets
+provide better control of the package usage properties, such as include
+directories and compile flags, by applying them only to the targets they are
+linked to, avoiding unnecessary propagation to all targets in the current
+directory.
 
-DEPRECATED
+.. code-block:: cmake
 
-::
+  # CMakeLists.txt
+  find_package(wxWidgets)
 
-  LINK_LIBRARIES is not called in favor of adding dependencies per target.
-
-
-
-AUTHOR
-
-::
-
-  Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
+  # Link the imported target for each dependent executable/library target.
+  target_link_libraries(<ProjectTarget> wxWidgets::wxWidgets)
 #]=======================================================================]
 
+# Author: Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
+
 if   (wxWidgets_FOUND)
   if   (wxWidgets_INCLUDE_DIRS)
     if(wxWidgets_INCLUDE_DIRS_NO_SYSTEM)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 1d078ee..c54da44 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -148,8 +148,6 @@
   cmComputeTargetDepends.cxx
   cmConfigureLog.h
   cmConfigureLog.cxx
-  cmConsoleBuf.h
-  cmConsoleBuf.cxx
   cmConstStack.h
   cmConstStack.tcc
   cmCPackPropertiesGenerator.h
@@ -186,8 +184,6 @@
   cmDependsCompiler.h
   cmDocumentation.cxx
   cmDocumentationFormatter.cxx
-  cmDynamicLoader.cxx
-  cmDynamicLoader.h
   cmDyndepCollation.cxx
   cmDyndepCollation.h
   cmELF.h
@@ -203,6 +199,8 @@
   cmExportBuildCMakeConfigGenerator.cxx
   cmExportBuildFileGenerator.h
   cmExportBuildFileGenerator.cxx
+  cmExportBuildPackageInfoGenerator.h
+  cmExportBuildPackageInfoGenerator.cxx
   cmExportCMakeConfigGenerator.h
   cmExportCMakeConfigGenerator.cxx
   cmExportFileGenerator.h
@@ -274,9 +272,11 @@
   cmGccDepfileLexerHelper.h
   cmGccDepfileReader.cxx
   cmGccDepfileReader.h
+  cmGenExContext.cxx
+  cmGenExContext.h
+  cmGenExEvaluation.cxx
+  cmGenExEvaluation.h
   cmGeneratedFileStream.cxx
-  cmGeneratorExpressionContext.cxx
-  cmGeneratorExpressionContext.h
   cmGeneratorExpressionDAGChecker.cxx
   cmGeneratorExpressionDAGChecker.h
   cmGeneratorExpressionEvaluationFile.cxx
@@ -411,8 +411,11 @@
   cmNewLineStyle.cxx
   cmOrderDirectories.cxx
   cmOrderDirectories.h
+  cmPackageInfoArguments.cxx
+  cmPackageInfoArguments.h
   cmPackageInfoReader.cxx
   cmPackageInfoReader.h
+  cmPackageState.h
   cmPathResolver.cxx
   cmPathResolver.h
   cmPlistParser.cxx
@@ -467,6 +470,14 @@
   cmStateSnapshot.cxx
   cmStateSnapshot.h
   cmStateTypes.h
+  cmStdIoConsole.h
+  cmStdIoConsole.cxx
+  cmStdIoInit.h
+  cmStdIoInit.cxx
+  cmStdIoStream.h
+  cmStdIoStream.cxx
+  cmStdIoTerminal.h
+  cmStdIoTerminal.cxx
   cmStringAlgorithms.cxx
   cmStringAlgorithms.h
   cmSyntheticTargetCache.h
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 31bb2ad..d067118 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 4)
-set(CMake_VERSION_MINOR 0)
-set(CMake_VERSION_PATCH 6)
+set(CMake_VERSION_MINOR 1)
+set(CMake_VERSION_PATCH 4)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 
@@ -28,7 +28,7 @@
   if(NOT git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]?)[0-9a-f]* "
       AND EXISTS "${git_toplevel}/.git")
     find_package(Git QUIET)
-    if(GIT_FOUND)
+    if(Git_FOUND)
       macro(_git)
         execute_process(
           COMMAND ${GIT_EXECUTABLE} ${ARGN}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 793e893..ce542c7 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -113,7 +113,7 @@
     command << " -ext " << QuotePath(ext);
   }
 
-  if (!cmHasSuffix(sourceFile, this->CPackTopLevel)) {
+  if (!cmHasPrefix(sourceFile, this->CPackTopLevel)) {
     command << ' ' << QuotePath(cmStrCat("-I", this->CPackTopLevel));
   }
 
@@ -334,8 +334,13 @@
 
   AddCustomFlags("CPACK_WIX_BUILD_EXTRA_FLAGS", command);
 
+  bool includeCPackTopLevel = false;
   for (std::string const& sourceFilename : this->WixSources) {
     command << " -src " << QuotePath(CMakeToWixPath(sourceFilename));
+    includeCPackTopLevel |= !cmHasPrefix(sourceFilename, this->CPackTopLevel);
+  }
+  if (includeCPackTopLevel) {
+    command << " -i " << QuotePath(this->CPackTopLevel);
   }
 
   return RunWiXCommand(command.str());
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index bf97240..ac09918 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -55,7 +55,7 @@
         : DeduplicateStatus::Skip;
     }
 
-    this->Files[path] = cmStrCat(localTopLevel, "/", path);
+    this->Files[path] = cmStrCat(localTopLevel, '/', path);
     return DeduplicateStatus::Add;
   }
 
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index 82a4935..90d6370 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -231,7 +231,7 @@
     // sign app bundle
     auto temp_codesign_cmd =
       cmStrCat(this->GetOption("CPACK_COMMAND_CODESIGN"), ' ', sign_parameter,
-               " -s \"", cpack_apple_cert_app, "\"");
+               " -s \"", cpack_apple_cert_app, '"');
     if (this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS")) {
       temp_codesign_cmd +=
         cmStrCat(" --entitlements ",
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index fd85b7c..d0d84db 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -176,7 +176,7 @@
       totalSize += cmSystemTools::FileLength(file);
     }
   }
-  out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n\n";
+  out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n";
 }
 
 bool DebGenerator::generateDataTar() const
@@ -928,8 +928,8 @@
   // the current COMPONENT belongs to.
   std::string groupVar =
     "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
-  if (this->GetOption(groupVar)) {
-    return *this->GetOption(groupVar);
+  if (cmValue v = this->GetOption(groupVar)) {
+    return *v;
   }
   return componentName;
 }
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 1d55274..05489d0 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -597,15 +597,18 @@
         CFStringRef iso_language =
           CFLocaleCreateCanonicalLanguageIdentifierFromString(
             nullptr, language_cfstring);
+        CFRelease(language_cfstring);
         if (!iso_language) {
           cmCPackLogger(cmCPackLog::LOG_ERROR,
                         language << " is not a recognized language"
                                  << std::endl);
+          return 0;
         }
         char iso_language_cstr[65];
         CFStringGetCString(iso_language, iso_language_cstr,
                            sizeof(iso_language_cstr) - 1,
                            kCFStringEncodingMacRoman);
+        CFRelease(iso_language);
         LangCode lang = 0;
         RegionCode region = 0;
 #if HAVE_CoreServices
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index f725580..e30a343 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -100,18 +100,18 @@
   std::string pkgFileName =
     cmStrCat(pkgBaseFileName, this->GetOutputExtension());
   // Determine path to the package.
-  std::string pkgFilePath = cmStrCat(pkgDirectory, "/", pkgFileName);
+  std::string pkgFilePath = cmStrCat(pkgDirectory, '/', pkgFileName);
   // Determine top-level directory for packaging.
   std::string topDirectory = cmStrCat(pkgDirectory, "/_CPack_Packages/");
   {
     cmValue toplevelTag = this->GetOption("CPACK_TOPLEVEL_TAG");
     if (toplevelTag) {
-      topDirectory += cmStrCat(toplevelTag, "/");
+      topDirectory += cmStrCat(toplevelTag, '/');
     }
   }
   topDirectory += *this->GetOption("CPACK_GENERATOR");
   // Determine temporary packaging-directory.
-  std::string tmpDirectory = cmStrCat(topDirectory, "/", pkgBaseFileName);
+  std::string tmpDirectory = cmStrCat(topDirectory, '/', pkgBaseFileName);
   // Determine path to temporary package file.
   std::string tmpPkgFilePath = topDirectory + "/" + pkgFileName;
 
@@ -196,8 +196,8 @@
   std::string bareTempInstallDirectory =
     this->GetOption("CPACK_TEMPORARY_DIRECTORY");
   std::string tempInstallDirectory = bareTempInstallDirectory;
-  bool setDestDir = this->GetOption("CPACK_SET_DESTDIR").IsOn() ||
-    cmIsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"));
+  cmValue v = this->GetOption("CPACK_SET_DESTDIR");
+  bool setDestDir = v.IsOn() || cmIsInternallyOn(v);
   if (!setDestDir) {
     tempInstallDirectory += this->GetPackagingInstallPrefix();
   }
@@ -962,9 +962,8 @@
       std::string absoluteDestFileComponent =
         std::string("CPACK_ABSOLUTE_DESTINATION_FILES") + "_" +
         this->GetComponentInstallSuffix(component);
-      if (this->GetOption(absoluteDestFileComponent)) {
-        std::string absoluteDestFilesListComponent =
-          cmStrCat(this->GetOption(absoluteDestFileComponent), ';', *d);
+      if (cmValue v = this->GetOption(absoluteDestFileComponent)) {
+        std::string absoluteDestFilesListComponent = cmStrCat(*v, ';', *d);
         this->SetOption(absoluteDestFileComponent,
                         absoluteDestFilesListComponent);
       } else {
@@ -983,7 +982,7 @@
                                             cm::string_view filename) const
 {
   std::string packageFileName =
-    cmStrCat(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"), "/", filename);
+    cmStrCat(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"), '/', filename);
   std::string hashFile = cmStrCat(
     packageFileName, "." + cmSystemTools::LowerCase(crypto.GetHashAlgoName()));
   cmsys::ofstream outF(hashFile.c_str());
@@ -1002,7 +1001,7 @@
                                        cm::string_view filename) const
 {
   std::string destFilePath =
-    cmStrCat(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"), "/", filename);
+    cmStrCat(this->GetOption("CPACK_OUTPUT_FILE_PREFIX"), '/', filename);
   cmCPackLogger(cmCPackLog::LOG_DEBUG,
                 "Copy final package(s): "
                   << (!srcFilePath.empty() ? srcFilePath : "(NULL)") << " to "
@@ -1239,7 +1238,11 @@
   // Load the project specific config file
   cmValue config = this->GetOption("CPACK_PROJECT_CONFIG_FILE");
   if (config) {
-    mf->ReadListFile(*config);
+    if (!mf->ReadListFile(*config)) {
+      cmCPackLogger(cmCPackLog::LOG_WARNING,
+                    "CPACK_PROJECT_CONFIG_FILE not found: " << *config
+                                                            << std::endl);
+    }
   }
   int result = this->InitializeInternal();
   if (cmSystemTools::GetErrorOccurredFlag()) {
diff --git a/Source/CPack/cmCPackInnoSetupGenerator.cxx b/Source/CPack/cmCPackInnoSetupGenerator.cxx
index ed0b2c4..93641b5 100644
--- a/Source/CPack/cmCPackInnoSetupGenerator.cxx
+++ b/Source/CPack/cmCPackInnoSetupGenerator.cxx
@@ -662,12 +662,11 @@
     if (cmNonempty(userUploadDirectory)) {
       uploadDirectory = *userUploadDirectory;
     } else {
-      if (!RequireOption("CPACK_PACKAGE_DIRECTORY")) {
+      cmValue pkgDirectory = RequireOption("CPACK_PACKAGE_DIRECTORY");
+      if (!pkgDirectory) {
         return false;
       }
-
-      uploadDirectory =
-        cmStrCat(GetOption("CPACK_PACKAGE_DIRECTORY"), "/CPackUploads");
+      uploadDirectory = cmStrCat(*pkgDirectory, "/CPackUploads");
     }
 
     if (!cmSystemTools::FileExists(uploadDirectory)) {
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index fb8e81b..31f0737 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -130,11 +130,13 @@
   if (this->IsSet("CPACK_NSIS_MUI_ICON") ||
       this->IsSet("CPACK_NSIS_MUI_UNIICON")) {
     std::string installerIconCode;
-    if (cmValue icon = this->GetOptionIfSet("CPACK_NSIS_MUI_ICON")) {
-      installerIconCode += cmStrCat("!define MUI_ICON \"", *icon, "\"\n");
+    if (cmValue v = this->GetOptionIfSet("CPACK_NSIS_MUI_ICON")) {
+      std::string iconFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
+      installerIconCode += cmStrCat("!define MUI_ICON ", iconFile, '\n');
     }
-    if (cmValue icon = this->GetOptionIfSet("CPACK_NSIS_MUI_UNIICON")) {
-      installerIconCode += cmStrCat("!define MUI_UNICON \"", *icon, "\"\n");
+    if (cmValue v = this->GetOptionIfSet("CPACK_NSIS_MUI_UNIICON")) {
+      std::string iconFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
+      installerIconCode += cmStrCat("!define MUI_UNICON ", iconFile, '\n');
     }
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_ICON_CODE",
                             installerIconCode.c_str());
@@ -146,24 +148,28 @@
     installerHeaderImage = *icon;
   }
   if (!installerHeaderImage.empty()) {
-    std::string installerIconCode = cmStrCat(
-      "!define MUI_HEADERIMAGE_BITMAP \"", installerHeaderImage, "\"\n");
+    installerHeaderImage =
+      cmSystemTools::ConvertToWindowsOutputPath(installerHeaderImage);
+    std::string installerIconCode =
+      cmStrCat("!define MUI_HEADERIMAGE_BITMAP ", installerHeaderImage, '\n');
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_ICON_CODE",
                             installerIconCode);
   }
 
   if (cmValue v =
         this->GetOptionIfSet("CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP")) {
+    std::string bitmapFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
     std::string installerBitmapCode =
-      cmStrCat("!define MUI_WELCOMEFINISHPAGE_BITMAP \"", *v, "\"\n");
+      cmStrCat("!define MUI_WELCOMEFINISHPAGE_BITMAP ", bitmapFile, '\n');
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_WELCOMEFINISH_CODE",
                             installerBitmapCode);
   }
 
   if (cmValue v =
         this->GetOptionIfSet("CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP")) {
+    std::string bitmapFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
     std::string installerBitmapCode =
-      cmStrCat("!define MUI_UNWELCOMEFINISHPAGE_BITMAP \"", *v, "\"\n");
+      cmStrCat("!define MUI_UNWELCOMEFINISHPAGE_BITMAP ", bitmapFile, '\n');
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_MUI_UNWELCOMEFINISH_CODE",
                             installerBitmapCode);
   }
@@ -178,7 +184,7 @@
 
   if (cmValue v = this->GetOptionIfSet("CPACK_NSIS_WELCOME_TITLE")) {
     std::string welcomeTitleCode =
-      cmStrCat("!define MUI_WELCOMEPAGE_TITLE \"", *v, "\"");
+      cmStrCat("!define MUI_WELCOMEPAGE_TITLE \"", *v, '"');
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_WELCOME_TITLE_CODE",
                             welcomeTitleCode);
   }
@@ -190,7 +196,7 @@
 
   if (cmValue v = this->GetOptionIfSet("CPACK_NSIS_FINISH_TITLE")) {
     std::string finishTitleCode =
-      cmStrCat("!define MUI_FINISHPAGE_TITLE \"", *v, "\"");
+      cmStrCat("!define MUI_FINISHPAGE_TITLE \"", *v, '"');
     this->SetOptionIfNotSet("CPACK_NSIS_INSTALLER_FINISH_TITLE_CODE",
                             finishTitleCode);
   }
@@ -231,9 +237,10 @@
   }
 
   if (!this->IsSet("CPACK_NSIS_IGNORE_LICENSE_PAGE")) {
+    cmValue v = this->GetOption("CPACK_RESOURCE_FILE_LICENSE");
+    std::string licenseFile = cmSystemTools::ConvertToWindowsOutputPath(*v);
     std::string licenseCode =
-      cmStrCat("!insertmacro MUI_PAGE_LICENSE \"",
-               this->GetOption("CPACK_RESOURCE_FILE_LICENSE"), "\"\n");
+      cmStrCat("!insertmacro MUI_PAGE_LICENSE ", licenseFile, '\n');
     this->SetOptionIfNotSet("CPACK_NSIS_LICENSE_PAGE", licenseCode);
   }
 
@@ -381,7 +388,7 @@
     cmStrCat('"', this->GetOption("CPACK_INSTALLER_PROGRAM"), "\" ",
              nsisPreArguments, " \"", nsisFileName, '"');
   if (!nsisPostArguments.empty()) {
-    nsisCmd = cmStrCat(nsisCmd, " ", nsisPostArguments);
+    nsisCmd = cmStrCat(nsisCmd, ' ', nsisPostArguments);
   }
   cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd << std::endl);
   std::string output;
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index 4193f8c..aafa92b 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -250,10 +250,10 @@
          << "\""
             " --install-location \"/\""
          << (identityName.empty() ? std::string{}
-                                  : cmStrCat(" --sign \"", identityName, "\""))
+                                  : cmStrCat(" --sign \"", identityName, '"'))
          << (keychainPath.empty()
                ? std::string{}
-               : cmStrCat(" --keychain \"", keychainPath, "\""))
+               : cmStrCat(" --keychain \"", keychainPath, '"'))
          << " \"" << packageFile << '"';
 
   if (component && !component->Plist.empty()) {
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 2356d93..8c2eecd 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -458,8 +458,8 @@
   // the current COMPONENT belongs to.
   std::string groupVar =
     "CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
-  if (this->GetOption(groupVar)) {
-    return *this->GetOption(groupVar);
+  if (cmValue v = this->GetOption(groupVar)) {
+    return *v;
   }
   return componentName;
 }
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 138d8fa..d3ac1bf 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -24,7 +24,6 @@
 #include "cmCPackGeneratorFactory.h"
 #include "cmCPackLog.h"
 #include "cmCommandLineArgument.h"
-#include "cmConsoleBuf.h"
 #include "cmDocumentation.h"
 #include "cmDocumentationEntry.h"
 #include "cmGlobalGenerator.h"
@@ -33,6 +32,7 @@
 #include "cmMakefile.h"
 #include "cmState.h"
 #include "cmStateSnapshot.h"
+#include "cmStdIoConsole.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmValue.h"
@@ -48,7 +48,7 @@
 
 cmDocumentationEntry const cmDocumentationOptions[14] = {
   { "-G <generators>", "Override/define CPACK_GENERATOR" },
-  { "-C <Configuration>", "Specify the project configuration" },
+  { "-C <Configurations>", "Specify the project configuration(s)" },
   { "-D <var>=<value>", "Set a CPack variable." },
   { "--config <configFile>", "Specify the config file." },
   { "-V,--verbose", "Enable verbose output" },
@@ -89,11 +89,7 @@
 // this is CPack.
 int main(int argc, char const* const* argv)
 {
-  cmSystemTools::EnsureStdPipes();
-
-  // Replace streambuf so we can output Unicode to console
-  cmConsoleBuf consoleBuf;
-  consoleBuf.SetUTF8Pipes();
+  cm::StdIo::Console console;
 
   cmsys::Encoding::CommandLineArguments args =
     cmsys::Encoding::CommandLineArguments::Main(argc, argv);
diff --git a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
index 0fc89e8..3fba37e 100644
--- a/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
+++ b/Source/CTest/cmCTestEmptyBinaryDirectoryCommand.cxx
@@ -7,6 +7,7 @@
 #include "cmExecutionStatus.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmMessenger.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 
@@ -26,7 +27,7 @@
       continue;
     }
 
-    std::string fullPath = cmStrCat(directoryPath, "/", path);
+    std::string fullPath = cmStrCat(directoryPath, '/', path);
 
     bool isDirectory = cmSystemTools::FileIsDirectory(fullPath) &&
       !cmSystemTools::FileIsSymlink(fullPath);
@@ -94,10 +95,12 @@
 
   std::string err;
   if (!EmptyBinaryDirectory(args[0], err)) {
-    status.GetMakefile().IssueMessage(
+    cmMakefile& mf = status.GetMakefile();
+    mf.GetMessenger()->DisplayMessage(
       MessageType::FATAL_ERROR,
       cmStrCat("Did not remove the binary directory:\n ", args[0],
-               "\nbecause:\n ", err));
+               "\nbecause:\n ", err),
+      mf.GetBacktrace());
     return true;
   }
 
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 5db338f..1c4f2a5 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -1668,7 +1668,7 @@
 {
   if (!this->ResourceSpec.ReadFromJSONFile(this->ResourceSpecFile)) {
     error = cmStrCat("Could not read/parse resource spec file ",
-                     this->ResourceSpecFile, ": ",
+                     this->ResourceSpecFile, ":\n",
                      this->ResourceSpec.parseState.GetErrorMessage());
     return false;
   }
diff --git a/Source/CTest/cmCTestResourceSpec.cxx b/Source/CTest/cmCTestResourceSpec.cxx
index b6e4b40..68f4180 100644
--- a/Source/CTest/cmCTestResourceSpec.cxx
+++ b/Source/CTest/cmCTestResourceSpec.cxx
@@ -47,10 +47,19 @@
 bool ResourceIdHelper(std::string& out, Json::Value const* value,
                       cmJSONState* state)
 {
+#if defined(__GNUC__) && __GNUC__ >= 15
+#  define CM_GCC_diagnostic_push_Wmaybe_uninitialized
+#  pragma GCC diagnostic push
+#  pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
   if (!JSONHelperBuilder::String(cmCTestResourceSpecErrors::INVALID_RESOURCE)(
         out, value, state)) {
     return false;
   }
+#ifdef CM_GCC_diagnostic_push_Wmaybe_uninitialized
+#  pragma GCC diagnostic pop
+#  undef CM_GCC_diagnostic_push_Wmaybe_uninitialized
+#endif
   cmsys::RegularExpressionMatch match;
   if (!IdRegex.find(out.c_str(), match)) {
     cmCTestResourceSpecErrors::INVALID_RESOURCE(value, state);
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 21eaa19..24ee6eb 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -319,7 +319,7 @@
     ttime -= minutes;
     auto seconds = std::chrono::duration_cast<std::chrono::seconds>(ttime);
     char buffer[100];
-    snprintf(buffer, sizeof(buffer), "%02d:%02d:%02d",
+    snprintf(buffer, sizeof(buffer), "%02u:%02u:%02u",
              static_cast<unsigned>(hours.count()),
              static_cast<unsigned>(minutes.count()),
              static_cast<unsigned>(seconds.count()));
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 48f0935..ca66f18 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -63,10 +63,7 @@
     res |= this->RunConfigurationScript(this->ConfigurationScripts[i],
                                         this->ScriptProcessScope[i]);
   }
-  if (res) {
-    return -1;
-  }
-  return 0;
+  return res;
 }
 
 void cmCTestScriptHandler::UpdateElapsedTime()
@@ -180,6 +177,8 @@
   this->CMake->SetHomeOutputDirectory("");
   this->CMake->GetCurrentSnapshot().SetDefaultDefinitions();
   this->CMake->AddCMakePaths();
+  this->CMake->SetWorkingMode(cmake::SCRIPT_MODE,
+                              cmake::CommandFailureAction::EXIT_CODE);
   this->GlobalGenerator =
     cm::make_unique<cmGlobalGenerator>(this->CMake.get());
 
@@ -289,7 +288,7 @@
       cmSystemTools::GetErrorOccurredFlag()) {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Error in read:" << systemFile << "\n");
-    return 2;
+    return -1;
   }
 
   // Add definitions of variables passed in on the command line:
@@ -299,16 +298,20 @@
     this->Makefile->AddDefinition(d.first, d.second);
   }
 
+  int res = 0;
+
   // finally read in the script
   if (!this->Makefile->ReadListFile(script) ||
       cmSystemTools::GetErrorOccurredFlag()) {
     // Reset the error flag so that it can run more than
     // one script with an error when you use ctest_run_script.
     cmSystemTools::ResetErrorOccurredFlag();
-    return 2;
+    res = -1;
   }
 
-  return 0;
+  return this->CMake->HasScriptModeExitCode()
+    ? this->CMake->GetScriptModeExitCode()
+    : res;
 }
 
 // run a specific script
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index b2cb454..200ba03 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -32,9 +32,8 @@
 
 #define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120
 
-using cmCTestSubmitHandlerVectorOfChar = std::vector<char>;
-
-class cmCTestSubmitHandler::ResponseParser : public cmXMLParser
+namespace {
+class ResponseParser : public cmXMLParser
 {
 public:
   enum StatusType
@@ -96,26 +95,26 @@
   }
 };
 
-static size_t cmCTestSubmitHandlerWriteMemoryCallback(void* ptr, size_t size,
-                                                      size_t nmemb, void* data)
+size_t cmCTestSubmitHandlerWriteMemoryCallback(void* ptr, size_t size,
+                                               size_t nmemb, void* data)
 {
   int realsize = static_cast<int>(size * nmemb);
   char const* chPtr = static_cast<char*>(ptr);
-  cm::append(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
-             chPtr + realsize);
+  cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + realsize);
   return realsize;
 }
 
-static size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/,
-                                                    curl_infotype /*unused*/,
-                                                    char* chPtr, size_t size,
-                                                    void* data)
+size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/,
+                                             curl_infotype /*unused*/,
+                                             char* chPtr, size_t size,
+                                             void* data)
 {
-  cm::append(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
-             chPtr + size);
+  cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + size);
   return 0;
 }
 
+}
+
 cmCTestSubmitHandler::cmCTestSubmitHandler(cmCTest* ctest)
   : Superclass(ctest)
   , HttpHeaders(ctest->GetCommandLineHttpHeaders())
@@ -219,7 +218,7 @@
       std::string local_file = file;
       bool initialize_cdash_buildid = false;
       if (!cmSystemTools::FileExists(local_file)) {
-        local_file = cmStrCat(localprefix, "/", file);
+        local_file = cmStrCat(localprefix, '/', file);
         // If this file exists within the local Testing directory we assume
         // that it will be associated with the current build in CDash.
         initialize_cdash_buildid = true;
@@ -321,8 +320,8 @@
                          cmCTestSubmitHandlerCurlDebugCallback);
 
       /* we pass our 'chunk' struct to the callback function */
-      cmCTestSubmitHandlerVectorOfChar chunk;
-      cmCTestSubmitHandlerVectorOfChar chunkDebug;
+      std::vector<char> chunk;
+      std::vector<char> chunkDebug;
       ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk);
       ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
 
@@ -447,8 +446,7 @@
   return true;
 }
 
-void cmCTestSubmitHandler::ParseResponse(
-  cmCTestSubmitHandlerVectorOfChar chunk)
+void cmCTestSubmitHandler::ParseResponse(std::vector<char> chunk)
 {
   std::string output;
   output.append(chunk.begin(), chunk.end());
@@ -715,6 +713,9 @@
     return -1;
   }
 
+  cmGeneratedFileStream ofs;
+  this->StartLogFile("Submit", ofs);
+
   if (char const* proxy = getenv("HTTP_PROXY")) {
     this->HTTPProxyType = 1;
     this->HTTPProxy = proxy;
@@ -747,8 +748,6 @@
                        "   Use HTTP Proxy: " << this->HTTPProxy << std::endl,
                        this->Quiet);
   }
-  cmGeneratedFileStream ofs;
-  this->StartLogFile("Submit", ofs);
 
   std::vector<std::string> files;
   std::string prefix = this->GetSubmitResultsPrefix();
@@ -835,7 +834,7 @@
                        "   Send to group: " << specificGroup << std::endl,
                        this->Quiet);
   }
-  this->SetLogFile(&ofs);
+  this->LogFile = &ofs;
 
   std::string url = this->CTest->GetSubmitURL();
   cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index 221c958..936b666 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -37,17 +37,12 @@
   /** Specify a set of files to submit.  */
   void SelectFiles(std::set<std::string> const& files);
 
-  // handle the cdash file upload protocol
-  int HandleCDashUploadFile(std::string const& file, std::string const& type);
-
   void SetHttpHeaders(std::vector<std::string> const& v)
   {
     this->HttpHeaders.insert(this->HttpHeaders.end(), v.begin(), v.end());
   }
 
 private:
-  void SetLogFile(std::ostream* ost) { this->LogFile = ost; }
-
   /**
    * Submit file using various ways
    */
@@ -55,16 +50,14 @@
                        std::vector<std::string> const& files,
                        std::string const& remoteprefix,
                        std::string const& url);
+  void ParseResponse(std::vector<char> chunk);
 
-  using cmCTestSubmitHandlerVectorOfChar = std::vector<char>;
-
-  void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
+  // handle the cdash file upload protocol
+  int HandleCDashUploadFile(std::string const& file, std::string const& type);
 
   std::string GetSubmitResultsPrefix();
   int GetSubmitInactivityTimeout();
 
-  class ResponseParser;
-
   std::string HTTPProxy;
   int HTTPProxyType = 0;
   std::string HTTPProxyAuth;
diff --git a/Source/CTest/cmCTestTestCommand.h b/Source/CTest/cmCTestTestCommand.h
index 5c90c64..090d42d 100644
--- a/Source/CTest/cmCTestTestCommand.h
+++ b/Source/CTest/cmCTestTestCommand.h
@@ -43,6 +43,7 @@
     cm::optional<ArgumentParser::Maybe<std::string>> ParallelLevel;
     std::string Repeat;
     std::string ScheduleRandom;
+    std::string ScheduleRandomSeed;
     std::string StopTime;
     std::string TestLoad;
     std::string ResourceSpecFile;
@@ -70,6 +71,7 @@
       .Bind("PARALLEL_LEVEL"_s, &TestArguments::ParallelLevel)
       .Bind("REPEAT"_s, &TestArguments::Repeat)
       .Bind("SCHEDULE_RANDOM"_s, &TestArguments::ScheduleRandom)
+      .Bind("SCHEDULE_RANDOM_SEED"_s, &TestArguments::ScheduleRandomSeed)
       .Bind("STOP_TIME"_s, &TestArguments::StopTime)
       .Bind("TEST_LOAD"_s, &TestArguments::TestLoad)
       .Bind("RESOURCE_SPEC_FILE"_s, &TestArguments::ResourceSpecFile)
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index ef2359f..a39cb7b 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -617,7 +617,7 @@
           testColor = cmCTest::Color::YELLOW;
         }
         std::string ft_name_and_status =
-          cmStrCat(ft.Name, " (", this->GetTestStatus(ft), ")");
+          cmStrCat(ft.Name, " (", this->GetTestStatus(ft), ')');
         std::string labels;
         cmCTestTestProperties const& p = *ft.Properties;
         if (!p.Labels.empty()) {
@@ -1324,7 +1324,14 @@
 
   bool randomSchedule = this->CTest->GetScheduleType() == "Random";
   if (randomSchedule) {
-    srand(static_cast<unsigned>(time(nullptr)));
+    cm::optional<unsigned int> scheduleRandomSeed =
+      this->CTest->GetRandomSeed();
+    if (!scheduleRandomSeed.has_value()) {
+      scheduleRandomSeed = static_cast<unsigned int>(time(nullptr));
+    }
+    srand(*scheduleRandomSeed);
+    *this->LogFile << "Test order random seed: " << *scheduleRandomSeed
+                   << std::endl;
   }
 
   for (cmCTestTestProperties& p : this->TestList) {
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 6ad2e60..9388425 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -34,6 +34,7 @@
   bool ScheduleRandom = false;
   bool StopOnFailure = false;
   bool UseUnion = false;
+  cm::optional<unsigned int> ScheduleRandomSeed;
 
   int OutputSizePassed = 1 * 1024;
   int OutputSizeFailed = 300 * 1024;
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index 5178721..8f608d6 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -77,7 +77,7 @@
             // Check if this is a path that is relative to our source or
             // binary directories.
             for (std::string const& filePath : this->FilePaths) {
-              finalpath = cmStrCat(filePath, "/", filename);
+              finalpath = cmStrCat(filePath, '/', filename);
               if (cmSystemTools::FileExists(finalpath)) {
                 this->CurFileName = finalpath;
                 break;
@@ -88,7 +88,7 @@
           cmsys::ifstream fin(this->CurFileName.c_str());
           if (this->CurFileName.empty() || !fin) {
             this->CurFileName =
-              cmStrCat(this->Coverage.BinaryDir, "/", atts[tagCount + 1]);
+              cmStrCat(this->Coverage.BinaryDir, '/', atts[tagCount + 1]);
             fin.open(this->CurFileName.c_str());
             if (!fin) {
               cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
diff --git a/Source/Checks/Curses/CMakeLists.txt b/Source/Checks/Curses/CMakeLists.txt
index 1f04bd2..b074068 100644
--- a/Source/Checks/Curses/CMakeLists.txt
+++ b/Source/Checks/Curses/CMakeLists.txt
@@ -1,9 +1,9 @@
-cmake_minimum_required(VERSION 3.13...3.30 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.13...3.31 FATAL_ERROR)
 project(CheckCurses C)
 
 set(CURSES_NEED_NCURSES TRUE)
 find_package(Curses)
-if(NOT CURSES_FOUND)
+if(NOT Curses_FOUND)
   return()
 endif()
 include_directories(${CURSES_INCLUDE_DIRS})
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 0ba0c22..f4832b3 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -102,11 +102,18 @@
   set(CMake_HAVE_CXX_FILESYSTEM FALSE)
 endif()
 
-if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|aarch64)$")
-  cm_check_cxx_feature(atomic_builtin)
-  if(NOT CMake_HAVE_CXX_ATOMIC_BUILTIN)
-    set(cm_check_cxx_feature_LINK_LIBRARIES atomic)
-    cm_check_cxx_feature(atomic_lib) # defines CMake_HAVE_CXX_ATOMIC_LIB
-    unset(cm_check_cxx_feature_LINK_LIBRARIES)
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+  if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID)
+    set(arch_id "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
+  else()
+    set(arch_id "${CMAKE_SYSTEM_PROCESSOR}")
+  endif()
+  if(NOT arch_id MATCHES "^(x86_64|aarch64)$")
+    cm_check_cxx_feature(atomic_builtin)
+    if(NOT CMake_HAVE_CXX_ATOMIC_BUILTIN)
+      set(cm_check_cxx_feature_LINK_LIBRARIES atomic)
+      cm_check_cxx_feature(atomic_lib) # defines CMake_HAVE_CXX_ATOMIC_LIB
+      unset(cm_check_cxx_feature_LINK_LIBRARIES)
+    endif()
   endif()
 endif()
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index 8385b13..6de688e 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -19,6 +19,7 @@
 #include "cmDocumentationEntry.h"
 #include "cmMessageMetadata.h"
 #include "cmState.h"
+#include "cmStdIoInit.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmake.h"
@@ -62,7 +63,8 @@
 
 int main(int argc, char const* const* argv)
 {
-  cmSystemTools::EnsureStdPipes();
+  cm::StdIo::Init();
+
   cmsys::Encoding::CommandLineArguments encoding_args =
     cmsys::Encoding::CommandLineArguments::Main(argc, argv);
   argc = encoding_args.argc();
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 557d32c..0569821 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -29,7 +29,7 @@
 {
   this->Label =
     cm::make_unique<cmCursesLabelWidget>(this->LabelWidth, 1, 1, 1, key);
-  this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, " ");
+  this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(3, 1, 1, 1, "   ");
   this->Entry =
     cm::make_unique<cmCursesStringWidget>(this->EntryWidth, 1, 1, 1);
 }
@@ -44,9 +44,9 @@
   this->Label =
     cm::make_unique<cmCursesLabelWidget>(this->LabelWidth, 1, 1, 1, key);
   if (isNew) {
-    this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, "*");
+    this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(3, 1, 1, 1, " * ");
   } else {
-    this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(1, 1, 1, 1, " ");
+    this->IsNewLabel = cm::make_unique<cmCursesLabelWidget>(3, 1, 1, 1, "   ");
   }
 
   cmValue value = state->GetCacheEntryValue(key);
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index cd42fb2..8ca456d 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -72,6 +72,9 @@
 // Create new cmCursesCacheEntryComposite entries from the cache
 void cmCursesMainForm::InitializeUI()
 {
+  // Hide the cursor by default
+  curs_set(0);
+
   // Create a vector of cmCursesCacheEntryComposite's
   // which contain labels, entries and new entry markers
   std::vector<cmCursesCacheEntryComposite> newEntries;
@@ -271,7 +274,7 @@
         this->NumberOfPages++;
       }
       entry.Label->Move(left, top + row - 1, isNewPage);
-      entry.IsNewLabel->Move(left + 32, top + row - 1, false);
+      entry.IsNewLabel->Move(left + 30, top + row - 1, false);
       entry.Entry->Move(left + 33, top + row - 1, false);
       entry.Entry->SetPage(this->NumberOfPages);
       i++;
@@ -424,8 +427,11 @@
   // Fields are grouped by 3, the first one being the label
   // so start at 0 and move up by 3 avoiding the last null entry
   for (size_type index = 0; index < this->Fields.size() - 1; index += 3) {
-    bool currentLabel = index == currentLabelIndex;
-    set_field_fore(this->Fields[index], currentLabel ? A_STANDOUT : A_NORMAL);
+    int attr = (index == currentLabelIndex) ? A_STANDOUT : A_NORMAL;
+    set_field_fore(this->Fields[index], attr);
+    set_field_back(this->Fields[index], attr);
+    set_field_fore(this->Fields[index + 1], attr);
+    set_field_back(this->Fields[index + 1], attr);
   }
 
   // Display CMake version under the status bar
@@ -658,6 +664,12 @@
   }
 }
 
+void cmCursesMainForm::SetSearchMode(bool enable)
+{
+  this->SearchMode = enable;
+  curs_set(enable);
+}
+
 void cmCursesMainForm::HandleInput()
 {
   int x = 0;
@@ -710,7 +722,7 @@
 
     if (this->SearchMode) {
       if (key == 10 || key == KEY_ENTER) {
-        this->SearchMode = false;
+        this->SetSearchMode(false);
         if (!this->SearchString.empty()) {
           this->JumpToCacheEntry(this->SearchString.c_str());
           this->OldSearchString = this->SearchString;
@@ -836,9 +848,10 @@
             curField, "HELPSTRING");
         }
         if (helpString) {
-          this->HelpMessage[1] =
-            cmStrCat("Current option is: ", curField, '\n',
-                     "Help string for this option is: ", *helpString, '\n');
+          this->HelpMessage[1] = cmStrCat("Current option is: ", curField,
+                                          "\n"
+                                          "Help string for this option is: ",
+                                          *helpString, '\n');
         } else {
           this->HelpMessage[1] = "";
         }
@@ -865,7 +878,7 @@
         CurrentForm = this;
         this->Render(1, 1, x, y);
       } else if (key == '/') {
-        this->SearchMode = true;
+        this->SetSearchMode(true);
         this->UpdateStatusBar("Search");
         this->PrintKeys(1);
         touchwin(stdscr);
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index d92b6c2..d7695b7 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -63,6 +63,8 @@
     MAX_WIDTH = 512
   };
 
+  void SetSearchMode(bool enable);
+
   /**
    * This method should normally be called only by the form.  The only
    * exception is during a resize. The optional argument specifies the
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index d472236..eb801ca 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -32,6 +32,12 @@
   field_opts_off(this->Field, O_STATIC);
 }
 
+void cmCursesStringWidget::SetInEdit(bool inedit)
+{
+  this->InEdit = inedit;
+  curs_set(inedit);
+}
+
 void cmCursesStringWidget::OnTab(cmCursesMainForm* /*unused*/,
                                  WINDOW* /*unused*/)
 {
@@ -42,7 +48,7 @@
 {
   if (this->InEdit) {
     cmCursesForm::LogMessage("String widget leaving edit.");
-    this->InEdit = false;
+    this->SetInEdit(false);
     fm->PrintKeys();
     this->OriginalString.clear();
     // trick to force forms to update the field buffer
@@ -52,7 +58,7 @@
     this->Done = true;
   } else {
     cmCursesForm::LogMessage("String widget entering edit.");
-    this->InEdit = true;
+    this->SetInEdit(true);
     fm->PrintKeys();
     this->OriginalString = field_buffer(this->Field, 0);
   }
@@ -114,7 +120,7 @@
     } else if (key == KEY_DOWN || key == ctrl('n') || key == KEY_UP ||
                key == ctrl('p') || key == KEY_NPAGE || key == ctrl('d') ||
                key == KEY_PPAGE || key == ctrl('u')) {
-      this->InEdit = false;
+      this->SetInEdit(false);
       this->OriginalString.clear();
       // trick to force forms to update the field buffer
       form_driver(form, REQ_NEXT_FIELD);
@@ -124,7 +130,7 @@
     // esc
     else if (key == 27) {
       if (this->InEdit) {
-        this->InEdit = false;
+        this->SetInEdit(false);
         fm->PrintKeys();
         this->SetString(this->OriginalString);
         this->OriginalString.clear();
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index 6d94369..e0ee897 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -40,7 +40,7 @@
    * Set/Get InEdit flag. Can be used to tell the widget to leave
    * edit mode (in case of a resize for example).
    */
-  void SetInEdit(bool inedit) { this->InEdit = inedit; }
+  void SetInEdit(bool inedit);
   bool GetInEdit() { return this->InEdit; }
 
   /**
diff --git a/Source/Modules/CMakeBuildUtilities.cmake b/Source/Modules/CMakeBuildUtilities.cmake
index dba9d50..44cde84 100644
--- a/Source/Modules/CMakeBuildUtilities.cmake
+++ b/Source/Modules/CMakeBuildUtilities.cmake
@@ -21,7 +21,6 @@
 set(KWSYS_USE_MD5 1)
 set(KWSYS_USE_Process 1)
 set(KWSYS_USE_CommandLineArguments 1)
-set(KWSYS_USE_ConsoleBuf 1)
 set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
 set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
 if(CMake_NO_CXX_STANDARD)
@@ -42,7 +41,6 @@
   set(KWSYS_CXX_HAS_UTIMES_COMPILED 0)
   set(KWSYS_CXX_STAT_HAS_ST_MTIM_COMPILED 0)
   set(KWSYS_CXX_STAT_HAS_ST_MTIMESPEC_COMPILED 0)
-  set(KWSYS_STL_HAS_WSTRING_COMPILED 1)
   set(KWSYS_SYS_HAS_IFADDRS_H 0)
 endif()
 add_subdirectory(Source/kwsys)
@@ -80,10 +78,6 @@
 add_subdirectory(Utilities/std)
 CMAKE_SET_TARGET_FOLDER(cmstd "Utilities/std")
 
-# check for the use of system libraries versus builtin ones
-# (a macro defined in this file)
-CMAKE_HANDLE_SYSTEM_LIBRARIES()
-
 if(CMAKE_USE_SYSTEM_KWIML)
   find_package(KWIML 1.0)
   if(NOT KWIML_FOUND)
@@ -230,7 +224,7 @@
 if(NOT CMAKE_USE_SYSTEM_LIBARCHIVE)
   if(CMAKE_USE_SYSTEM_LIBLZMA)
     find_package(LibLZMA)
-    if(NOT LIBLZMA_FOUND)
+    if(NOT LibLZMA_FOUND)
       message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBLZMA is ON but LibLZMA is not found!")
     endif()
   else()
@@ -358,7 +352,7 @@
   if(UNIX)
     set(CURSES_NEED_NCURSES TRUE)
     find_package(Curses)
-    if(NOT CURSES_FOUND)
+    if(NOT Curses_FOUND)
       message(WARNING
         "'ccmake' will not be built because Curses was not found.\n"
         "Turn off BUILD_CursesDialog to suppress this message."
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 318849e..7f9e7f0 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -13,25 +13,26 @@
   STRING "Expected Qt major version. Valid values are A (auto-select), 5, 6.")
 set(SUPPORTED_QT_VERSIONS "A" 5 6)
 set_property(CACHE CMake_QT_MAJOR_VERSION PROPERTY STRINGS ${SUPPORTED_QT_VERSIONS})
+# Select a Qt version and store it in a normal variable of the same name.
 if(NOT CMake_QT_MAJOR_VERSION STREQUAL "A")
   if(NOT CMake_QT_MAJOR_VERSION IN_LIST SUPPORTED_QT_VERSIONS)
     message(FATAL_ERROR "Supported Qt versions are \"${SUPPORTED_QT_VERSIONS}\"."
             " But CMake_QT_MAJOR_VERSION is set to ${CMake_QT_MAJOR_VERSION}.")
   endif()
-  set(INSTALLED_QT_VERSION ${CMake_QT_MAJOR_VERSION})
+  set(CMake_QT_MAJOR_VERSION "${CMake_QT_MAJOR_VERSION}")
 else()
   find_package(Qt6Widgets QUIET)
-  set(INSTALLED_QT_VERSION 6)
+  set(CMake_QT_MAJOR_VERSION 6)
   if(NOT Qt6Widgets_FOUND)
     find_package(Qt5Widgets QUIET)
     if(NOT Qt5Widgets_FOUND)
       message(FATAL_ERROR "Could not find a valid Qt installation.")
     endif()
-    set(INSTALLED_QT_VERSION 5)
+    set(CMake_QT_MAJOR_VERSION 5)
   endif()
 endif()
 
-find_package(Qt${INSTALLED_QT_VERSION}
+find_package(Qt${CMake_QT_MAJOR_VERSION}
     COMPONENTS ${QT_COMPONENTS}
     REQUIRED QUIET
 )
@@ -40,10 +41,10 @@
 
 # Try to find the package WinExtras for the task bar progress
 if(WIN32)
-  find_package(Qt${INSTALLED_QT_VERSION}WinExtras QUIET)
-  if(Qt${INSTALLED_QT_VERSION}WinExtras_FOUND)
+  find_package(Qt${CMake_QT_MAJOR_VERSION}WinExtras QUIET)
+  if(Qt${CMake_QT_MAJOR_VERSION}WinExtras_FOUND)
     add_compile_definitions(QT_WINEXTRAS)
-    list(APPEND CMake_QT_EXTRA_LIBRARIES Qt${INSTALLED_QT_VERSION}::WinExtras)
+    list(APPEND CMake_QT_EXTRA_LIBRARIES Qt${CMake_QT_MAJOR_VERSION}::WinExtras)
     list(APPEND QT_COMPONENTS WinExtras)
   endif()
 endif()
@@ -53,7 +54,7 @@
   add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
 endif()
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt${INSTALLED_QT_VERSION}Widgets_EXECUTABLE_COMPILE_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt${CMake_QT_MAJOR_VERSION}Widgets_EXECUTABLE_COMPILE_FLAGS}")
 
 if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES)
   list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES})
@@ -70,7 +71,7 @@
 # We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows.
 if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32))
   function(_qt_get_plugin_name_with_version target out_var)
-      string(REGEX REPLACE "^Qt::(.+)" "Qt${INSTALLED_QT_VERSION}::\\1"
+      string(REGEX REPLACE "^Qt::(.+)" "Qt${CMake_QT_MAJOR_VERSION}::\\1"
              qt_plugin_with_version "${target}")
       if(TARGET "${qt_plugin_with_version}")
           set("${out_var}" "${qt_plugin_with_version}" PARENT_SCOPE)
@@ -106,23 +107,23 @@
   endmacro()
   macro(install_qt_plugins _comps _plugins_var)
     foreach(_qt_comp IN LISTS ${_comps})
-      if(INSTALLED_QT_VERSION VERSION_LESS 6)
-        set(_qt_module_plugins ${Qt${INSTALLED_QT_VERSION}${_qt_comp}_PLUGINS})
+      if(CMake_QT_MAJOR_VERSION VERSION_LESS 6)
+        set(_qt_module_plugins ${Qt${CMake_QT_MAJOR_VERSION}${_qt_comp}_PLUGINS})
       else()
-        get_target_property(_qt_module_plugins Qt${INSTALLED_QT_VERSION}::${_qt_comp} QT_PLUGINS)
+        get_target_property(_qt_module_plugins Qt${CMake_QT_MAJOR_VERSION}::${_qt_comp} QT_PLUGINS)
       endif()
       foreach(_qt_plugin IN LISTS _qt_module_plugins)
-        if(INSTALLED_QT_VERSION VERSION_GREATER_EQUAL 6)
+        if(CMake_QT_MAJOR_VERSION VERSION_GREATER_EQUAL 6)
           # Qt6 provides the plugins as individual packages that need to be found.
-          find_package(Qt${INSTALLED_QT_VERSION}${_qt_plugin} QUIET
-            PATHS ${Qt${INSTALLED_QT_VERSION}${_qt_comp}_DIR})
+          find_package(Qt${CMake_QT_MAJOR_VERSION}${_qt_plugin} QUIET
+            PATHS ${Qt${CMake_QT_MAJOR_VERSION}${_qt_comp}_DIR})
         endif()
         install_qt_plugin("${_qt_plugin}" "${_plugins_var}")
       endforeach()
     endforeach()
   endmacro()
   if(APPLE)
-    if(INSTALLED_QT_VERSION VERSION_EQUAL 5)
+    if(CMake_QT_MAJOR_VERSION VERSION_EQUAL 5)
       install_qt_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS)
       if(TARGET Qt5::QMacStylePlugin)
         install_qt_plugin("Qt5::QMacStylePlugin" QT_PLUGINS)
@@ -137,7 +138,7 @@
       DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources"
       ${COMPONENT})
   elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES)
-    if(INSTALLED_QT_VERSION VERSION_EQUAL 5)
+    if(CMake_QT_MAJOR_VERSION VERSION_EQUAL 5)
       install_qt_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS)
     else()
       # FIXME: Minimize plugins for Qt6.
@@ -151,7 +152,7 @@
   endif()
 endif()
 
-get_property(_Qt_Core_LOCATION TARGET Qt${INSTALLED_QT_VERSION}::Core PROPERTY LOCATION)
+get_property(_Qt_Core_LOCATION TARGET Qt${CMake_QT_MAJOR_VERSION}::Core PROPERTY LOCATION)
 get_filename_component(Qt_BIN_DIR "${_Qt_Core_LOCATION}" PATH)
 if(APPLE)
   get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
@@ -194,8 +195,8 @@
   PUBLIC
     CMakeLib
     ${CMake_QT_EXTRA_LIBRARIES}
-    Qt${INSTALLED_QT_VERSION}::Core
-    Qt${INSTALLED_QT_VERSION}::Widgets
+    Qt${CMake_QT_MAJOR_VERSION}::Core
+    Qt${CMake_QT_MAJOR_VERSION}::Widgets
   )
 
 set(UI_SRCS
@@ -223,7 +224,7 @@
   )
 set(QRC_SRCS CMakeSetup.qrc)
 
-if(INSTALLED_QT_VERSION VERSION_LESS 6)
+if(CMake_QT_MAJOR_VERSION VERSION_LESS 6)
   qt5_wrap_ui(UI_BUILT_SRCS ${UI_SRCS})
   qt5_wrap_cpp(MOC_BUILT_SRCS ${MOC_SRCS})
   qt5_add_resources(QRC_BUILT_SRCS ${QRC_SRCS})
@@ -263,13 +264,14 @@
   )
 
 add_executable(cmake-gui WIN32 MACOSX_BUNDLE CMakeGUIExec.cxx)
+set_property(TARGET cmake-gui PROPERTY CMake_QT_MAJOR_VERSION "${CMake_QT_MAJOR_VERSION}")
 target_link_libraries(cmake-gui
   PRIVATE
     CMakeGUIMainLib
     CMakeGUIQRCLib
     $<TARGET_NAME_IF_EXISTS:CMakeVersion>
     ManifestLib
-    Qt${INSTALLED_QT_VERSION}::Core
+    Qt${CMake_QT_MAJOR_VERSION}::Core
   )
 
 if(WIN32)
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 234b587..cf32461 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -18,6 +18,7 @@
 #include "cmAlgorithms.h"
 #include "cmDocumentation.h"
 #include "cmDocumentationEntry.h"
+#include "cmStdIoInit.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h" // IWYU pragma: keep
 #include "cmake.h"
@@ -66,7 +67,8 @@
 
 int main(int argc, char** argv)
 {
-  cmSystemTools::EnsureStdPipes();
+  cm::StdIo::Init();
+
   cmsys::Encoding::CommandLineArguments encoding_args =
     cmsys::Encoding::CommandLineArguments::Main(argc, argv);
   int argc2 = encoding_args.argc();
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index c3aaba0..34e9c9f 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -275,6 +275,8 @@
   QObject::connect(this->BrowseSourceDirectoryButton,
                    &QAbstractButton::clicked, this,
                    &CMakeSetupDialog::doSourceBrowse);
+  QObject::connect(this->ReloadPresetsButton, &QAbstractButton::clicked,
+                   this->CMakeThread->cmakeInstance(), &QCMake::loadPresets);
   QObject::connect(this->BrowseBinaryDirectoryButton,
                    &QAbstractButton::clicked, this,
                    &CMakeSetupDialog::doBinaryBrowse);
diff --git a/Source/QtDialog/CMakeSetupDialog.ui b/Source/QtDialog/CMakeSetupDialog.ui
index c17c414..0289b0a 100644
--- a/Source/QtDialog/CMakeSetupDialog.ui
+++ b/Source/QtDialog/CMakeSetupDialog.ui
@@ -74,6 +74,13 @@
        </property>
       </widget>
      </item>
+     <item row="1" column="2">
+      <widget class="QPushButton" name="ReloadPresetsButton">
+       <property name="text">
+        <string>Reload &amp;presets</string>
+       </property>
+      </widget>
+     </item>
      <item row="2" column="0">
       <widget class="QLabel" name="BinaryLabel">
        <property name="text">
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 790c008..baf8fbd 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -64,17 +64,6 @@
   for (cmake::GeneratorInfo const& gen : generators) {
     this->AvailableGenerators.push_back(gen);
   }
-
-  connect(&this->LoadPresetsTimer, &QTimer::timeout, this, [this]() {
-    this->loadPresets();
-    if (!this->PresetName.isEmpty() &&
-        this->CMakePresetsGraph.ConfigurePresets.find(
-          std::string(this->PresetName.toStdString())) ==
-          this->CMakePresetsGraph.ConfigurePresets.end()) {
-      this->setPreset(QString{});
-    }
-  });
-  this->LoadPresetsTimer.start(1000);
 }
 
 QCMake::~QCMake() = default;
@@ -321,8 +310,8 @@
   InterruptFlag = 0;
   cmSystemTools::ResetErrorOccurredFlag();
 
-  auto successful =
-    this->CMakeInstance->Open(this->BinaryDirectory.toStdString(), false);
+  auto successful = this->CMakeInstance->Open(
+    this->BinaryDirectory.toStdString(), cmake::DryRun::No);
 
 #ifdef Q_OS_WIN
   SetErrorMode(lastErrorMode);
@@ -573,13 +562,12 @@
 {
   auto result = this->CMakePresetsGraph.ReadProjectPresets(
     this->SourceDirectory.toStdString(), true);
-  if (result != this->LastLoadPresetsResult && !result) {
+  if (!result) {
     emit this->presetLoadError(
       this->SourceDirectory,
       QString::fromStdString(
         this->CMakePresetsGraph.parseState.GetErrorMessage(false)));
   }
-  this->LastLoadPresetsResult = result;
 
   QVector<QCMakePreset> presets;
   for (auto const& name : this->CMakePresetsGraph.ConfigurePresetOrder) {
@@ -727,6 +715,6 @@
 void QCMake::checkOpenPossible()
 {
   std::string data = this->BinaryDirectory.toStdString();
-  auto possible = this->CMakeInstance->Open(data, true);
+  auto possible = this->CMakeInstance->Open(data, cmake::DryRun::Yes);
   emit openPossible(possible);
 }
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 7eb8bc7..50305f9 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -124,6 +124,8 @@
   void setWarnUninitializedMode(bool value);
   /// check if project IDE open is possible and emit openPossible signal
   void checkOpenPossible();
+  /// Reload the preset files and tree
+  void loadPresets();
 
 public:
   /// get the list of cache properties
@@ -193,8 +195,6 @@
   void stderrCallback(std::string const& msg);
   void setUpEnvironment() const;
 
-  void loadPresets();
-
   bool WarnUninitializedMode;
   QString SourceDirectory;
   QString BinaryDirectory;
@@ -204,11 +204,9 @@
   QString Toolset;
   std::vector<cmake::GeneratorInfo> AvailableGenerators;
   cmCMakePresetsGraph CMakePresetsGraph;
-  bool LastLoadPresetsResult = true;
   QString PresetName;
   QString CMakeExecutable;
   QAtomicInt InterruptFlag;
   QProcessEnvironment StartEnvironment;
   QProcessEnvironment Environment;
-  QTimer LoadPresetsTimer;
 };
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index c9fbc26..8d4e295 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -187,7 +187,7 @@
 
 QCMakeCacheModel::~QCMakeCacheModel() = default;
 
-static uint qHash(QCMakeProperty const& p)
+static size_t qHash(QCMakeProperty const& p)
 {
   return qHash(p.Key);
 }
@@ -349,7 +349,7 @@
 
   QCMakePropertyList props = this->properties();
   QCMakePropertyList oldProps;
-  int numNew = this->NewPropertyCount;
+  cm_qsizetype numNew = this->NewPropertyCount;
   cm_qsizetype numTotal = props.count();
   for (cm_qsizetype i = numNew; i < numTotal; i++) {
     oldProps.append(props[i]);
@@ -530,7 +530,7 @@
   return this->EditEnabled;
 }
 
-int QCMakeCacheModel::newPropertyCount() const
+cm_qsizetype QCMakeCacheModel::newPropertyCount() const
 {
   return this->NewPropertyCount;
 }
diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h
index 6e28670..8d2c742 100644
--- a/Source/QtDialog/QCMakeCacheView.h
+++ b/Source/QtDialog/QCMakeCacheView.h
@@ -3,6 +3,7 @@
 #pragma once
 
 #include "QCMake.h"
+#include "QCMakeSizeType.h"
 #include <QItemDelegate>
 #include <QSet>
 #include <QStandardItemModel>
@@ -99,7 +100,7 @@
   bool editEnabled() const;
 
   // returns how many new properties there are
-  int newPropertyCount() const;
+  cm_qsizetype newPropertyCount() const;
 
   // return flags (overloaded to modify flag based on EditEnabled flag)
   Qt::ItemFlags flags(QModelIndex const& index) const;
@@ -114,7 +115,7 @@
 
 protected:
   bool EditEnabled;
-  int NewPropertyCount;
+  cm_qsizetype NewPropertyCount;
   bool ShowNewProperties;
   ViewType View;
 
diff --git a/Source/QtDialog/QCMakePresetItemModel.cxx b/Source/QtDialog/QCMakePresetItemModel.cxx
index dbc2ee8..cb4e4fe 100644
--- a/Source/QtDialog/QCMakePresetItemModel.cxx
+++ b/Source/QtDialog/QCMakePresetItemModel.cxx
@@ -83,7 +83,8 @@
   if (this->m_presets.empty()) {
     return 1;
   }
-  return this->m_presets.size() + 2;
+  // NOLINTNEXTLINE(readability-redundant-casting)
+  return static_cast<int>(this->m_presets.size() + 2);
 }
 
 int QCMakePresetItemModel::columnCount(QModelIndex const& parent) const
@@ -144,5 +145,6 @@
     index++;
   }
 
-  return this->m_presets.size() + 1;
+  // NOLINTNEXTLINE(readability-redundant-casting)
+  return static_cast<int>(this->m_presets.size() + 1);
 }
diff --git a/Source/QtDialog/WarningMessagesDialog.cxx b/Source/QtDialog/WarningMessagesDialog.cxx
index 8cf4077..a0c72d4 100644
--- a/Source/QtDialog/WarningMessagesDialog.cxx
+++ b/Source/QtDialog/WarningMessagesDialog.cxx
@@ -26,21 +26,23 @@
 
 void WarningMessagesDialog::setupSignals()
 {
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
+  static auto const checkStateChanged = &QCheckBox::checkStateChanged;
+#else
+  static auto const checkStateChanged = &QCheckBox::stateChanged;
+#endif
   QObject::connect(this->buttonBox, &QDialogButtonBox::accepted, this,
                    &WarningMessagesDialog::doAccept);
-
-  QObject::connect(this->suppressDeveloperWarnings, &QCheckBox::stateChanged,
-                   this,
+  QObject::connect(this->suppressDeveloperWarnings, checkStateChanged, this,
                    &WarningMessagesDialog::doSuppressDeveloperWarningsChanged);
   QObject::connect(
-    this->suppressDeprecatedWarnings, &QCheckBox::stateChanged, this,
+    this->suppressDeprecatedWarnings, checkStateChanged, this,
     &WarningMessagesDialog::doSuppressDeprecatedWarningsChanged);
 
-  QObject::connect(this->developerWarningsAsErrors, &QCheckBox::stateChanged,
-                   this,
+  QObject::connect(this->developerWarningsAsErrors, checkStateChanged, this,
                    &WarningMessagesDialog::doDeveloperWarningsAsErrorsChanged);
   QObject::connect(
-    this->deprecatedWarningsAsErrors, &QCheckBox::stateChanged, this,
+    this->deprecatedWarningsAsErrors, checkStateChanged, this,
     &WarningMessagesDialog::doDeprecatedWarningsAsErrorsChanged);
 }
 
diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx
index 587e2c7..bbcb0bc 100644
--- a/Source/bindexplib.cxx
+++ b/Source/bindexplib.cxx
@@ -254,7 +254,8 @@
            */
           if (pSymbolTable->N.Name.Short != 0) {
             symbol.clear();
-            symbol.insert(0, (char const*)pSymbolTable->N.ShortName, 8);
+            symbol.insert(0, (char const*)pSymbolTable->N.ShortName,
+                          strnlen((char const*)pSymbolTable->N.ShortName, 8));
           } else {
             symbol = stringTable + pSymbolTable->N.Name.Long;
           }
@@ -289,9 +290,11 @@
               symbol.compare(0, 4, vectorPrefix)) {
             SectChar = this->SectionHeaders[pSymbolTable->SectionNumber - 1]
                          .Characteristics;
-            // skip symbols containing a dot or are from managed code
+            // Skip symbols containing a dot, are from managed code,
+            // or are C++ operators incorrectly declared extern "C".
             if (symbol.find('.') == std::string::npos &&
-                !SymbolIsFromManagedCode(symbol)) {
+                !SymbolIsFromManagedCode(symbol) &&
+                !SymbolIsOperatorExternC(symbol)) {
               // skip arm64ec thunk symbols
               if (this->SymbolArch != Arch::ARM64EC ||
                   (symbol.find("$ientry_thunk") == std::string::npos &&
@@ -336,6 +339,12 @@
       symbol.find("$$J") != std::string::npos;
   }
 
+  bool SymbolIsOperatorExternC(std::string const& symbol)
+  {
+    return symbol.find_first_not_of("=<>+-*/%,?|~!^&[]()") ==
+      std::string::npos;
+  }
+
   std::set<std::string>& Symbols;
   std::set<std::string>& DataSymbols;
   DWORD_PTR SymbolCount;
@@ -469,7 +478,7 @@
       // check for /bigobj and llvm LTO format
       cmANON_OBJECT_HEADER_BIGOBJ* h =
         (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase;
-      if (h->Sig1 == 0x0 && h->Sig2 == 0xffff) {
+      if (h->Sig1 == 0x0 && h->Sig2 == 0xffff && h->Version >= 2) {
         // bigobj
         DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX>
           symbolDumper(
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index cf938f7..ff85ed3 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -12,7 +12,7 @@
 bool cmAddDependenciesCommand(std::vector<std::string> const& args,
                               cmExecutionStatus& status)
 {
-  if (args.size() < 2) {
+  if (args.empty()) {
     status.SetError("called with incorrect number of arguments");
     return false;
   }
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 67ec3b9..842eb3b 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -237,7 +237,7 @@
             "ADD_LIBRARY called with ",
             (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE"),
             " option but the target platform does not support dynamic "
-            "linking. ",
+            "linking. "
             "Building a STATIC library instead. This may lead to problems."));
         CM_FALLTHROUGH;
       case cmPolicies::OLD:
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 0691182..db052d6 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -77,8 +77,9 @@
     if (!cmSystemTools::IsSubDirectory(srcPath,
                                        mf.GetCurrentSourceDirectory())) {
       status.SetError(
-        cmStrCat("not given a binary directory but the given source ",
-                 "directory \"", srcPath, "\" is not a subdirectory of \"",
+        cmStrCat("not given a binary directory but the given source "
+                 "directory \"",
+                 srcPath, "\" is not a subdirectory of \"",
                  mf.GetCurrentSourceDirectory(),
                  "\".  When specifying an "
                  "out-of-tree source a binary directory must be explicitly "
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 28b4b53..f2579e3 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -152,7 +152,7 @@
       }
       doing = DoingNone;
     } else {
-      status.SetError(cmStrCat(" given unknown argument:\n  ", args[i], "\n"));
+      status.SetError(cmStrCat(" given unknown argument:\n  ", args[i], '\n'));
       return false;
     }
   }
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 0828dcb..321cddf 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -39,21 +39,13 @@
 static void cm_archive_entry_copy_pathname(struct archive_entry* e,
                                            std::string const& dest)
 {
-#if cmsys_STL_HAS_WSTRING
   archive_entry_copy_pathname_w(e, cmsys::Encoding::ToWide(dest).c_str());
-#else
-  archive_entry_copy_pathname(e, dest.c_str());
-#endif
 }
 
 static void cm_archive_entry_copy_sourcepath(struct archive_entry* e,
                                              std::string const& file)
 {
-#if cmsys_STL_HAS_WSTRING
   archive_entry_copy_sourcepath_w(e, cmsys::Encoding::ToWide(file).c_str());
-#else
-  archive_entry_copy_sourcepath(e, file.c_str());
-#endif
 }
 
 class cmArchiveWrite::Entry
diff --git a/Source/cmArgumentParser.cxx b/Source/cmArgumentParser.cxx
index 5c4fc0d..104436b 100644
--- a/Source/cmArgumentParser.cxx
+++ b/Source/cmArgumentParser.cxx
@@ -84,7 +84,7 @@
         this->ParseResults->AddKeywordError(this->Keyword,
                                             "  empty string not allowed\n");
       }
-      val.assign(std::string(arg));
+      val = std::string(arg);
       return Continue::No;
     },
     ExpectAtLeast{ 1 });
@@ -94,7 +94,7 @@
 {
   this->Bind(
     [&val](cm::string_view arg) -> Continue {
-      static_cast<std::string&>(val) = std::string(arg);
+      val = std::string(arg);
       return Continue::No;
     },
     ExpectAtLeast{ 0 });
@@ -147,6 +147,24 @@
     return;
   }
 
+  if (!this->DoneWithPositional) {
+    auto const pit = this->Bindings.Positions.Find(pos);
+    if (pit != this->Bindings.Positions.end()) {
+      pit->second(*this, pos, arg);
+      return;
+    }
+
+    if (this->Bindings.TrailingArgs) {
+      this->Keyword = ""_s;
+      this->KeywordValuesSeen = 0;
+      this->DoneWithPositional = true;
+      this->Bindings.TrailingArgs(*this);
+      if (!this->KeywordValueFunc) {
+        return;
+      }
+    }
+  }
+
   if (this->KeywordValueFunc) {
     switch (this->KeywordValueFunc(arg)) {
       case Continue::Yes:
@@ -159,14 +177,6 @@
     return;
   }
 
-  if (!this->DoneWithPositional) {
-    auto const pit = this->Bindings.Positions.Find(pos);
-    if (pit != this->Bindings.Positions.end()) {
-      pit->second(*this, pos, arg);
-      return;
-    }
-  }
-
   if (this->UnparsedArguments) {
     this->UnparsedArguments->emplace_back(arg);
   }
@@ -174,7 +184,7 @@
 
 void Instance::FinishKeyword()
 {
-  if (this->Keyword.empty()) {
+  if (!this->DoneWithPositional) {
     return;
   }
   if (this->KeywordValuesSeen < this->KeywordValuesExpected) {
diff --git a/Source/cmArgumentParser.h b/Source/cmArgumentParser.h
index e8cd78e..223c3ce 100644
--- a/Source/cmArgumentParser.h
+++ b/Source/cmArgumentParser.h
@@ -113,6 +113,7 @@
   KeywordNameAction KeywordMissingValue;
   KeywordNameAction ParsedKeyword;
   PositionActionMap Positions;
+  KeywordAction TrailingArgs;
 };
 
 class Base
@@ -149,6 +150,12 @@
     this->Bindings.KeywordMissingValue = std::move(action);
   }
 
+  void BindTrailingArgs(KeywordAction action)
+  {
+    assert(!this->Bindings.TrailingArgs);
+    this->Bindings.TrailingArgs = std::move(action);
+  }
+
   void Bind(std::size_t pos, PositionAction action)
   {
     bool const inserted =
@@ -354,6 +361,18 @@
     return *this;
   }
 
+  template <typename T, typename cT = cm::member_pointer_class_t<T>,
+            typename mT = cm::remove_member_pointer_t<T>,
+            typename = cm::enable_if_t<std::is_base_of<cT, Result>::value>,
+            typename = cm::enable_if_t<!std::is_function<mT>::value>>
+  cmArgumentParser& BindTrailingArgs(T member)
+  {
+    this->Base::BindTrailingArgs([member](Instance& instance) {
+      instance.Bind(static_cast<Result*>(instance.Result)->*member);
+    });
+    return *this;
+  }
+
   template <typename Range>
   bool Parse(Result& result, Range const& args,
              std::vector<std::string>* unparsedArguments,
@@ -375,6 +394,11 @@
     this->Parse(result, args, unparsedArguments, pos);
     return result;
   }
+
+  bool HasKeyword(cm::string_view key) const
+  {
+    return this->Bindings.Keywords.Find(key) != this->Bindings.Keywords.end();
+  }
 };
 
 template <>
@@ -431,6 +455,14 @@
     return *this;
   }
 
+  template <typename T>
+  cmArgumentParser& BindTrailingArgs(T& ref)
+  {
+    this->Base::BindTrailingArgs(
+      [&ref](Instance& instance) { instance.Bind(ref); });
+    return *this;
+  }
+
   template <typename Range>
   ParseResult Parse(Range const& args,
                     std::vector<std::string>* unparsedArguments,
@@ -442,6 +474,11 @@
     return parseResult;
   }
 
+  bool HasKeyword(cm::string_view key) const
+  {
+    return this->Bindings.Keywords.Find(key) != this->Bindings.Keywords.end();
+  }
+
 protected:
   using Base::Instance;
   using Base::BindKeywordMissingValue;
diff --git a/Source/cmArgumentParserTypes.h b/Source/cmArgumentParserTypes.h
index b12cfc0..bd14f9b 100644
--- a/Source/cmArgumentParserTypes.h
+++ b/Source/cmArgumentParserTypes.h
@@ -17,6 +17,7 @@
 struct Maybe<std::string> : public std::string
 {
   using std::string::basic_string;
+  using std::string::operator=;
 };
 
 template <typename T>
@@ -26,12 +27,14 @@
 struct MaybeEmpty<std::vector<std::string>> : public std::vector<std::string>
 {
   using std::vector<std::string>::vector;
+  using std::vector<std::string>::operator=;
 };
 #  endif
 template <typename T>
 struct MaybeEmpty<std::vector<T>> : public std::vector<T>
 {
   using std::vector<T>::vector;
+  using std::vector<T>::operator=;
 };
 
 template <typename T>
@@ -40,11 +43,13 @@
 struct NonEmpty<std::vector<T>> : public std::vector<T>
 {
   using std::vector<T>::vector;
+  using std::vector<T>::operator=;
 };
 template <>
 struct NonEmpty<std::string> : public std::string
 {
   using std::string::basic_string;
+  using std::string::operator=;
 };
 
 } // namespace ArgumentParser
@@ -57,18 +62,21 @@
 struct Maybe : public T
 {
   using T::T;
+  using T::operator=;
 };
 
 template <typename T>
 struct MaybeEmpty : public T
 {
   using T::T;
+  using T::operator=;
 };
 
 template <typename T>
 struct NonEmpty : public T
 {
   using T::T;
+  using T::operator=;
 };
 
 } // namespace ArgumentParser
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index dca0538..d84418b 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -60,7 +60,7 @@
       doing = DoingNone;
       parallel = args[i];
     } else {
-      status.SetError(cmStrCat("unknown argument \"", args[i], "\""));
+      status.SetError(cmStrCat("unknown argument \"", args[i], '"'));
       return false;
     }
   }
diff --git a/Source/cmBuildDatabase.cxx b/Source/cmBuildDatabase.cxx
index c80e7fb..b25ca27 100644
--- a/Source/cmBuildDatabase.cxx
+++ b/Source/cmBuildDatabase.cxx
@@ -447,7 +447,7 @@
 
     bool isCXXModule = false;
     bool isPrivate = true;
-    if (sf->GetLanguage() != "CXX"_s) {
+    if (sf->GetLanguage() == "CXX"_s) {
       auto const* fs = gt->GetFileSetForSource(config, sf);
       if (fs && fs->GetType() == "CXX_MODULES"_s) {
         isCXXModule = true;
diff --git a/Source/cmCMakeLanguageCommand.cxx b/Source/cmCMakeLanguageCommand.cxx
index d1ec9cf..4f2d52e 100644
--- a/Source/cmCMakeLanguageCommand.cxx
+++ b/Source/cmCMakeLanguageCommand.cxx
@@ -220,7 +220,7 @@
   std::string const code =
     cmJoin(cmMakeRange(expandedArgs.begin() + 2, expandedArgs.end()), " ");
   return makefile.ReadListFileAsString(
-    code, cmStrCat(context.FilePath, ":", context.Line, ":EVAL"));
+    code, cmStrCat(context.FilePath, ':', context.Line, ":EVAL"));
 }
 
 bool cmCMakeLanguageCommandSET_DEPENDENCY_PROVIDER(
@@ -252,7 +252,7 @@
 
   if (!unparsed.empty()) {
     return FatalError(
-      status, cmStrCat("Unrecognized keyword: \"", unparsed.front(), "\""));
+      status, cmStrCat("Unrecognized keyword: \"", unparsed.front(), '"'));
   }
 
   // We store the command that FetchContent_MakeAvailable() can call in a
@@ -296,7 +296,7 @@
     } else {
       return FatalError(
         status,
-        cmStrCat("Unknown dependency provider method \"", method, "\""));
+        cmStrCat("Unknown dependency provider method \"", method, '"'));
     }
   }
 
@@ -467,7 +467,7 @@
         if (!defer.Directory) {
           return FatalError(status,
                             cmStrCat("DEFER DIRECTORY:\n  "_s, dir,
-                                     "\nis not known.  "_s,
+                                     "\nis not known.  "
                                      "It may not have been processed yet."_s));
         }
       } else if (expArgs[expArg] == "ID"_s) {
diff --git a/Source/cmCMakePathCommand.cxx b/Source/cmCMakePathCommand.cxx
index 187d7e8..c1da62d 100644
--- a/Source/cmCMakePathCommand.cxx
+++ b/Source/cmCMakePathCommand.cxx
@@ -174,7 +174,7 @@
 
   if (actions.find(action) == actions.end()) {
     status.SetError(
-      cmStrCat("GET called with an unknown action: ", action, "."));
+      cmStrCat("GET called with an unknown action: ", action, '.'));
     return false;
   }
 
@@ -609,7 +609,7 @@
 
   if (action != cmakePath && action != nativePath) {
     status.SetError(
-      cmStrCat("CONVERT called with an unknown action: ", action, "."));
+      cmStrCat("CONVERT called with an unknown action: ", action, '.'));
     return false;
   }
 
@@ -679,7 +679,7 @@
   auto const op = operators.find(args[2]);
   if (op == operators.end()) {
     status.SetError(cmStrCat(
-      "COMPARE called with an unknown comparison operator: ", args[2], "."));
+      "COMPARE called with an unknown comparison operator: ", args[2], '.'));
     return false;
   }
 
diff --git a/Source/cmCMakePkgConfigCommand.cxx b/Source/cmCMakePkgConfigCommand.cxx
index ae7b1d3..0d753bb 100644
--- a/Source/cmCMakePkgConfigCommand.cxx
+++ b/Source/cmCMakePkgConfigCommand.cxx
@@ -6,6 +6,7 @@
 #include <cstdio>
 #include <memory>
 #include <string>
+#include <unordered_map>
 #include <utility>
 #include <vector>
 
@@ -28,12 +29,15 @@
 #include "cmStringAlgorithms.h"
 #include "cmSubcommandTable.h"
 #include "cmSystemTools.h"
+#include "cmTarget.h"
 #include "cmValue.h"
 #include <cmllpkgc/llpkgc.h>
 
 // IWYU wants this
 namespace {
 struct ExtractArguments;
+struct PopulateArguments;
+struct ImportArguments;
 }
 
 namespace {
@@ -441,89 +445,59 @@
   *env.SysLibs += GetPkgConfSysLibs(mf);
 }
 
-cm::optional<cmPkgConfigResult> HandleCommon(CommonArguments& args,
-                                             cmExecutionStatus& status)
+struct ImportEnv
 {
+  bool required;
+  bool quiet;
+  bool exact;
+  bool err;
+  CommonArguments::StrictnessType strictness;
+  cmExecutionStatus& status;
+};
 
-  auto& mf = status.GetMakefile();
-
-  if (!args.CheckArgs(status)) {
-    return {};
+void warn_or_error(std::string const& err, ImportEnv& imEnv)
+{
+  if (imEnv.required) {
+    imEnv.status.SetError(err);
+    cmSystemTools::SetFatalErrorOccurred();
+  } else if (!imEnv.quiet) {
+    imEnv.status.GetMakefile().IssueMessage(MessageType::WARNING, err);
   }
+  imEnv.err = true;
+}
 
-  auto warn_or_error = [&](std::string const& err) {
-    if (args.Required) {
-      status.SetError(err);
-      cmSystemTools::SetFatalErrorOccurred();
-    } else if (!args.Quiet) {
-      mf.IssueMessage(MessageType::WARNING, err);
-    }
-  };
-
-  cm::filesystem::path path{ *args.Package };
-
-  cmPkgConfigEnv env;
-
-  if (args.PcLibdir) {
-    env.LibDirs = std::move(*args.PcLibdir);
-  }
-
-  if (args.PcPath) {
-    env.Path = std::move(*args.PcPath);
-  }
-
-  if (args.DisableUninstalled) {
-    env.DisableUninstalled = args.DisableUninstalled;
-  }
-
-  if (args.SysrootDir) {
-    env.SysrootDir = std::move(*args.SysrootDir);
-  }
-
-  if (args.TopBuildDir) {
-    env.TopBuildDir = std::move(*args.TopBuildDir);
-  }
-
-  CollectEnv(mf, env, args.EnvMode);
+cm::optional<cmPkgConfigResult> ReadPackage(std::string const& package,
+                                            ImportEnv& imEnv,
+                                            cmPkgConfigEnv& pcEnv)
+{
+  cm::optional<cmPkgConfigResult> result;
+  cm::filesystem::path path{ package };
 
   if (path.extension() == ".pc") {
     if (!cmSystemTools::FileExists(path.string())) {
-      warn_or_error(cmStrCat("Could not find '", *args.Package, "'"));
-      return {};
+      return result;
     }
   } else {
 
-    std::vector<std::string> search;
-    if (env.Path) {
-      search = *env.Path;
-      if (env.LibDirs) {
-        search += *env.LibDirs;
-      }
-    } else if (env.LibDirs) {
-      search = *env.LibDirs;
-    }
-
-    if (env.DisableUninstalled && !*env.DisableUninstalled) {
+    if (pcEnv.DisableUninstalled && !*pcEnv.DisableUninstalled) {
       auto uninstalled = path;
       uninstalled.concat("-uninstalled.pc");
       uninstalled =
-        cmSystemTools::FindFile(uninstalled.string(), search, true);
+        cmSystemTools::FindFile(uninstalled.string(), pcEnv.search, true);
       if (uninstalled.empty()) {
-        path =
-          cmSystemTools::FindFile(path.concat(".pc").string(), search, true);
+        path = cmSystemTools::FindFile(path.concat(".pc").string(),
+                                       pcEnv.search, true);
         if (path.empty()) {
-          warn_or_error(cmStrCat("Could not find '", *args.Package, "'"));
-          return {};
+          return result;
         }
       } else {
         path = uninstalled;
       }
     } else {
-      path =
-        cmSystemTools::FindFile(path.concat(".pc").string(), search, true);
+      path = cmSystemTools::FindFile(path.concat(".pc").string(), pcEnv.search,
+                                     true);
       if (path.empty()) {
-        warn_or_error(cmStrCat("Could not find '", *args.Package, "'"));
-        return {};
+        return result;
       }
     }
   }
@@ -534,8 +508,9 @@
   cmsys::ifstream ifs(path.string().c_str(), std::ios::binary);
 
   if (!ifs) {
-    warn_or_error(cmStrCat("Could not open file '", path.string(), "'"));
-    return {};
+    warn_or_error(cmStrCat("Could not open file '", path.string(), '\''),
+                  imEnv);
+    return result;
   }
 
   std::unique_ptr<char[]> buf(new char[len]);
@@ -543,8 +518,9 @@
 
   // Shouldn't have hit eof on previous read, should hit eof now
   if (ifs.fail() || ifs.eof() || ifs.get() != EOF) {
-    warn_or_error(cmStrCat("Error while reading file '", path.string(), "'"));
-    return {};
+    warn_or_error(cmStrCat("Error while reading file '", path.string(), '\''),
+                  imEnv);
+    return result;
   }
 
   using StrictnessType = CommonArguments::StrictnessType;
@@ -552,53 +528,161 @@
   cmPkgConfigParser parser;
   auto err = parser.Finish(buf.get(), len);
 
-  if (args.Strictness != StrictnessType::STRICTNESS_BEST_EFFORT &&
+  if (imEnv.strictness != StrictnessType::STRICTNESS_BEST_EFFORT &&
       err != PCE_OK) {
-    warn_or_error(cmStrCat("Parsing failed for file '", path.string(), "'"));
-    return {};
+    warn_or_error(cmStrCat("Parsing failed for file '", path.string(), '\''),
+                  imEnv);
+    return result;
   }
 
-  cm::optional<cmPkgConfigResult> result;
-  if (args.Strictness == StrictnessType::STRICTNESS_STRICT) {
-    result = cmPkgConfigResolver::ResolveStrict(parser.Data(), std::move(env));
-  } else if (args.Strictness == StrictnessType::STRICTNESS_PERMISSIVE) {
-    result =
-      cmPkgConfigResolver::ResolvePermissive(parser.Data(), std::move(env));
+  if (imEnv.strictness == StrictnessType::STRICTNESS_STRICT) {
+    result = cmPkgConfigResolver::ResolveStrict(parser.Data(), pcEnv);
+  } else if (imEnv.strictness == StrictnessType::STRICTNESS_PERMISSIVE) {
+    result = cmPkgConfigResolver::ResolvePermissive(parser.Data(), pcEnv);
   } else {
-    result =
-      cmPkgConfigResolver::ResolveBestEffort(parser.Data(), std::move(env));
+    result = cmPkgConfigResolver::ResolveBestEffort(parser.Data(), pcEnv);
   }
 
   if (!result) {
     warn_or_error(
-      cmStrCat("Resolution failed for file '", path.string(), "'"));
-  } else if (args.Exact) {
+      cmStrCat("Resolution failed for file '", path.string(), '\''), imEnv);
+  }
+
+  return result;
+}
+
+cm::optional<cmPkgConfigResult> ImportPackage(
+  std::string const& package, cm::optional<std::string> version,
+  ImportEnv& imEnv, cmPkgConfigEnv& pcEnv)
+{
+  auto result = ReadPackage(package, imEnv, pcEnv);
+
+  if (!result) {
+    if (!imEnv.err) {
+      warn_or_error(cmStrCat("Could not find pkg-config: '", package, '\''),
+                    imEnv);
+    }
+    return result;
+  }
+
+  if (imEnv.exact) {
     std::string ver;
 
-    if (args.Version) {
-      ver = cmPkgConfigResolver::ParseVersion(*args.Version).Version;
+    if (version) {
+      ver = cmPkgConfigResolver::ParseVersion(*version).Version;
     }
 
     if (ver != result->Version()) {
       warn_or_error(
-        cmStrCat("Package '", *args.Package, "' version '", result->Version(),
-                 "' does not meet exact version requirement '", ver, "'"));
+        cmStrCat("Package '", package, "' version '", result->Version(),
+                 "' does not meet exact version requirement '", ver, '\''),
+        imEnv);
       return {};
     }
 
-  } else if (args.Version) {
-    auto rv = cmPkgConfigResolver::ParseVersion(*args.Version);
+  } else if (version) {
+    auto rv = cmPkgConfigResolver::ParseVersion(*version);
     if (!cmPkgConfigResolver::CheckVersion(rv, result->Version())) {
       warn_or_error(
-        cmStrCat("Package '", *args.Package, "' version '", result->Version(),
-                 "' does not meet version requirement '", *args.Version, "'"));
+        cmStrCat("Package '", package, "' version '", result->Version(),
+                 "' does not meet version requirement '", *version, '\''),
+        imEnv);
       return {};
     }
   }
 
+  result->env = &pcEnv;
   return result;
 }
 
+struct pkgStackEntry
+{
+  cmPkgConfigVersionReq ver;
+  std::string parent;
+};
+
+cm::optional<cmPkgConfigResult> ImportPackage(
+  std::string const& package, std::vector<pkgStackEntry> const& reqs,
+  ImportEnv& imEnv, cmPkgConfigEnv& pcEnv)
+{
+  auto result = ReadPackage(package, imEnv, pcEnv);
+
+  if (!result) {
+    if (!imEnv.err) {
+      std::string req_str = cmStrCat('\'', reqs.begin()->parent, '\'');
+      for (auto it = reqs.begin() + 1; it != reqs.end(); ++it) {
+        req_str = cmStrCat(req_str, ", '", it->parent, '\'');
+      }
+      warn_or_error(cmStrCat("Could not find pkg-config: '", package,
+                             "' required by: ", req_str),
+                    imEnv);
+    }
+    return result;
+  }
+
+  auto ver = result->Version();
+  for (auto const& req : reqs) {
+
+    if (!cmPkgConfigResolver::CheckVersion(req.ver, ver)) {
+      warn_or_error(cmStrCat("Package '", package, "' version '", ver,
+                             "' does not meet version requirement '",
+                             req.ver.string(), "' of '", req.parent, '\''),
+                    imEnv);
+      return {};
+    }
+  }
+
+  result->env = &pcEnv;
+  return result;
+}
+
+cm::optional<std::pair<cmPkgConfigEnv, ImportEnv>> HandleCommon(
+  CommonArguments& args, cmExecutionStatus& status)
+{
+
+  auto& mf = status.GetMakefile();
+
+  if (!args.CheckArgs(status)) {
+    return {};
+  }
+
+  cmPkgConfigEnv pcEnv;
+
+  if (args.PcLibdir) {
+    pcEnv.LibDirs = std::move(*args.PcLibdir);
+  }
+
+  if (args.PcPath) {
+    pcEnv.Path = std::move(*args.PcPath);
+  }
+
+  pcEnv.DisableUninstalled = args.DisableUninstalled;
+
+  if (args.SysrootDir) {
+    pcEnv.SysrootDir = std::move(*args.SysrootDir);
+  }
+
+  if (args.TopBuildDir) {
+    pcEnv.TopBuildDir = std::move(*args.TopBuildDir);
+  }
+
+  CollectEnv(mf, pcEnv, args.EnvMode);
+
+  if (pcEnv.Path) {
+    pcEnv.search = *pcEnv.Path;
+    if (pcEnv.LibDirs) {
+      pcEnv.search += *pcEnv.LibDirs;
+    }
+  } else if (pcEnv.LibDirs) {
+    pcEnv.search = *pcEnv.LibDirs;
+  }
+
+  return std::pair<cmPkgConfigEnv, ImportEnv>{
+    pcEnv,
+    { args.Required, args.Quiet, args.Exact, false, args.Strictness, status }
+  };
+}
+
 struct ExtractArguments : CommonArguments
 {
   cm::optional<bool> AllowSystemIncludes;
@@ -623,35 +707,41 @@
 
   std::vector<std::string> unparsed;
   auto parsedArgs = ExtractParser.Parse(args, &unparsed);
-  auto maybeResolved = HandleCommon(parsedArgs, status);
+  auto maybeEnv = HandleCommon(parsedArgs, status);
 
-  if (!maybeResolved) {
+  if (!maybeEnv) {
     return !parsedArgs.Required;
   }
+  auto& pcEnv = maybeEnv->first;
+  auto& imEnv = maybeEnv->second;
 
-  auto& resolved = *maybeResolved;
-  auto version = resolved.Version();
+  auto maybePackage =
+    ImportPackage(*parsedArgs.Package, parsedArgs.Version, imEnv, pcEnv);
+  if (!maybePackage) {
+    return !parsedArgs.Required;
+  }
+  auto& package = *maybePackage;
 
   if (parsedArgs.AllowSystemIncludes) {
-    resolved.env.AllowSysCflags = *parsedArgs.AllowSystemIncludes;
+    pcEnv.AllowSysCflags = *parsedArgs.AllowSystemIncludes;
   }
 
   if (parsedArgs.AllowSystemLibs) {
-    resolved.env.AllowSysLibs = *parsedArgs.AllowSystemLibs;
+    pcEnv.AllowSysLibs = *parsedArgs.AllowSystemLibs;
   }
 
   if (parsedArgs.SystemIncludeDirs) {
-    resolved.env.SysCflags = *parsedArgs.SystemIncludeDirs;
+    pcEnv.SysCflags = *parsedArgs.SystemIncludeDirs;
   }
 
   if (parsedArgs.SystemLibraryDirs) {
-    resolved.env.SysLibs = *parsedArgs.SystemLibraryDirs;
+    pcEnv.SysLibs = *parsedArgs.SystemLibraryDirs;
   }
 
   auto& mf = status.GetMakefile();
-  mf.AddDefinition("CMAKE_PKG_CONFIG_NAME", resolved.Name());
-  mf.AddDefinition("CMAKE_PKG_CONFIG_DESCRIPTION", resolved.Description());
-  mf.AddDefinition("CMAKE_PKG_CONFIG_VERSION", version);
+  mf.AddDefinition("CMAKE_PKG_CONFIG_NAME", package.Name());
+  mf.AddDefinition("CMAKE_PKG_CONFIG_DESCRIPTION", package.Description());
+  mf.AddDefinition("CMAKE_PKG_CONFIG_VERSION", package.Version());
 
   auto make_list = [&](char const* def,
                        std::vector<cmPkgConfigDependency> const& deps) {
@@ -665,26 +755,26 @@
     mf.AddDefinition(def, cmList::to_string(vec));
   };
 
-  make_list("CMAKE_PKG_CONFIG_CONFLICTS", resolved.Conflicts());
-  make_list("CMAKE_PKG_CONFIG_PROVIDES", resolved.Provides());
-  make_list("CMAKE_PKG_CONFIG_REQUIRES", resolved.Requires());
-  make_list("CMAKE_PKG_CONFIG_REQUIRES_PRIVATE", resolved.Requires(true));
+  make_list("CMAKE_PKG_CONFIG_CONFLICTS", package.Conflicts());
+  make_list("CMAKE_PKG_CONFIG_PROVIDES", package.Provides());
+  make_list("CMAKE_PKG_CONFIG_REQUIRES", package.Requires());
+  make_list("CMAKE_PKG_CONFIG_REQUIRES_PRIVATE", package.Requires(true));
 
-  auto cflags = resolved.Cflags();
+  auto cflags = package.Cflags();
   mf.AddDefinition("CMAKE_PKG_CONFIG_CFLAGS", cflags.Flagline);
   mf.AddDefinition("CMAKE_PKG_CONFIG_INCLUDES",
                    cmList::to_string(cflags.Includes));
   mf.AddDefinition("CMAKE_PKG_CONFIG_COMPILE_OPTIONS",
                    cmList::to_string(cflags.CompileOptions));
 
-  cflags = resolved.Cflags(true);
+  cflags = package.Cflags(true);
   mf.AddDefinition("CMAKE_PKG_CONFIG_CFLAGS_PRIVATE", cflags.Flagline);
   mf.AddDefinition("CMAKE_PKG_CONFIG_INCLUDES_PRIVATE",
                    cmList::to_string(cflags.Includes));
   mf.AddDefinition("CMAKE_PKG_CONFIG_COMPILE_OPTIONS_PRIVATE",
                    cmList::to_string(cflags.CompileOptions));
 
-  auto libs = resolved.Libs();
+  auto libs = package.Libs();
   mf.AddDefinition("CMAKE_PKG_CONFIG_LIBS", libs.Flagline);
   mf.AddDefinition("CMAKE_PKG_CONFIG_LIBDIRS",
                    cmList::to_string(libs.LibDirs));
@@ -693,7 +783,7 @@
   mf.AddDefinition("CMAKE_PKG_CONFIG_LINK_OPTIONS",
                    cmList::to_string(libs.LinkOptions));
 
-  libs = resolved.Libs(true);
+  libs = package.Libs(true);
   mf.AddDefinition("CMAKE_PKG_CONFIG_LIBS_PRIVATE", libs.Flagline);
   mf.AddDefinition("CMAKE_PKG_CONFIG_LIBDIRS_PRIVATE",
                    cmList::to_string(libs.LibDirs));
@@ -704,6 +794,249 @@
 
   return true;
 }
+
+using pkgStack = std::unordered_map<std::string, std::vector<pkgStackEntry>>;
+using pkgProviders = std::unordered_map<std::string, std::string>;
+
+cmTarget* CreateCMakeTarget(std::string const& name, std::string const& prefix,
+                            cmPkgConfigResult& pkg, pkgProviders& providers,
+                            cmMakefile& mf)
+{
+  auto* tgt = mf.AddForeignTarget("pkgcfg", cmStrCat(prefix, name));
+
+  tgt->AppendProperty("VERSION", pkg.Version());
+
+  auto libs = pkg.Libs();
+  for (auto const& flag : libs.LibNames) {
+    tgt->AppendProperty("INTERFACE_LINK_LIBRARIES", flag.substr(2));
+  }
+  for (auto const& flag : libs.LibDirs) {
+    tgt->AppendProperty("INTERFACE_LINK_DIRECTORIES", flag.substr(2));
+  }
+  tgt->AppendProperty("INTERFACE_LINK_OPTIONS",
+                      cmList::to_string(libs.LinkOptions));
+
+  auto cflags = pkg.Cflags();
+  for (auto const& flag : cflags.Includes) {
+    tgt->AppendProperty("INTERFACE_INCLUDE_DIRECTORIES", flag.substr(2));
+  }
+  tgt->AppendProperty("INTERFACE_COMPILE_OPTIONS",
+                      cmList::to_string(cflags.CompileOptions));
+
+  for (auto& dep : pkg.Requires()) {
+    auto it = providers.find(dep.Name);
+    if (it != providers.end()) {
+      tgt->AppendProperty("INTERFACE_LINK_LIBRARIES", it->second);
+      continue;
+    }
+
+    tgt->AppendProperty("INTERFACE_LINK_LIBRARIES",
+                        cmStrCat("@foreign_pkgcfg::", prefix, dep.Name));
+  }
+  return tgt;
+}
+
+bool CheckPackageDependencies(
+  std::string const& name, std::string const& prefix, cmPkgConfigResult& pkg,
+  pkgStack& inStack,
+  std::unordered_map<std::string, cmPkgConfigResult>& outStack,
+  pkgProviders& providers, ImportEnv& imEnv)
+{
+  for (auto& dep : pkg.Requires()) {
+    auto prov_it = providers.find(dep.Name);
+    if (prov_it != providers.end()) {
+      continue;
+    }
+
+    auto* tgt = imEnv.status.GetMakefile().FindTargetToUse(
+      cmStrCat("@foreign_pkgcfg::", prefix, dep.Name),
+      cmStateEnums::TargetDomain::FOREIGN);
+    if (tgt) {
+      auto ver = tgt->GetProperty("VERSION");
+      if (!cmPkgConfigResolver::CheckVersion(dep.VerReq, *ver)) {
+        warn_or_error(cmStrCat("Package '", dep.Name, "' version '", *ver,
+                               "' does not meet version requirement '",
+                               dep.VerReq.string(), "' of '", name, '\''),
+                      imEnv);
+        return false;
+      }
+      continue;
+    }
+
+    auto it = outStack.find(dep.Name);
+    if (it != outStack.end()) {
+      auto ver = it->second.Version();
+      if (!cmPkgConfigResolver::CheckVersion(dep.VerReq, ver)) {
+        warn_or_error(cmStrCat("Package '", dep.Name, "' version '", ver,
+                               "' does not meet version requirement '",
+                               dep.VerReq.string(), "' of '", name, '\''),
+                      imEnv);
+        return false;
+      }
+      continue;
+    }
+
+    inStack[dep.Name].emplace_back(
+      pkgStackEntry{ std::move(dep.VerReq), name });
+  }
+
+  return true;
+}
+
+struct PopulateArguments : CommonArguments
+{
+  cm::optional<std::string> Prefix;
+  cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>> Providers;
+};
+
+#define BIND_POPULATE(argtype)                                                \
+  BIND_COMMON(argtype)                                                        \
+    .Bind("PREFIX"_s, &argtype::Prefix)                                       \
+    .Bind("BIND_PC_REQUIRES"_s, &argtype::Providers)
+
+auto const PopulateParser = BIND_POPULATE(PopulateArguments);
+
+std::pair<bool, bool> PopulatePCTarget(PopulateArguments& args,
+                                       cmExecutionStatus& status)
+{
+
+  std::string prefix = args.Prefix ? cmStrCat(*args.Prefix, "_"_s) : "";
+
+  auto& mf = status.GetMakefile();
+  auto maybeEnv = HandleCommon(args, status);
+
+  if (!maybeEnv) {
+    return { !args.Required, false };
+  }
+  auto& pcEnv = maybeEnv->first;
+  auto& imEnv = maybeEnv->second;
+
+  pcEnv.AllowSysCflags = true;
+  pcEnv.AllowSysLibs = true;
+
+  pkgProviders providers;
+  if (args.Providers) {
+    for (auto const& provider_str : *args.Providers) {
+      auto assignment = provider_str.find('=');
+      if (assignment != std::string::npos) {
+        providers.emplace(provider_str.substr(0, assignment),
+                          provider_str.substr(assignment + 1));
+      } else {
+        imEnv.status.SetError(cmStrCat(
+          "No '=' found in BIND_PC_REQUIRES argument '", provider_str, '\''));
+        cmSystemTools::SetFatalErrorOccurred();
+        return { false, false };
+      }
+    }
+  }
+
+  pkgStack inStack;
+  std::unordered_map<std::string, cmPkgConfigResult> outStack;
+
+  auto maybePackage = ImportPackage(*args.Package, args.Version, imEnv, pcEnv);
+  if (!maybePackage) {
+    return { !args.Required, false };
+  }
+  imEnv.exact = false;
+
+  if (!CheckPackageDependencies(*args.Package, prefix, *maybePackage, inStack,
+                                outStack, providers, imEnv)) {
+    return { !args.Required, false };
+  }
+  outStack[*args.Package] = std::move(*maybePackage);
+
+  while (!inStack.empty()) {
+    auto name = inStack.begin()->first;
+    auto reqs = inStack.begin()->second;
+    maybePackage = ImportPackage(name, reqs, imEnv, pcEnv);
+    if (!maybePackage) {
+      return { !args.Required, false };
+    }
+    if (!CheckPackageDependencies(name, prefix, *maybePackage, inStack,
+                                  outStack, providers, imEnv)) {
+      return { !args.Required, false };
+    }
+    inStack.erase(name);
+    outStack[std::move(name)] = std::move(*maybePackage);
+  }
+
+  for (auto& entry : outStack) {
+    CreateCMakeTarget(entry.first, prefix, entry.second, providers, mf);
+  }
+
+  return { true, true };
+}
+
+bool HandlePopulateCommand(std::vector<std::string> const& args,
+                           cmExecutionStatus& status)
+{
+  std::vector<std::string> unparsed;
+  auto parsedArgs = PopulateParser.Parse(args, &unparsed);
+
+  std::string prefix =
+    parsedArgs.Prefix ? cmStrCat(*parsedArgs.Prefix, "_"_s) : "";
+
+  auto foreign_name =
+    cmStrCat("@foreign_pkgcfg::", prefix, *parsedArgs.Package);
+  auto found_var = cmStrCat("PKGCONFIG_", *parsedArgs.Package, "_FOUND");
+
+  auto& mf = status.GetMakefile();
+
+  if (mf.FindTargetToUse(foreign_name, cmStateEnums::TargetDomain::FOREIGN)) {
+    mf.AddDefinition(found_var, "TRUE");
+    return true;
+  }
+
+  auto result = PopulatePCTarget(parsedArgs, status);
+  mf.AddDefinition(found_var, result.second ? "TRUE" : "FALSE");
+  return result.first;
+}
+
+struct ImportArguments : PopulateArguments
+{
+  cm::optional<std::string> Name;
+};
+
+auto const ImportParser =
+  BIND_POPULATE(ImportArguments).Bind("NAME"_s, &ImportArguments::Name);
+
+bool HandleImportCommand(std::vector<std::string> const& args,
+                         cmExecutionStatus& status)
+{
+  std::vector<std::string> unparsed;
+  auto parsedArgs = ImportParser.Parse(args, &unparsed);
+
+  std::string prefix =
+    parsedArgs.Prefix ? cmStrCat(*parsedArgs.Prefix, "_"_s) : "";
+
+  auto foreign_name =
+    cmStrCat("@foreign_pkgcfg::", prefix, *parsedArgs.Package);
+  auto local_name =
+    cmStrCat("PkgConfig::", parsedArgs.Name.value_or(*parsedArgs.Package));
+  auto found_var = cmStrCat("PKGCONFIG_", *parsedArgs.Package, "_FOUND");
+
+  auto& mf = status.GetMakefile();
+
+  if (mf.FindTargetToUse(local_name)) {
+    mf.AddDefinition(found_var, "TRUE");
+    return true;
+  }
+
+  if (!mf.FindTargetToUse(foreign_name, cmStateEnums::TargetDomain::FOREIGN)) {
+    auto result = PopulatePCTarget(parsedArgs, status);
+    if (!result.second) {
+      mf.AddDefinition(found_var, "FALSE");
+      return result.first;
+    }
+  }
+
+  mf.AddDefinition(found_var, "TRUE");
+  auto* tgt = mf.AddImportedTarget(
+    local_name, cmStateEnums::TargetType::INTERFACE_LIBRARY, false);
+  tgt->AppendProperty("INTERFACE_LINK_LIBRARIES", foreign_name);
+  return true;
+}
+
 } // namespace
 
 bool cmCMakePkgConfigCommand(std::vector<std::string> const& args,
@@ -716,6 +1049,8 @@
 
   static cmSubcommandTable const subcommand{
     { "EXTRACT"_s, HandleExtractCommand },
+    { "POPULATE"_s, HandlePopulateCommand },
+    { "IMPORT"_s, HandleImportCommand },
   };
 
   return subcommand(args[0], args, status);
diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx
index de50593..9b346d9 100644
--- a/Source/cmCMakePolicyCommand.cxx
+++ b/Source/cmCMakePolicyCommand.cxx
@@ -56,7 +56,7 @@
     return HandleGetWarningMode(args, status);
   }
 
-  status.SetError(cmStrCat("given unknown first argument \"", args[0], "\""));
+  status.SetError(cmStrCat("given unknown first argument \"", args[0], '"'));
   return false;
 }
 
@@ -77,7 +77,7 @@
     policyStatus = cmPolicies::NEW;
   } else {
     status.SetError(
-      cmStrCat("SET given unrecognized policy status \"", args[2], "\""));
+      cmStrCat("SET given unrecognized policy status \"", args[2], '"'));
     return false;
   }
 
diff --git a/Source/cmCMakePresetsErrors.cxx b/Source/cmCMakePresetsErrors.cxx
index 7a1450d..c77a528 100644
--- a/Source/cmCMakePresetsErrors.cxx
+++ b/Source/cmCMakePresetsErrors.cxx
@@ -40,8 +40,8 @@
 std::string getVariableName(cmJSONState* state)
 {
   std::string var = state->key_after("cacheVariables");
-  std::string errMsg = cmStrCat("variable \"", var, "\"");
-  errMsg = cmStrCat(errMsg, " for preset \"", getPresetName(state), "\"");
+  std::string errMsg = cmStrCat("variable \"", var, '"');
+  errMsg = cmStrCat(errMsg, " for preset \"", getPresetName(state), '"');
   return errMsg;
 }
 
@@ -82,7 +82,7 @@
 
 void INVALID_PRESET_NAMED(std::string const& presetName, cmJSONState* state)
 {
-  state->AddError(cmStrCat("Invalid preset: \"", presetName, "\""));
+  state->AddError(cmStrCat("Invalid preset: \"", presetName, '"'));
 }
 
 void INVALID_VARIABLE(Json::Value const* value, cmJSONState* state)
@@ -93,7 +93,7 @@
 
 void DUPLICATE_PRESETS(std::string const& presetName, cmJSONState* state)
 {
-  state->AddError(cmStrCat("Duplicate preset: \"", presetName, "\""));
+  state->AddError(cmStrCat("Duplicate preset: \"", presetName, '"'));
 }
 
 void CYCLIC_PRESET_INHERITANCE(std::string const& presetName,
@@ -101,7 +101,7 @@
 
 {
   state->AddError(
-    cmStrCat("Cyclic preset inheritance for preset \"", presetName, "\""));
+    cmStrCat("Cyclic preset inheritance for preset \"", presetName, '"'));
 }
 
 void INHERITED_PRESET_UNREACHABLE_FROM_FILE(std::string const& presetName,
@@ -120,7 +120,7 @@
 
 void INVALID_MACRO_EXPANSION(std::string const& presetName, cmJSONState* state)
 {
-  state->AddError(cmStrCat("Invalid macro expansion in \"", presetName, "\""));
+  state->AddError(cmStrCat("Invalid macro expansion in \"", presetName, '"'));
 }
 
 void BUILD_TEST_PRESETS_UNSUPPORTED(Json::Value const*, cmJSONState* state)
@@ -155,7 +155,7 @@
                               cmJSONState* state)
 {
   state->AddError(
-    cmStrCat(R"(Invalid "configurePreset": ")", presetName, "\""));
+    cmStrCat(R"(Invalid "configurePreset": ")", presetName, '"'));
 }
 
 void INSTALL_PREFIX_UNSUPPORTED(Json::Value const* value, cmJSONState* state)
@@ -197,13 +197,13 @@
 void INVALID_WORKFLOW_STEPS(std::string const& workflowStep,
                             cmJSONState* state)
 {
-  state->AddError(cmStrCat("Invalid workflow step \"", workflowStep, "\""));
+  state->AddError(cmStrCat("Invalid workflow step \"", workflowStep, '"'));
 }
 
 void NO_WORKFLOW_STEPS(std::string const& presetName, cmJSONState* state)
 {
   state->AddError(
-    cmStrCat("No workflow steps specified for \"", presetName, "\""));
+    cmStrCat("No workflow steps specified for \"", presetName, '"'));
 }
 
 void FIRST_WORKFLOW_STEP_NOT_CONFIGURE(std::string const& stepName,
@@ -273,7 +273,7 @@
 void INVALID_CONDITION(Json::Value const* value, cmJSONState* state)
 {
   state->AddErrorAtValue(
-    cmStrCat("Invalid condition for preset \"", getPresetName(state), "\""),
+    cmStrCat("Invalid condition for preset \"", getPresetName(state), '"'),
     value);
 }
 
@@ -282,7 +282,7 @@
 {
   return JsonErrors::INVALID_NAMED_OBJECT(
     [](Json::Value const*, cmJSONState* state) -> std::string {
-      return cmStrCat(" condition for preset \"", getPresetName(state), "\"");
+      return cmStrCat(" condition for preset \"", getPresetName(state), '"');
     })(errorType, extraFields);
 }
 
@@ -316,7 +316,7 @@
                           std::string const& missingField, cmJSONState* state)
 {
   state->AddError(cmStrCat("Preset \"", presetName, "\" missing field \"",
-                           missingField, "\""));
+                           missingField, '"'));
 }
 
 void SCHEMA_UNSUPPORTED(cmJSONState* state)
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 4647ad5..e7d34fd 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -25,7 +25,6 @@
 #include <cmext/algorithm>
 #include <cmext/string_view>
 
-#include <cm3p/curl/curl.h>
 #include <cm3p/json/value.h>
 #include <cm3p/uv.h>
 #include <cm3p/zlib.h>
@@ -35,19 +34,18 @@
 #include "cmsys/FStream.hxx"
 #include "cmsys/RegularExpression.hxx"
 #include "cmsys/SystemInformation.hxx"
-#if defined(_WIN32)
-#  include <windows.h> // IWYU pragma: keep
-#else
+#ifndef _WIN32
 #  include <unistd.h> // IWYU pragma: keep
 #endif
 
+#include "cm_get_date.h"
+
 #include "cmCMakePresetsGraph.h"
 #include "cmCTestBuildAndTest.h"
 #include "cmCTestScriptHandler.h"
 #include "cmCTestTestHandler.h"
 #include "cmCTestTypes.h"
 #include "cmCommandLineArgument.h"
-#include "cmDynamicLoader.h"
 #include "cmExecutionStatus.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGlobalGenerator.h"
@@ -61,6 +59,7 @@
 #include "cmState.h"
 #include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
+#include "cmStdIoStream.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmUVHandlePtr.h"
@@ -204,23 +203,21 @@
   struct tm* lctime;
   time_t tctime = time(nullptr);
   lctime = gmtime(&tctime);
-  char buf[1024];
-  // add todays year day and month to the time in str because
-  // curl_getdate no longer assumes the day is today
-  std::snprintf(buf, sizeof(buf), "%d%02d%02d %s", lctime->tm_year + 1900,
-                lctime->tm_mon + 1, lctime->tm_mday, str.c_str());
   cmCTestLog(this, OUTPUT,
              "Determine Nightly Start Time" << std::endl
                                             << "   Specified time: " << str
                                             << std::endl);
-  // Convert the nightly start time to seconds. Since we are
-  // providing only a time and a timezone, the current date of
+  // Convert the nightly start time to seconds. The current date of
   // the local machine is assumed. Consequently, nightlySeconds
   // is the time at which the nightly dashboard was opened or
   // will be opened on the date of the current client machine.
   // As such, this time may be in the past or in the future.
-  time_t ntime = curl_getdate(buf, &tctime);
-  cmCTestLog(this, DEBUG, "   Get curl time: " << ntime << std::endl);
+  char buf[1024];
+  std::snprintf(buf, sizeof(buf), "%d%02d%02d %s", lctime->tm_year + 1900,
+                lctime->tm_mon + 1, lctime->tm_mday, str.c_str());
+  time_t ntime = cm_get_date(tctime, buf);
+  cmCTestLog(this, DEBUG,
+             "   Get the nightly start time: " << ntime << std::endl);
   tctime = time(nullptr);
   cmCTestLog(this, DEBUG, "   Get the current time: " << tctime << std::endl);
 
@@ -1497,28 +1494,9 @@
   return (arg == varg1) || (varg2 && arg == varg2);
 }
 
-#if !defined(_WIN32)
-bool cmCTest::ConsoleIsNotDumb()
-{
-  std::string term_env_variable;
-  if (cmSystemTools::GetEnv("TERM", term_env_variable)) {
-    return isatty(1) && term_env_variable != "dumb";
-  }
-  return false;
-}
-#endif
-
 bool cmCTest::ProgressOutputSupportedByConsole()
 {
-#if defined(_WIN32)
-  // On Windows we need a console buffer.
-  void* console = GetStdHandle(STD_OUTPUT_HANDLE);
-  CONSOLE_SCREEN_BUFFER_INFO csbi;
-  return GetConsoleScreenBufferInfo(console, &csbi);
-#else
-  // On UNIX we need a non-dumb tty.
-  return ConsoleIsNotDumb();
-#endif
+  return cm::StdIo::Out().Kind() == cm::StdIo::TermKind::VT100;
 }
 
 bool cmCTest::ColoredOutputSupportedByConsole()
@@ -1532,13 +1510,7 @@
   if (cmSystemTools::GetEnv("CLICOLOR", clicolor) && clicolor == "0") {
     return false;
   }
-#if defined(_WIN32)
-  // Not supported on Windows
-  return false;
-#else
-  // On UNIX we need a non-dumb tty.
-  return ConsoleIsNotDumb();
-#endif
+  return cm::StdIo::Out().Kind() == cm::StdIo::TermKind::VT100;
 }
 
 bool cmCTest::AddVariableDefinition(std::string const& arg)
@@ -1564,7 +1536,7 @@
   auto result = settingsFile.ReadProjectPresets(workingDirectory);
   if (result != true) {
     cmSystemTools::Error(cmStrCat("Could not read presets from ",
-                                  workingDirectory, ":",
+                                  workingDirectory, ":\n",
                                   settingsFile.parseState.GetErrorMessage()));
     return false;
   }
@@ -2535,6 +2507,20 @@
                        this->Impl->TestOptions.ScheduleRandom = true;
                        return true;
                      } },
+    CommandArgument{
+      "--schedule-random-seed", CommandArgument::Values::One,
+      [this](std::string const& sz) -> bool {
+        unsigned long seed_value;
+        if (cmStrToULong(sz, &seed_value)) {
+          this->Impl->TestOptions.ScheduleRandomSeed =
+            static_cast<unsigned int>(seed_value);
+        } else {
+          cmCTestLog(this, WARNING,
+                     "Invalid value for '--schedule-random-seed': " << sz
+                                                                    << "\n");
+        }
+        return true;
+      } },
     CommandArgument{ "--rerun-failed", CommandArgument::Values::Zero,
                      [this](std::string const&) -> bool {
                        this->Impl->TestOptions.RerunFailed = true;
@@ -2738,11 +2724,7 @@
 
 int cmCTest::RunCMakeAndTest()
 {
-  int retv = this->Impl->BuildAndTest.Run();
-#ifndef CMAKE_BOOTSTRAP
-  cmDynamicLoader::FlushCache();
-#endif
-  return retv;
+  return this->Impl->BuildAndTest.Run();
 }
 
 void cmCTest::SetNotesFiles(std::string const& notes)
@@ -2791,7 +2773,7 @@
            lctime->tm_mon + 1, lctime->tm_mday, time_str.c_str(),
            tzone_offset);
 
-  time_t stop_time = curl_getdate(buf, &current_time);
+  time_t stop_time = cm_get_date(current_time, buf);
   if (stop_time == -1) {
     this->Impl->StopTime = std::chrono::system_clock::time_point();
     return;
@@ -2803,6 +2785,11 @@
   }
 }
 
+cm::optional<unsigned int> cmCTest::GetRandomSeed() const
+{
+  return this->Impl->TestOptions.ScheduleRandomSeed;
+}
+
 std::string cmCTest::GetScheduleType() const
 {
   return this->Impl->ScheduleType;
@@ -3791,6 +3778,22 @@
     xml.EndElement(); // NamedMeasurement
   }
 
+  // Record information about outputs and their sizes if found.
+  if (root.isMember("outputs") && root.isMember("outputSizes")) {
+    Json::ArrayIndex num_outputs =
+      std::min(root["outputs"].size(), root["outputSizes"].size());
+    if (num_outputs > 0) {
+      xml.StartElement("Outputs");
+      for (Json::ArrayIndex i = 0; i < num_outputs; ++i) {
+        xml.StartElement("Output");
+        xml.Attribute("name", root["outputs"][i].asString());
+        xml.Attribute("size", root["outputSizes"][i].asString());
+        xml.EndElement(); // Output
+      }
+      xml.EndElement(); // Outputs
+    }
+  }
+
   if (!generating_test_xml) {
     xml.EndElement(); // role
   }
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 53e9b0e..6dfa0bc 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -198,6 +198,8 @@
   std::string GetScheduleType() const;
   void SetScheduleType(std::string const& type);
 
+  cm::optional<unsigned int> GetRandomSeed() const;
+
   /** The max output width */
   int GetMaxTestNameWidth() const;
   void SetMaxTestNameWidth(int w);
@@ -453,11 +455,6 @@
   /** set command line arguments read from a test preset */
   bool SetArgsFromPreset(std::string const& presetName, bool listPresets);
 
-#if !defined(_WIN32)
-  /** returns true iff the console supports progress output */
-  static bool ConsoleIsNotDumb();
-#endif
-
   /** returns true iff the console supports progress output */
   static bool ProgressOutputSupportedByConsole();
 
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index e0dc6e3..cc4498f 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -58,9 +58,8 @@
     cmSystemTools::GetLineFromStream(fin, buffer);
     lineno++;
     realbuffer = buffer.c_str();
-    while (*realbuffer != '0' &&
-           (*realbuffer == ' ' || *realbuffer == '\t' || *realbuffer == '\r' ||
-            *realbuffer == '\n')) {
+    while (*realbuffer == ' ' || *realbuffer == '\t' || *realbuffer == '\r' ||
+           *realbuffer == '\n') {
       if (*realbuffer == '\n') {
         lineno++;
       }
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 9495c06..3da4657 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -11,6 +11,7 @@
 #include <cmext/string_view>
 
 #include "cmComputeLinkInformation.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorTarget.h"
@@ -196,8 +197,7 @@
             ((lang == "CXX"_s && linkee->HaveCxx20ModuleSources()) ||
              (lang == "Fortran"_s && linkee->HaveFortranSources(config)))) {
           cmLocalGenerator* lg = linkee->GetLocalGenerator();
-          std::string di = cmStrCat(lg->GetCurrentBinaryDirectory(), '/',
-                                    lg->GetTargetDirectory(linkee));
+          std::string di = linkee->GetSupportDirectory();
           if (lg->GetGlobalGenerator()->IsMultiConfig()) {
             di = cmStrCat(di, '/', config);
           }
@@ -360,6 +360,7 @@
   std::string iwyu;
   std::string cpplint;
   std::string cppcheck;
+  std::string icstat;
 
   auto evaluateProp = [&](std::string const& prop) -> std::string {
     auto const value = this->GeneratorTarget->GetProperty(prop);
@@ -383,9 +384,12 @@
 
     std::string const cppcheck_prop = cmStrCat(lang, "_CPPCHECK");
     cppcheck = evaluateProp(cppcheck_prop);
+
+    std::string const icstat_prop = cmStrCat(lang, "_ICSTAT");
+    icstat = evaluateProp(icstat_prop);
   }
   if (cmNonempty(iwyu) || cmNonempty(tidy) || cmNonempty(cpplint) ||
-      cmNonempty(cppcheck)) {
+      cmNonempty(cppcheck) || cmNonempty(icstat)) {
     std::string code_check = cmakeCmd + " -E __run_co_compile";
     if (!compilerLauncher.empty()) {
       // In __run_co_compile case the launcher command is supplied
@@ -460,7 +464,7 @@
           this->GlobalCommonGenerator->AddClangTidyExportFixesFile(fixesFile);
           cmSystemTools::MakeDirectory(
             cmSystemTools::GetFilenamePath(fixesFile));
-          if (!pathConverter) {
+          if (pathConverter) {
             fixesFile = pathConverter(fixesFile);
           }
           exportFixes = cmStrCat(";--export-fixes=", fixesFile);
@@ -481,6 +485,24 @@
       code_check +=
         this->GeneratorTarget->GetLocalGenerator()->EscapeForShell(cppcheck);
     }
+    if (cmNonempty(icstat)) {
+      code_check += " --icstat=";
+      std::string checksParam{};
+      std::string dbParam{};
+      // Set default values for mandatory parameters
+      std::string checksFile{ "cstat_sel_checks.txt" };
+      std::string dbFile{ "cstat.db" };
+      // Populate the command line with C-STAT
+      // mandatory parameters unless specified
+      if (icstat.find("--checks=") == std::string::npos) {
+        checksParam = cmStrCat(";--checks=", checksFile);
+      }
+      if (icstat.find("--db=") == std::string::npos) {
+        dbParam = cmStrCat(";--db=", dbFile);
+      }
+      code_check += this->GeneratorTarget->GetLocalGenerator()->EscapeForShell(
+        cmStrCat(icstat, checksParam, dbParam));
+    }
     if (cmNonempty(tidy) || (cmNonempty(cpplint)) || (cmNonempty(cppcheck))) {
       code_check += " --source=";
       code_check +=
@@ -500,13 +522,13 @@
   std::string propName = lang + "_LINKER_LAUNCHER";
   cmValue launcherProp = this->GeneratorTarget->GetProperty(propName);
   if (cmNonempty(launcherProp)) {
-    cmGeneratorExpressionDAGChecker dagChecker{
-      this->GeneratorTarget,      propName, nullptr, nullptr,
-      this->LocalCommonGenerator, config,
-    };
+    cm::GenEx::Context context(this->LocalCommonGenerator, config, lang);
+    cmGeneratorExpressionDAGChecker dagChecker{ this->GeneratorTarget,
+                                                propName, nullptr, nullptr,
+                                                context };
     std::string evaluatedLinklauncher = cmGeneratorExpression::Evaluate(
-      *launcherProp, this->LocalCommonGenerator, config, this->GeneratorTarget,
-      &dagChecker, this->GeneratorTarget, lang);
+      *launcherProp, context.LG, context.Config, this->GeneratorTarget,
+      &dagChecker, this->GeneratorTarget, context.Language);
     // Convert ;-delimited list to single string
     cmList args{ evaluatedLinklauncher, cmList::EmptyElements::Yes };
     if (!args.empty()) {
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 9669524..a7a6432 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -19,6 +19,7 @@
 #include "cmsys/RegularExpression.hxx"
 
 #include "cmComputeComponentGraph.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorTarget.h"
@@ -599,45 +600,42 @@
   cmLinkItem::DEFAULT;
 
 cmComputeLinkDepends::cmComputeLinkDepends(cmGeneratorTarget const* target,
-                                           std::string const& config,
-                                           std::string const& linkLanguage,
+                                           std::string config,
+                                           std::string linkLanguage,
                                            LinkLibrariesStrategy strategy)
   : Target(target)
   , Makefile(this->Target->Target->GetMakefile())
   , GlobalGenerator(this->Target->GetLocalGenerator()->GetGlobalGenerator())
   , CMakeInstance(this->GlobalGenerator->GetCMakeInstance())
-  , Config(config)
+  , Config(std::move(config))
   , DebugMode(this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE") ||
               this->Target->GetProperty("LINK_DEPENDS_DEBUG_MODE").IsOn())
-  , LinkLanguage(linkLanguage)
+  , LinkLanguage(std::move(linkLanguage))
   , LinkType(ComputeLinkType(
       this->Config, this->Makefile->GetCMakeInstance()->GetDebugConfigs()))
   , Strategy(strategy)
 
 {
+  cm::GenEx::Context context(this->Target->LocalGenerator, this->Config,
+                             this->LinkLanguage);
   // target oriented feature override property takes precedence over
   // global override property
   cm::string_view lloPrefix = "LINK_LIBRARY_OVERRIDE_"_s;
   auto const& keys = this->Target->GetPropertyKeys();
   std::for_each(
     keys.cbegin(), keys.cend(),
-    [this, &lloPrefix, &config, &linkLanguage](std::string const& key) {
+    [this, &lloPrefix, &context](std::string const& key) {
       if (cmHasPrefix(key, lloPrefix)) {
         if (cmValue feature = this->Target->GetProperty(key)) {
           if (!feature->empty() && key.length() > lloPrefix.length()) {
             auto item = key.substr(lloPrefix.length());
             cmGeneratorExpressionDAGChecker dagChecker{
-              this->Target,
-              "LINK_LIBRARY_OVERRIDE",
-              nullptr,
-              nullptr,
-              this->Target->GetLocalGenerator(),
-              config,
-              this->Target->GetBacktrace(),
+              this->Target, "LINK_LIBRARY_OVERRIDE",      nullptr, nullptr,
+              context,      this->Target->GetBacktrace(),
             };
             auto overrideFeature = cmGeneratorExpression::Evaluate(
-              *feature, this->Target->GetLocalGenerator(), config,
-              this->Target, &dagChecker, this->Target, linkLanguage);
+              *feature, context.LG, context.Config, this->Target, &dagChecker,
+              this->Target, context.Language);
             this->LinkLibraryOverride.emplace(item, overrideFeature);
           }
         }
@@ -647,17 +645,12 @@
   if (cmValue linkLibraryOverride =
         this->Target->GetProperty("LINK_LIBRARY_OVERRIDE")) {
     cmGeneratorExpressionDAGChecker dagChecker{
-      target,
-      "LINK_LIBRARY_OVERRIDE",
-      nullptr,
-      nullptr,
-      target->GetLocalGenerator(),
-      config,
-      target->GetBacktrace(),
+      this->Target, "LINK_LIBRARY_OVERRIDE",      nullptr, nullptr,
+      context,      this->Target->GetBacktrace(),
     };
     auto overrideValue = cmGeneratorExpression::Evaluate(
-      *linkLibraryOverride, target->GetLocalGenerator(), config, target,
-      &dagChecker, target, linkLanguage);
+      *linkLibraryOverride, context.LG, context.Config, this->Target,
+      &dagChecker, this->Target, context.Language);
 
     std::vector<std::string> overrideList =
       cmTokenize(overrideValue, ',', cmTokenizerMode::New);
@@ -1179,8 +1172,8 @@
               cmStrCat("Impossible to link target '", this->Target->GetName(),
                        "' because the link item '", entry.Item.Value,
                        "', specified with the group feature '", currentFeature,
-                       '\'', ", has already occurred with the feature '",
-                       groupFeature, '\'', ", which is not allowed."),
+                       "', has already occurred with the feature '",
+                       groupFeature, "', which is not allowed."),
               this->Target->GetBacktrace());
             continue;
           }
@@ -1203,7 +1196,8 @@
             cmStrCat("Impossible to link target '", this->Target->GetName(),
                      "' because the link item '", entry.Item.Value,
                      "' is specified with the features '", itemFeature,
-                     "' and '", entry.Feature, "'",
+                     "' and '", entry.Feature,
+                     "'"
                      ", and both have an 'OVERRIDE' attribute that overrides "
                      "the other. Such cycles are not allowed."),
             this->Target->GetBacktrace());
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index a82db2b..3f9f6e2 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -39,9 +39,8 @@
 class cmComputeLinkDepends
 {
 public:
-  cmComputeLinkDepends(cmGeneratorTarget const* target,
-                       std::string const& config,
-                       std::string const& linkLanguage,
+  cmComputeLinkDepends(cmGeneratorTarget const* target, std::string config,
+                       std::string linkLanguage,
                        LinkLibrariesStrategy strategy);
   ~cmComputeLinkDepends();
 
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 612555f..44cb884 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -2258,7 +2258,7 @@
               cmSystemTools::IsSubDirectory(d, topBinaryDir)) {
             d = cmSystemTools::RelativePath(targetOutputDir, d);
             if (!d.empty()) {
-              d = cmStrCat(originToken, "/", d);
+              d = cmStrCat(originToken, '/', d);
             } else {
               d = originToken;
             }
diff --git a/Source/cmConfigureLog.cxx b/Source/cmConfigureLog.cxx
index a7ada17..b486cc3 100644
--- a/Source/cmConfigureLog.cxx
+++ b/Source/cmConfigureLog.cxx
@@ -123,6 +123,26 @@
   this->Stream << std::endl;
 }
 
+void cmConfigureLog::BeginArray()
+{
+  ++this->Indent;
+}
+
+void cmConfigureLog::NextArrayElement()
+{
+  assert(this->Indent);
+  --this->Indent;
+  this->BeginLine() << '-';
+  this->EndLine();
+  ++this->Indent;
+}
+
+void cmConfigureLog::EndArray()
+{
+  assert(this->Indent);
+  --this->Indent;
+}
+
 void cmConfigureLog::BeginObject(cm::string_view key)
 {
   this->BeginLine() << key << ':';
diff --git a/Source/cmConfigureLog.h b/Source/cmConfigureLog.h
index ff9b4ee..6c6c44f 100644
--- a/Source/cmConfigureLog.h
+++ b/Source/cmConfigureLog.h
@@ -34,6 +34,10 @@
   void BeginEvent(std::string const& kind, cmMakefile const& mf);
   void EndEvent();
 
+  void BeginArray();
+  void NextArrayElement();
+  void EndArray();
+
   void BeginObject(cm::string_view key);
   void EndObject();
 
diff --git a/Source/cmConsoleBuf.cxx b/Source/cmConsoleBuf.cxx
deleted file mode 100644
index 286c4c3..0000000
--- a/Source/cmConsoleBuf.cxx
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file LICENSE.rst or https://cmake.org/licensing for details.  */
-#include "cmConsoleBuf.h"
-
-#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
-cmConsoleBuf::cmConsoleBuf()
-  : m_ConsoleOut(std::cout)
-  , m_ConsoleErr(std::cerr, true)
-{
-}
-#else
-cmConsoleBuf::cmConsoleBuf() = default;
-#endif
-
-void cmConsoleBuf::SetUTF8Pipes()
-{
-#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
-  m_ConsoleOut.SetUTF8Pipes();
-  m_ConsoleErr.SetUTF8Pipes();
-#endif
-}
diff --git a/Source/cmConsoleBuf.h b/Source/cmConsoleBuf.h
deleted file mode 100644
index 72e9da7..0000000
--- a/Source/cmConsoleBuf.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file LICENSE.rst or https://cmake.org/licensing for details.  */
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
-#  include "cmsys/ConsoleBuf.hxx"
-#endif
-
-class cmConsoleBuf
-{
-#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
-  cmsys::ConsoleBuf::Manager m_ConsoleOut;
-  cmsys::ConsoleBuf::Manager m_ConsoleErr;
-#endif
-public:
-  cmConsoleBuf();
-  ~cmConsoleBuf() = default;
-  cmConsoleBuf(cmConsoleBuf const&) = delete;
-  cmConsoleBuf& operator=(cmConsoleBuf const&) = delete;
-  void SetUTF8Pipes();
-};
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index d300ad4..eb8f616 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -37,39 +37,18 @@
 
 namespace {
 constexpr char const* unique_binary_directory = "CMAKE_BINARY_DIR_USE_MKDTEMP";
-constexpr size_t lang_property_start = 0;
-constexpr size_t lang_property_size = 4;
-constexpr size_t pie_property_start = 4;
-constexpr size_t pie_property_size = 2;
-/* clang-format off */
-#define SETUP_LANGUAGE(name, lang)                                            \
-  static const std::string name[lang_property_size + pie_property_size + 1] = \
-    { "CMAKE_" #lang "_COMPILER_EXTERNAL_TOOLCHAIN",                          \
-      "CMAKE_" #lang "_COMPILER_TARGET",                                      \
-      "CMAKE_" #lang "_LINK_NO_PIE_SUPPORTED",                                \
-      "CMAKE_" #lang "_PIE_SUPPORTED", "" }
-/* clang-format on */
 
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(c_properties, C);
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(cxx_properties, CXX);
-
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(cuda_properties, CUDA);
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(fortran_properties, Fortran);
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(hip_properties, HIP);
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(objc_properties, OBJC);
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(objcxx_properties, OBJCXX);
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(ispc_properties, ISPC);
-// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
-SETUP_LANGUAGE(swift_properties, Swift);
-#undef SETUP_LANGUAGE
+std::array<cm::string_view, 9> const kLanguageNames{ {
+  "C"_s,
+  "CUDA"_s,
+  "CXX"_s,
+  "Fortran"_s,
+  "HIP"_s,
+  "ISPC"_s,
+  "OBJC"_s,
+  "OBJCXX"_s,
+  "Swift"_s,
+} };
 
 std::string const kCMAKE_CUDA_ARCHITECTURES = "CMAKE_CUDA_ARCHITECTURES";
 std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = "CMAKE_CUDA_RUNTIME_LIBRARY";
@@ -112,6 +91,7 @@
   "CMAKE_MSVC_DEBUG_INFORMATION_FORMAT_DEFAULT";
 std::string const kCMAKE_MSVC_RUNTIME_CHECKS_DEFAULT =
   "CMAKE_MSVC_RUNTIME_CHECKS_DEFAULT";
+std::string const kCMAKE_MSVC_CMP0197 = "CMAKE_MSVC_CMP0197";
 
 /* GHS Multi platform variables */
 std::set<std::string> const ghs_platform_vars{
@@ -705,6 +685,12 @@
       fprintf(fout, "cmake_policy(SET CMP0128 OLD)\n");
     }
 
+    /* Set MSVC link -machine: policy to match outer project.  */
+    if (cmValue cmp0197 = this->Makefile->GetDefinition(kCMAKE_MSVC_CMP0197)) {
+      fprintf(fout, "cmake_policy(SET CMP0197 %s)\n",
+              *cmp0197 == "NEW"_s ? "NEW" : "OLD");
+    }
+
     std::string projectLangs;
     for (std::string const& li : testLangs) {
       projectLangs += cmStrCat(' ', li);
@@ -1077,24 +1063,10 @@
          cmPolicies::NEW) &&
       !this->Makefile->IsOn("CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES")) {
     std::set<std::string> vars;
-    vars.insert(&c_properties[lang_property_start],
-                &c_properties[lang_property_start + lang_property_size]);
-    vars.insert(&cxx_properties[lang_property_start],
-                &cxx_properties[lang_property_start + lang_property_size]);
-    vars.insert(&cuda_properties[lang_property_start],
-                &cuda_properties[lang_property_start + lang_property_size]);
-    vars.insert(&fortran_properties[lang_property_start],
-                &fortran_properties[lang_property_start + lang_property_size]);
-    vars.insert(&hip_properties[lang_property_start],
-                &hip_properties[lang_property_start + lang_property_size]);
-    vars.insert(&objc_properties[lang_property_start],
-                &objc_properties[lang_property_start + lang_property_size]);
-    vars.insert(&objcxx_properties[lang_property_start],
-                &objcxx_properties[lang_property_start + lang_property_size]);
-    vars.insert(&ispc_properties[lang_property_start],
-                &ispc_properties[lang_property_start + lang_property_size]);
-    vars.insert(&swift_properties[lang_property_start],
-                &swift_properties[lang_property_start + lang_property_size]);
+    for (cm::string_view l : kLanguageNames) {
+      vars.emplace(cmStrCat("CMAKE_", l, "_COMPILER_EXTERNAL_TOOLCHAIN"));
+      vars.emplace(cmStrCat("CMAKE_", l, "_COMPILER_TARGET"));
+    }
     vars.insert(kCMAKE_CUDA_ARCHITECTURES);
     vars.insert(kCMAKE_CUDA_RUNTIME_LIBRARY);
     vars.insert(kCMAKE_CXX_SCAN_FOR_MODULES);
@@ -1148,24 +1120,10 @@
         cmPolicies::NEW) {
       // To ensure full support of PIE, propagate cache variables
       // driving the link options
-      vars.insert(&c_properties[pie_property_start],
-                  &c_properties[pie_property_start + pie_property_size]);
-      vars.insert(&cxx_properties[pie_property_start],
-                  &cxx_properties[pie_property_start + pie_property_size]);
-      vars.insert(&cuda_properties[pie_property_start],
-                  &cuda_properties[pie_property_start + pie_property_size]);
-      vars.insert(&fortran_properties[pie_property_start],
-                  &fortran_properties[pie_property_start + pie_property_size]);
-      vars.insert(&hip_properties[pie_property_start],
-                  &hip_properties[pie_property_start + pie_property_size]);
-      vars.insert(&objc_properties[pie_property_start],
-                  &objc_properties[pie_property_start + pie_property_size]);
-      vars.insert(&objcxx_properties[pie_property_start],
-                  &objcxx_properties[pie_property_start + pie_property_size]);
-      vars.insert(&ispc_properties[pie_property_start],
-                  &ispc_properties[pie_property_start + pie_property_size]);
-      vars.insert(&swift_properties[pie_property_start],
-                  &swift_properties[pie_property_start + pie_property_size]);
+      for (cm::string_view l : kLanguageNames) {
+        vars.emplace(cmStrCat("CMAKE_", l, "_LINK_NO_PIE_SUPPORTED"));
+        vars.emplace(cmStrCat("CMAKE_", l, "_LINK_PIE_SUPPORTED"));
+      }
     }
 
     /* for the TRY_COMPILEs we want to be able to specify the architecture.
@@ -1293,7 +1251,7 @@
           "to destination specified by COPY_FILE:\n"
           "  '", copyFile, "'\n"
           "because:\n"
-          "  ", err, "\n",
+          "  ", err, '\n',
           this->FindErrorMessage);
         /* clang-format on */
         if (!arguments.CopyFileError) {
@@ -1412,7 +1370,7 @@
   if (!cmSystemTools::FileExists(command)) {
     std::ostringstream emsg;
     emsg << "Unable to find the recorded try_compile output location:\n";
-    emsg << cmStrCat("  ", command, "\n");
+    emsg << cmStrCat("  ", command, '\n');
     this->FindErrorMessage = emsg.str();
     return;
   }
@@ -1423,7 +1381,7 @@
   if (!cmSystemTools::FileExists(outputFileLocation)) {
     std::ostringstream emsg;
     emsg << "Recorded try_compile output location doesn't exist:\n";
-    emsg << cmStrCat("  ", outputFileLocation, "\n");
+    emsg << cmStrCat("  ", outputFileLocation, '\n');
     this->FindErrorMessage = emsg.str();
     return;
   }
diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx
index ba473eb..627e302 100644
--- a/Source/cmCurl.cxx
+++ b/Source/cmCurl.cxx
@@ -48,6 +48,7 @@
 // Do this only for our vendored curl to avoid breaking builds
 // against external future versions of curl.
 #if !defined(CMAKE_USE_SYSTEM_CURL)
+// NOLINTNEXTLINE(misc-redundant-expression)
 static_assert(CURL_SSLVERSION_LAST == 8,
               "A new CURL_SSLVERSION_ may be available!");
 #endif
diff --git a/Source/cmCurl.h b/Source/cmCurl.h
index 6279925..3d60671 100644
--- a/Source/cmCurl.h
+++ b/Source/cmCurl.h
@@ -11,6 +11,11 @@
 
 #include <cm3p/curl/curl.h>
 
+// curl versions before 7.87.0 did not provide CURL_WRITEFUNC_ERROR
+#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM < 0x075700
+#  define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
+#endif
+
 cm::optional<int> cmCurlParseTLSVersion(cm::string_view tls_version);
 cm::optional<std::string> cmCurlPrintTLSVersion(int curl_tls_version);
 std::string cmCurlSetCAInfo(::CURL* curl, std::string const& cafile = {});
diff --git a/Source/cmCxxModuleMapper.cxx b/Source/cmCxxModuleMapper.cxx
index 4b60832..7c72dad 100644
--- a/Source/cmCxxModuleMapper.cxx
+++ b/Source/cmCxxModuleMapper.cxx
@@ -275,7 +275,7 @@
                                   ref.Path, "' via ", method_name(ref.Method),
                                   "; "
                                   "Location B: '",
-                                  loc, "' via ", method_name(method), "."));
+                                  loc, "' via ", method_name(method), '.'));
     return false;
   }
 
diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx
index 220a483..e0c1a0b 100644
--- a/Source/cmDefinePropertyCommand.cxx
+++ b/Source/cmDefinePropertyCommand.cxx
@@ -89,7 +89,7 @@
     if (!cmHasSuffix(initializeFromVariable, PropertyName)) {
       status.SetError(cmStrCat("Variable name \"", initializeFromVariable,
                                "\" does not end with property name \"",
-                               PropertyName, "\""));
+                               PropertyName, '"'));
       return false;
     }
     if (PropertyName.find('_') == std::string::npos) {
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
deleted file mode 100644
index c88c324..0000000
--- a/Source/cmDynamicLoader.cxx
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file LICENSE.rst or https://cmake.org/licensing for details.  */
-#include "cmDynamicLoader.h"
-
-#include <map>
-#include <string>
-#include <utility>
-
-namespace {
-class cmDynamicLoaderCache
-{
-public:
-  ~cmDynamicLoaderCache();
-  void CacheFile(char const* path, cmsys::DynamicLoader::LibraryHandle /*p*/);
-  bool GetCacheFile(char const* path,
-                    cmsys::DynamicLoader::LibraryHandle& /*p*/);
-  bool FlushCache(char const* path);
-  void FlushCache();
-  static cmDynamicLoaderCache& GetInstance();
-
-private:
-  std::map<std::string, cmsys::DynamicLoader::LibraryHandle> CacheMap;
-  static cmDynamicLoaderCache Instance;
-};
-
-cmDynamicLoaderCache cmDynamicLoaderCache::Instance;
-}
-
-cmDynamicLoaderCache::~cmDynamicLoaderCache() = default;
-
-void cmDynamicLoaderCache::CacheFile(char const* path,
-                                     cmsys::DynamicLoader::LibraryHandle p)
-{
-  cmsys::DynamicLoader::LibraryHandle h;
-  if (this->GetCacheFile(path, h)) {
-    this->FlushCache(path);
-  }
-  this->CacheMap[path] = p;
-}
-
-bool cmDynamicLoaderCache::GetCacheFile(char const* path,
-                                        cmsys::DynamicLoader::LibraryHandle& p)
-{
-  auto it = this->CacheMap.find(path);
-  if (it != this->CacheMap.end()) {
-    p = it->second;
-    return true;
-  }
-  return false;
-}
-
-bool cmDynamicLoaderCache::FlushCache(char const* path)
-{
-  auto it = this->CacheMap.find(path);
-  bool ret = false;
-  if (it != this->CacheMap.end()) {
-    cmsys::DynamicLoader::CloseLibrary(it->second);
-    this->CacheMap.erase(it);
-    ret = true;
-  }
-  return ret;
-}
-
-void cmDynamicLoaderCache::FlushCache()
-{
-  for (auto const& it : this->CacheMap) {
-    cmsys::DynamicLoader::CloseLibrary(it.second);
-  }
-  this->CacheMap.clear();
-}
-
-cmDynamicLoaderCache& cmDynamicLoaderCache::GetInstance()
-{
-  return cmDynamicLoaderCache::Instance;
-}
-
-cmsys::DynamicLoader::LibraryHandle cmDynamicLoader::OpenLibrary(
-  char const* libname)
-{
-  cmsys::DynamicLoader::LibraryHandle lh;
-  if (cmDynamicLoaderCache::GetInstance().GetCacheFile(libname, lh)) {
-    return lh;
-  }
-  lh = cmsys::DynamicLoader::OpenLibrary(libname);
-  cmDynamicLoaderCache::GetInstance().CacheFile(libname, lh);
-  return lh;
-}
-
-void cmDynamicLoader::FlushCache()
-{
-  cmDynamicLoaderCache::GetInstance().FlushCache();
-}
diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h
deleted file mode 100644
index e2fcedc..0000000
--- a/Source/cmDynamicLoader.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file LICENSE.rst or https://cmake.org/licensing for details.  */
-// .NAME cmDynamicLoader - class interface to system dynamic libraries
-// .SECTION Description
-// cmDynamicLoader provides a portable interface to loading dynamic
-// libraries into a process.
-
-#pragma once
-
-#include "cmConfigure.h" // IWYU pragma: keep
-
-#include "cmsys/DynamicLoader.hxx" // IWYU pragma: export
-
-class cmDynamicLoader
-{
-public:
-  // Description:
-  // Load a dynamic library into the current process.
-  // The returned cmsys::DynamicLoader::LibraryHandle can be used to access
-  // the symbols in the library.
-  static cmsys::DynamicLoader::LibraryHandle OpenLibrary(char const*);
-
-  // Description:
-  // Flush the cache of dynamic loader.
-  static void FlushCache();
-
-protected:
-  cmDynamicLoader() = default;
-  ~cmDynamicLoader() = default;
-};
diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx
index 98aaab2..7f8a9b8 100644
--- a/Source/cmDyndepCollation.cxx
+++ b/Source/cmDyndepCollation.cxx
@@ -20,6 +20,7 @@
 #include "cmExportBuildFileGenerator.h"
 #include "cmExportSet.h"
 #include "cmFileSet.h"
+#include "cmGenExContext.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorExpression.h" // IWYU pragma: keep
 #include "cmGeneratorTarget.h"
@@ -50,6 +51,7 @@
                                           std::string const& config,
                                           cmDyndepGeneratorCallbacks const& cb)
 {
+  cm::GenEx::Context const context(gt->LocalGenerator, config);
   TdiSourceInfo info;
   cmTarget const* tgt = gt->Target;
   auto all_file_sets = tgt->GetAllFileSetNames();
@@ -108,12 +110,12 @@
     auto fileEntries = file_set->CompileFileEntries();
     auto directoryEntries = file_set->CompileDirectoryEntries();
 
-    auto directories = file_set->EvaluateDirectoryEntries(
-      directoryEntries, gt->LocalGenerator, config, gt);
+    auto directories =
+      file_set->EvaluateDirectoryEntries(directoryEntries, context, gt);
     std::map<std::string, std::vector<std::string>> files_per_dirs;
     for (auto const& entry : fileEntries) {
-      file_set->EvaluateFileEntry(directories, files_per_dirs, entry,
-                                  gt->LocalGenerator, config, gt);
+      file_set->EvaluateFileEntry(directories, files_per_dirs, entry, context,
+                                  gt);
     }
 
     Json::Value fs_dest = Json::nullValue;
@@ -644,6 +646,9 @@
             result = false;
           }
         }
+        for (auto const& req : object.Requires) {
+          bdb_entry->second->Requires.push_back(req.LogicalName);
+        }
       } else if (export_info.DatabaseInfo) {
         cmSystemTools::Error(cmStrCat(
           "Failed to find module database entry for ", file_set.SourcePath));
diff --git a/Source/cmEvaluatedTargetProperty.cxx b/Source/cmEvaluatedTargetProperty.cxx
index dab80ae..7112a9b 100644
--- a/Source/cmEvaluatedTargetProperty.cxx
+++ b/Source/cmEvaluatedTargetProperty.cxx
@@ -5,7 +5,8 @@
 #include <unordered_map>
 #include <utility>
 
-#include "cmGeneratorExpressionContext.h"
+#include "cmGenExContext.h"
+#include "cmGenExEvaluation.h"
 #include "cmGeneratorTarget.h"
 #include "cmLinkItem.h"
 #include "cmList.h"
@@ -20,14 +21,12 @@
 }
 
 EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry(
-  cmGeneratorTarget const* thisTarget, std::string const& config,
-  std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker,
+  cmGeneratorTarget const* thisTarget, cm::GenEx::Context const& context,
+  cmGeneratorExpressionDAGChecker* dagChecker,
   cmGeneratorTarget::TargetPropertyEntry& entry)
 {
   EvaluatedTargetPropertyEntry ee(entry.LinkImplItem, entry.GetBacktrace());
-  cmExpandList(entry.Evaluate(thisTarget->GetLocalGenerator(), config,
-                              thisTarget, dagChecker, lang),
-               ee.Values);
+  cmExpandList(entry.Evaluate(context, thisTarget, dagChecker), ee.Values);
   if (entry.GetHadContextSensitiveCondition()) {
     ee.ContextDependent = true;
   }
@@ -35,24 +34,24 @@
 }
 
 EvaluatedTargetPropertyEntries EvaluateTargetPropertyEntries(
-  cmGeneratorTarget const* thisTarget, std::string const& config,
-  std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker,
+  cmGeneratorTarget const* thisTarget, cm::GenEx::Context const& context,
+  cmGeneratorExpressionDAGChecker* dagChecker,
   std::vector<std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>> const&
     in)
 {
   EvaluatedTargetPropertyEntries out;
   out.Entries.reserve(in.size());
   for (auto const& entry : in) {
-    out.Entries.emplace_back(EvaluateTargetPropertyEntry(
-      thisTarget, config, lang, dagChecker, *entry));
+    out.Entries.emplace_back(
+      EvaluateTargetPropertyEntry(thisTarget, context, dagChecker, *entry));
   }
   return out;
 }
 
 namespace {
 void addInterfaceEntry(cmGeneratorTarget const* headTarget,
-                       std::string const& config, std::string const& prop,
-                       std::string const& lang,
+                       std::string const& prop,
+                       cm::GenEx::Context const& context,
                        cmGeneratorExpressionDAGChecker* dagChecker,
                        EvaluatedTargetPropertyEntries& entries,
                        cmGeneratorTarget::UseTo usage,
@@ -64,13 +63,12 @@
       // Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our
       // caller's property and hand-evaluate it as if it were compiled.
       // Create a context as cmCompiledGeneratorExpression::Evaluate does.
-      cmGeneratorExpressionContext context(
-        headTarget->GetLocalGenerator(), config, false, headTarget, headTarget,
-        true, lib.Backtrace, lang);
-      cmExpandList(lib.Target->EvaluateInterfaceProperty(prop, &context,
-                                                         dagChecker, usage),
-                   ee.Values);
-      ee.ContextDependent = context.HadContextSensitiveCondition;
+      cm::GenEx::Evaluation eval(context, false, headTarget, headTarget, true,
+                                 lib.Backtrace);
+      cmExpandList(
+        lib.Target->EvaluateInterfaceProperty(prop, &eval, dagChecker, usage),
+        ee.Values);
+      ee.ContextDependent = eval.HadContextSensitiveCondition;
       entries.Entries.emplace_back(std::move(ee));
     }
   }
@@ -78,8 +76,8 @@
 }
 
 void AddInterfaceEntries(cmGeneratorTarget const* headTarget,
-                         std::string const& config, std::string const& prop,
-                         std::string const& lang,
+                         std::string const& prop,
+                         cm::GenEx::Context const& context,
                          cmGeneratorExpressionDAGChecker* dagChecker,
                          EvaluatedTargetPropertyEntries& entries,
                          IncludeRuntimeInterface searchRuntime,
@@ -87,25 +85,26 @@
 {
   if (searchRuntime == IncludeRuntimeInterface::Yes) {
     if (cmLinkImplementation const* impl =
-          headTarget->GetLinkImplementation(config, usage)) {
+          headTarget->GetLinkImplementation(context.Config, usage)) {
       entries.HadContextSensitiveCondition =
         impl->HadContextSensitiveCondition;
 
-      auto runtimeLibIt = impl->LanguageRuntimeLibraries.find(lang);
+      auto runtimeLibIt =
+        impl->LanguageRuntimeLibraries.find(context.Language);
       if (runtimeLibIt != impl->LanguageRuntimeLibraries.end()) {
-        addInterfaceEntry(headTarget, config, prop, lang, dagChecker, entries,
+        addInterfaceEntry(headTarget, prop, context, dagChecker, entries,
                           usage, runtimeLibIt->second);
       }
-      addInterfaceEntry(headTarget, config, prop, lang, dagChecker, entries,
-                        usage, impl->Libraries);
+      addInterfaceEntry(headTarget, prop, context, dagChecker, entries, usage,
+                        impl->Libraries);
     }
   } else {
     if (cmLinkImplementationLibraries const* impl =
-          headTarget->GetLinkImplementationLibraries(config, usage)) {
+          headTarget->GetLinkImplementationLibraries(context.Config, usage)) {
       entries.HadContextSensitiveCondition =
         impl->HadContextSensitiveCondition;
-      addInterfaceEntry(headTarget, config, prop, lang, dagChecker, entries,
-                        usage, impl->Libraries);
+      addInterfaceEntry(headTarget, prop, context, dagChecker, entries, usage,
+                        impl->Libraries);
     }
   }
 }
diff --git a/Source/cmEvaluatedTargetProperty.h b/Source/cmEvaluatedTargetProperty.h
index f9cdada..4ab4af4 100644
--- a/Source/cmEvaluatedTargetProperty.h
+++ b/Source/cmEvaluatedTargetProperty.h
@@ -9,6 +9,12 @@
 #include "cmGeneratorTarget.h"
 #include "cmListFileCache.h"
 
+namespace cm {
+namespace GenEx {
+struct Context;
+}
+}
+
 class cmLinkImplItem;
 struct cmGeneratorExpressionDAGChecker;
 
@@ -34,8 +40,8 @@
 };
 
 EvaluatedTargetPropertyEntry EvaluateTargetPropertyEntry(
-  cmGeneratorTarget const* thisTarget, std::string const& config,
-  std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker,
+  cmGeneratorTarget const* thisTarget, cm::GenEx::Context const& context,
+  cmGeneratorExpressionDAGChecker* dagChecker,
   cmGeneratorTarget::TargetPropertyEntry& entry);
 
 struct EvaluatedTargetPropertyEntries
@@ -45,8 +51,8 @@
 };
 
 EvaluatedTargetPropertyEntries EvaluateTargetPropertyEntries(
-  cmGeneratorTarget const* thisTarget, std::string const& config,
-  std::string const& lang, cmGeneratorExpressionDAGChecker* dagChecker,
+  cmGeneratorTarget const* thisTarget, cm::GenEx::Context const& context,
+  cmGeneratorExpressionDAGChecker* dagChecker,
   std::vector<std::unique_ptr<cmGeneratorTarget::TargetPropertyEntry>> const&
     in);
 
@@ -71,8 +77,8 @@
 };
 
 void AddInterfaceEntries(
-  cmGeneratorTarget const* headTarget, std::string const& config,
-  std::string const& prop, std::string const& lang,
+  cmGeneratorTarget const* headTarget, std::string const& prop,
+  cm::GenEx::Context const& context,
   cmGeneratorExpressionDAGChecker* dagChecker,
   EvaluatedTargetPropertyEntries& entries,
   IncludeRuntimeInterface searchRuntime,
diff --git a/Source/cmExperimental.cxx b/Source/cmExperimental.cxx
index f75270b..2a018bc 100644
--- a/Source/cmExperimental.cxx
+++ b/Source/cmExperimental.cxx
@@ -7,8 +7,10 @@
 #include <cstddef>
 #include <string>
 
+#include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmStringAlgorithms.h"
 #include "cmValue.h"
 
 namespace {
@@ -18,7 +20,7 @@
  * Search for other instances to keep the documentation and test suite
  * up-to-date.
  */
-cmExperimental::FeatureData LookupTable[] = {
+cmExperimental::FeatureData const LookupTable[] = {
   // ExportPackageDependencies
   { "ExportPackageDependencies",
     "1942b4fa-b2c5-4546-9385-83f254070067",
@@ -26,17 +28,7 @@
     "CMake's EXPORT_PACKAGE_DEPENDENCIES support is experimental. It is meant "
     "only for experimentation and feedback to CMake developers.",
     {},
-    cmExperimental::TryCompileCondition::Always,
-    false },
-  // WindowsKernelModeDriver
-  { "WindowsKernelModeDriver",
-    "9157bf90-2313-44d6-aefa-67cd83c8be7c",
-    "CMAKE_EXPERIMENTAL_WINDOWS_KERNEL_MODE_DRIVER",
-    "CMake's Windows kernel-mode driver support is experimental. It is meant "
-    "only for experimentation and feedback to CMake developers.",
-    {},
-    cmExperimental::TryCompileCondition::Always,
-    false },
+    cmExperimental::TryCompileCondition::Always },
   // CxxImportStd
   { "CxxImportStd",
     "d0edc3af-4c50-42ea-a356-e2862fe7a444",
@@ -44,8 +36,7 @@
     "CMake's support for `import std;` in C++23 and newer is experimental. It "
     "is meant only for experimentation and feedback to CMake developers.",
     {},
-    cmExperimental::TryCompileCondition::Always,
-    false },
+    cmExperimental::TryCompileCondition::Always },
   // ImportPackageInfo
   { "ImportPackageInfo",
     "e82e467b-f997-4464-8ace-b00808fff261",
@@ -54,8 +45,7 @@
     "Specification format (via find_package) is experimental. It is meant "
     "only for experimentation and feedback to CMake developers.",
     {},
-    cmExperimental::TryCompileCondition::Always,
-    false },
+    cmExperimental::TryCompileCondition::Always },
   // ExportPackageInfo
   { "ExportPackageInfo",
     "b80be207-778e-46ba-8080-b23bba22639e",
@@ -64,17 +54,15 @@
     "Specification format is experimental. It is meant only for "
     "experimentation and feedback to CMake developers.",
     {},
-    cmExperimental::TryCompileCondition::Always,
-    false },
+    cmExperimental::TryCompileCondition::Always },
   // ExportBuildDatabase
   { "ExportBuildDatabase",
-    "4bd552e2-b7fb-429a-ab23-c83ef53f3f13",
+    "73194a1d-c0b5-41b9-9190-a4512925e192",
     "CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE",
     "CMake's support for exporting build databases is experimental. It is "
     "meant only for experimentation and feedback to CMake developers.",
     {},
-    cmExperimental::TryCompileCondition::Never,
-    false },
+    cmExperimental::TryCompileCondition::Never },
   // Instrumentation
   { "Instrumentation",
     "a37d1069-1972-4901-b9c9-f194aaf2b6e0",
@@ -82,14 +70,13 @@
     "CMake's support for collecting instrumentation data is experimental. It "
     "is meant only for experimentation and feedback to CMake developers.",
     {},
-    cmExperimental::TryCompileCondition::Never,
-    false },
+    cmExperimental::TryCompileCondition::Never },
 };
 static_assert(sizeof(LookupTable) / sizeof(LookupTable[0]) ==
                 static_cast<size_t>(cmExperimental::Feature::Sentinel),
               "Experimental feature lookup table mismatch");
 
-cmExperimental::FeatureData& DataForFeature(cmExperimental::Feature f)
+cmExperimental::FeatureData const& DataForFeature(cmExperimental::Feature f)
 {
   assert(f != cmExperimental::Feature::Sentinel);
   return LookupTable[static_cast<size_t>(f)];
@@ -118,16 +105,27 @@
 bool cmExperimental::HasSupportEnabled(cmMakefile const& mf, Feature f)
 {
   bool enabled = false;
-  auto& data = ::DataForFeature(f);
+  FeatureData const& data = cmExperimental::DataForFeature(f);
 
-  auto value = mf.GetDefinition(data.Variable);
-  if (value == data.Uuid) {
-    enabled = true;
-  }
+  if (cmValue value = mf.GetDefinition(data.Variable)) {
+    enabled = *value == data.Uuid;
 
-  if (enabled && !data.Warned) {
-    mf.IssueMessage(MessageType::AUTHOR_WARNING, data.Description);
-    data.Warned = true;
+    if (mf.GetGlobalGenerator()->ShouldWarnExperimental(data.Name, *value)) {
+      if (enabled) {
+        mf.IssueMessage(MessageType::AUTHOR_WARNING, data.Description);
+      } else {
+        mf.IssueMessage(
+          MessageType::AUTHOR_WARNING,
+          cmStrCat(
+            data.Variable, " is set to incorrect value\n  ", value,
+            "\n"
+            "See 'Help/dev/experimental.rst' in the source tree of this "
+            "version of CMake for documentation of the experimental feature "
+            "and the corresponding activation value.  This project's code "
+            "may require changes to work with this CMake's version of the "
+            "feature."));
+      }
+    }
   }
 
   return enabled;
diff --git a/Source/cmExperimental.h b/Source/cmExperimental.h
index f68fa87..54fd691 100644
--- a/Source/cmExperimental.h
+++ b/Source/cmExperimental.h
@@ -18,7 +18,6 @@
   enum class Feature
   {
     ExportPackageDependencies,
-    WindowsKernelModeDriver,
     CxxImportStd,
     ImportPackageInfo,
     ExportPackageInfo,
@@ -37,13 +36,12 @@
 
   struct FeatureData
   {
-    std::string const Name;
-    std::string const Uuid;
-    std::string const Variable;
-    std::string const Description;
-    std::vector<std::string> const TryCompileVariables;
-    TryCompileCondition const ForwardThroughTryCompile;
-    bool Warned;
+    std::string Name;
+    std::string Uuid;
+    std::string Variable;
+    std::string Description;
+    std::vector<std::string> TryCompileVariables;
+    TryCompileCondition ForwardThroughTryCompile;
   };
 
   static FeatureData const& DataForFeature(Feature f);
diff --git a/Source/cmExportBuildCMakeConfigGenerator.cxx b/Source/cmExportBuildCMakeConfigGenerator.cxx
index 1e58d79..d317ffd 100644
--- a/Source/cmExportBuildCMakeConfigGenerator.cxx
+++ b/Source/cmExportBuildCMakeConfigGenerator.cxx
@@ -17,6 +17,7 @@
 #include "cmCryptoHash.h"
 #include "cmExportSet.h"
 #include "cmFileSet.h"
+#include "cmGenExContext.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorTarget.h"
@@ -176,8 +177,9 @@
   auto directoryEntries = fileSet->CompileDirectoryEntries();
 
   for (auto const& config : configs) {
-    auto directories = fileSet->EvaluateDirectoryEntries(
-      directoryEntries, gte->LocalGenerator, config, gte);
+    cm::GenEx::Context context(gte->LocalGenerator, config);
+    auto directories =
+      fileSet->EvaluateDirectoryEntries(directoryEntries, context, gte);
 
     bool const contextSensitive =
       std::any_of(directoryEntries.begin(), directoryEntries.end(),
@@ -226,13 +228,13 @@
   auto directoryEntries = fileSet->CompileDirectoryEntries();
 
   for (auto const& config : configs) {
-    auto directories = fileSet->EvaluateDirectoryEntries(
-      directoryEntries, gte->LocalGenerator, config, gte);
+    cm::GenEx::Context context(gte->LocalGenerator, config);
+    auto directories =
+      fileSet->EvaluateDirectoryEntries(directoryEntries, context, gte);
 
     std::map<std::string, std::vector<std::string>> files;
     for (auto const& entry : fileEntries) {
-      fileSet->EvaluateFileEntry(directories, files, entry,
-                                 gte->LocalGenerator, config, gte);
+      fileSet->EvaluateFileEntry(directories, files, entry, context, gte);
     }
 
     bool const contextSensitive =
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 86e1b91..332a6c1 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -186,15 +186,20 @@
     target->GetLocalGenerator()->GetGlobalGenerator()->GetBuildExportSets();
 
   for (auto const& exp : allExportSets) {
-    auto const& exportSet = exp.second;
+    cmExportBuildFileGenerator const* const bfg = exp.second;
+    cmExportSet const* const exportSet = bfg->GetExportSet();
     std::vector<TargetExport> targets;
-    exportSet->GetTargets(targets);
+    bfg->GetTargets(targets);
     if (std::any_of(
           targets.begin(), targets.end(),
           [&name](TargetExport const& te) { return te.Name == name; })) {
-      exportSets.insert(exp.first);
+      if (exportSet) {
+        exportSets.insert(exportSet->GetName());
+      } else {
+        exportSets.insert(exp.first);
+      }
       exportFiles.push_back(exp.first);
-      namespaces.insert(exportSet->GetNamespace());
+      namespaces.insert(bfg->GetNamespace());
     }
   }
 
diff --git a/Source/cmExportBuildPackageInfoGenerator.cxx b/Source/cmExportBuildPackageInfoGenerator.cxx
new file mode 100644
index 0000000..980bb29
--- /dev/null
+++ b/Source/cmExportBuildPackageInfoGenerator.cxx
@@ -0,0 +1,116 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file LICENSE.rst or https://cmake.org/licensing for details.  */
+#include "cmExportBuildPackageInfoGenerator.h"
+
+#include <cassert>
+#include <utility>
+#include <vector>
+
+#include <cmext/string_view>
+
+#include <cm3p/json/value.h>
+
+#include "cmGeneratorExpression.h"
+#include "cmPackageInfoArguments.h"
+#include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
+
+cmExportBuildPackageInfoGenerator::cmExportBuildPackageInfoGenerator(
+  cmPackageInfoArguments arguments)
+  : cmExportPackageInfoGenerator(std::move(arguments))
+{
+  this->SetNamespace(cmStrCat(this->GetPackageName(), "::"_s));
+}
+
+bool cmExportBuildPackageInfoGenerator::GenerateMainFile(std::ostream& os)
+{
+  if (!this->CollectExports([&](cmGeneratorTarget const*) {})) {
+    return false;
+  }
+
+  if (!this->CheckDefaultTargets()) {
+    return false;
+  }
+
+  Json::Value root = this->GeneratePackageInfo();
+  root["cps_path"] = "@prefix@";
+
+  Json::Value& components = root["components"];
+
+  // Create all the imported targets.
+  for (auto const& exp : this->Exports) {
+    cmGeneratorTarget* const target = exp.Target;
+    cmStateEnums::TargetType targetType = this->GetExportTargetType(target);
+
+    Json::Value* const component =
+      this->GenerateImportTarget(components, target, targetType);
+    if (!component) {
+      return false;
+    }
+
+    ImportPropertyMap properties;
+    if (!this->PopulateInterfaceProperties(target, properties)) {
+      return false;
+    }
+    this->PopulateInterfaceLinkLibrariesProperty(
+      target, cmGeneratorExpression::InstallInterface, properties);
+
+    if (targetType != cmStateEnums::INTERFACE_LIBRARY) {
+      auto configurations = Json::Value{ Json::objectValue };
+
+      // Add per-configuration properties.
+      for (std::string const& c : this->Configurations) {
+        this->GenerateInterfacePropertiesConfig(configurations, target, c);
+      }
+
+      if (!configurations.empty()) {
+        (*component)["configurations"] = configurations;
+      }
+    }
+
+    // Set configuration-agnostic properties for component.
+    this->GenerateInterfaceProperties(*component, target, properties);
+  }
+
+  this->GeneratePackageRequires(root);
+
+  // Write the primary packing information file.
+  this->WritePackageInfo(root, os);
+
+  bool result = true;
+
+  return result;
+}
+
+void cmExportBuildPackageInfoGenerator::GenerateInterfacePropertiesConfig(
+  Json::Value& configurations, cmGeneratorTarget* target,
+  std::string const& config)
+{
+  std::string const& suffix = PropertyConfigSuffix(config);
+
+  ImportPropertyMap properties;
+
+  assert(this->GetExportTargetType(target) != cmStateEnums::INTERFACE_LIBRARY);
+  this->SetImportLocationProperty(config, suffix, target, properties);
+  if (properties.empty()) {
+    return;
+  }
+
+  this->SetImportDetailProperties(config, suffix, target, properties);
+
+  // TODO: PUBLIC_HEADER_LOCATION
+
+  Json::Value component =
+    this->GenerateInterfaceConfigProperties(suffix, properties);
+  if (!component.empty()) {
+    configurations[config.empty() ? std::string{ "noconfig" } : config] =
+      std::move(component);
+  }
+}
+
+std::string cmExportBuildPackageInfoGenerator::GetCxxModulesDirectory() const
+{
+  // TODO: Implement a not-CMake-specific mechanism for providing module
+  // information.
+  return {};
+}
diff --git a/Source/cmExportBuildPackageInfoGenerator.h b/Source/cmExportBuildPackageInfoGenerator.h
new file mode 100644
index 0000000..0851d33
--- /dev/null
+++ b/Source/cmExportBuildPackageInfoGenerator.h
@@ -0,0 +1,50 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file LICENSE.rst or https://cmake.org/licensing for details.  */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <iosfwd>
+#include <string>
+
+#include "cmExportBuildFileGenerator.h"
+#include "cmExportPackageInfoGenerator.h"
+
+namespace Json {
+class Value;
+}
+
+class cmGeneratorTarget;
+class cmPackageInfoArguments;
+
+/** \class cmExportBuildPackageInfoGenerator
+ * \brief Generate a file exporting targets from a build tree.
+ *
+ * cmExportBuildCMakeConfigGenerator generates a file exporting targets from
+ * a build tree.  This exports the targets to the Common Package Specification
+ * (https://cps-org.github.io/cps/).
+ *
+ * This is used to implement the export() command.
+ */
+class cmExportBuildPackageInfoGenerator
+  : public cmExportBuildFileGenerator
+  , public cmExportPackageInfoGenerator
+{
+public:
+  cmExportBuildPackageInfoGenerator(cmPackageInfoArguments arguments);
+
+protected:
+  // Implement virtual methods from the superclass.
+  bool GenerateMainFile(std::ostream& os) override;
+  void GenerateImportTargetsConfig(std::ostream&, std::string const&,
+                                   std::string const&) override
+  {
+  }
+
+  void GenerateInterfacePropertiesConfig(Json::Value& configurations,
+                                         cmGeneratorTarget* target,
+                                         std::string const& config);
+
+  std::string GetCxxModulesDirectory() const override;
+  // TODO: Generate C++ module info in a not-CMake-specific format.
+};
diff --git a/Source/cmExportCMakeConfigGenerator.cxx b/Source/cmExportCMakeConfigGenerator.cxx
index 1bf43ca..ce9610a 100644
--- a/Source/cmExportCMakeConfigGenerator.cxx
+++ b/Source/cmExportCMakeConfigGenerator.cxx
@@ -173,7 +173,7 @@
   // Isolate the file policy level.
   // Support CMake versions as far back as the
   // RequiredCMakeVersion{Major,Minor,Patch}, but also support using NEW
-  // policy settings for up to CMake 3.30 (this upper limit may be reviewed
+  // policy settings for up to CMake 3.31 (this upper limit may be reviewed
   // and increased from time to time). This reduces the opportunity for CMake
   // warnings when an older export file is later used with newer CMake
   // versions.
@@ -182,7 +182,7 @@
         "cmake_policy(VERSION "
      << this->RequiredCMakeVersionMajor << '.'
      << this->RequiredCMakeVersionMinor << '.'
-     << this->RequiredCMakeVersionPatch << "...3.30)\n";
+     << this->RequiredCMakeVersionPatch << "...3.31)\n";
   /* clang-format on */
 }
 
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 21b6d53..42590f3 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -21,11 +21,13 @@
 #include "cmExportBuildAndroidMKGenerator.h"
 #include "cmExportBuildCMakeConfigGenerator.h"
 #include "cmExportBuildFileGenerator.h"
+#include "cmExportBuildPackageInfoGenerator.h"
 #include "cmExportSet.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmPackageInfoArguments.h"
 #include "cmPolicies.h"
 #include "cmRange.h"
 #include "cmStateTypes.h"
@@ -61,14 +63,14 @@
     return HandlePackage(args, status);
   }
 
-  struct Arguments
+  struct Arguments : cmPackageInfoArguments
   {
-    std::string ExportSetName;
     cm::optional<ArgumentParser::MaybeEmpty<std::vector<std::string>>> Targets;
-    std::string Namespace;
-    std::string Filename;
-    std::string AndroidMKFile;
-    std::string CxxModulesDirectory;
+    ArgumentParser::NonEmpty<std::string> ExportSetName;
+    ArgumentParser::NonEmpty<std::string> Namespace;
+    ArgumentParser::NonEmpty<std::string> Filename;
+    ArgumentParser::NonEmpty<std::string> AndroidMKFile;
+    ArgumentParser::NonEmpty<std::string> CxxModulesDirectory;
     bool Append = false;
     bool ExportOld = false;
 
@@ -92,6 +94,10 @@
       parser.Bind("EXPORT_PACKAGE_DEPENDENCIES"_s,
                   &Arguments::ExportPackageDependencies);
     }
+    if (cmExperimental::HasSupportEnabled(
+          status.GetMakefile(), cmExperimental::Feature::ExportPackageInfo)) {
+      cmPackageInfoArguments::Bind(parser);
+    }
   } else if (args[0] == "SETUP") {
     parser.Bind("SETUP"_s, &Arguments::ExportSetName);
     if (cmExperimental::HasSupportEnabled(
@@ -108,7 +114,7 @@
   }
 
   std::vector<std::string> unknownArgs;
-  Arguments const arguments = parser.Parse(args, &unknownArgs);
+  Arguments arguments = parser.Parse(args, &unknownArgs);
 
   if (!unknownArgs.empty()) {
     status.SetError("Unknown argument: \"" + unknownArgs.front() + "\".");
@@ -163,7 +169,7 @@
         } else {
           status.SetError(
             cmStrCat("Invalid enable setting for package dependency: \"",
-                     packageDependencyArguments.Enabled, "\""));
+                     packageDependencyArguments.Enabled, '"'));
           return false;
         }
       }
@@ -200,19 +206,43 @@
     return true;
   }
 
+  if (arguments.PackageName.empty()) {
+    if (!arguments.Check(status, false)) {
+      return false;
+    }
+  } else {
+    if (!arguments.Filename.empty()) {
+      status.SetError("PACKAGE_INFO and FILE are mutually exclusive.");
+      return false;
+    }
+    if (!arguments.Namespace.empty()) {
+      status.SetError("PACKAGE_INFO and NAMESPACE are mutually exclusive.");
+      return false;
+    }
+    if (!arguments.Check(status) ||
+        !arguments.SetMetadataFromProject(status)) {
+      return false;
+    }
+  }
+
   std::string fname;
   bool android = false;
+  bool cps = false;
   if (!arguments.AndroidMKFile.empty()) {
     fname = arguments.AndroidMKFile;
     android = true;
-  }
-  if (arguments.Filename.empty() && fname.empty()) {
+  } else if (arguments.Filename.empty()) {
     if (args[0] != "EXPORT") {
       status.SetError("FILE <filename> option missing.");
       return false;
     }
-    fname = arguments.ExportSetName + ".cmake";
-  } else if (fname.empty()) {
+    if (arguments.PackageName.empty()) {
+      fname = arguments.ExportSetName + ".cmake";
+    } else {
+      fname = arguments.GetPackageFileName();
+      cps = true;
+    }
+  } else {
     // Make sure the file has a .cmake extension.
     if (cmSystemTools::GetFilenameLastExtension(arguments.Filename) !=
         ".cmake") {
@@ -298,11 +328,17 @@
   // and APPEND is not specified, if CMP0103 is OLD ignore previous definition
   // else raise an error
   if (gg->GetExportedTargetsFile(fname)) {
+    if (cps) {
+      status.SetError(cmStrCat("command already specified for the file "_s,
+                               cmSystemTools::GetFilenameName(fname), '.'));
+      return false;
+    }
     switch (mf.GetPolicyStatus(cmPolicies::CMP0103)) {
       case cmPolicies::WARN:
         mf.IssueMessage(
           MessageType::AUTHOR_WARNING,
-          cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0103), '\n',
+          cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0103),
+                   "\n"
                    "export() command already specified for the file\n  ",
                    arguments.Filename, "\nDid you miss 'APPEND' keyword?"));
         CM_FALLTHROUGH;
@@ -316,21 +352,25 @@
     }
   }
 
-  // Setup export file generation.
+  // Set up export file generation.
   std::unique_ptr<cmExportBuildFileGenerator> ebfg = nullptr;
   if (android) {
     auto ebag = cm::make_unique<cmExportBuildAndroidMKGenerator>();
+    ebag->SetNamespace(arguments.Namespace);
     ebag->SetAppendMode(arguments.Append);
     ebfg = std::move(ebag);
+  } else if (cps) {
+    auto ebpg = cm::make_unique<cmExportBuildPackageInfoGenerator>(arguments);
+    ebfg = std::move(ebpg);
   } else {
     auto ebcg = cm::make_unique<cmExportBuildCMakeConfigGenerator>();
+    ebcg->SetNamespace(arguments.Namespace);
     ebcg->SetAppendMode(arguments.Append);
     ebcg->SetExportOld(arguments.ExportOld);
     ebcg->SetExportPackageDependencies(arguments.ExportPackageDependencies);
     ebfg = std::move(ebcg);
   }
   ebfg->SetExportFile(fname.c_str());
-  ebfg->SetNamespace(arguments.Namespace);
   ebfg->SetCxxModuleDirectory(arguments.CxxModulesDirectory);
   if (exportSet) {
     ebfg->SetExportSet(exportSet);
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 583a256..477453d 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -78,19 +78,21 @@
   return this->GenerateImportFile(*foutPtr);
 }
 
+std::string cmExportFileGenerator::PropertyConfigSuffix(
+  std::string const& config)
+{
+  // Construct the property configuration suffix.
+  if (config.empty()) {
+    return "_NOCONFIG";
+  }
+  return cmStrCat('_', cmSystemTools::UpperCase(config));
+}
+
 void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
                                                  std::string const& config)
 {
-  // Construct the property configuration suffix.
-  std::string suffix = "_";
-  if (!config.empty()) {
-    suffix += cmSystemTools::UpperCase(config);
-  } else {
-    suffix += "NOCONFIG";
-  }
-
   // Generate the per-config target information.
-  this->GenerateImportTargetsConfig(os, config, suffix);
+  this->GenerateImportTargetsConfig(os, config, PropertyConfigSuffix(config));
 }
 
 bool cmExportFileGenerator::PopulateInterfaceProperties(
@@ -115,6 +117,9 @@
   this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
                                   target, properties);
 
+  this->PopulateInterfaceProperty("SPDX_LICENSE", target, preprocessRule,
+                                  properties);
+
   std::string errorMessage;
   if (!this->PopulateCxxModuleExportProperties(
         target, properties, preprocessRule, includesDestinationDirs,
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 740fbba..c32d82b 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -170,6 +170,8 @@
   bool AddTargetNamespace(std::string& input, cmGeneratorTarget const* target,
                           cmLocalGenerator const* lg);
 
+  static std::string PropertyConfigSuffix(std::string const& config);
+
   // The namespace in which the exports are placed in the generated file.
   std::string Namespace;
 
diff --git a/Source/cmExportInstallCMakeConfigGenerator.cxx b/Source/cmExportInstallCMakeConfigGenerator.cxx
index 2154e69..a039be4 100644
--- a/Source/cmExportInstallCMakeConfigGenerator.cxx
+++ b/Source/cmExportInstallCMakeConfigGenerator.cxx
@@ -16,6 +16,7 @@
 #include "cmExportFileGenerator.h"
 #include "cmExportSet.h"
 #include "cmFileSet.h"
+#include "cmGenExContext.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorTarget.h"
@@ -286,7 +287,8 @@
     gte->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
 
   cmGeneratorExpression ge(*gte->Makefile->GetCMakeInstance());
-  auto cge = ge.Parse(te->FileSetGenerators.at(fileSet)->GetDestination());
+  auto cge =
+    ge.Parse(te->FileSetGenerators.at(fileSet->GetName())->GetDestination());
 
   for (auto const& config : configs) {
     auto unescapedDest = cge->Evaluate(gte->LocalGenerator, config, gte);
@@ -334,17 +336,17 @@
   auto directoryEntries = fileSet->CompileDirectoryEntries();
 
   cmGeneratorExpression destGe(*gte->Makefile->GetCMakeInstance());
-  auto destCge =
-    destGe.Parse(te->FileSetGenerators.at(fileSet)->GetDestination());
+  auto destCge = destGe.Parse(
+    te->FileSetGenerators.at(fileSet->GetName())->GetDestination());
 
   for (auto const& config : configs) {
-    auto directories = fileSet->EvaluateDirectoryEntries(
-      directoryEntries, gte->LocalGenerator, config, gte);
+    cm::GenEx::Context context(gte->LocalGenerator, config);
+    auto directories =
+      fileSet->EvaluateDirectoryEntries(directoryEntries, context, gte);
 
     std::map<std::string, std::vector<std::string>> files;
     for (auto const& entry : fileEntries) {
-      fileSet->EvaluateFileEntry(directories, files, entry,
-                                 gte->LocalGenerator, config, gte);
+      fileSet->EvaluateFileEntry(directories, files, entry, context, gte);
     }
     auto unescapedDest = destCge->Evaluate(gte->LocalGenerator, config, gte);
     auto dest =
diff --git a/Source/cmExportInstallPackageInfoGenerator.cxx b/Source/cmExportInstallPackageInfoGenerator.cxx
index 930c593..5a660c4 100644
--- a/Source/cmExportInstallPackageInfoGenerator.cxx
+++ b/Source/cmExportInstallPackageInfoGenerator.cxx
@@ -15,6 +15,7 @@
 #include "cmInstallExportGenerator.h"
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
+#include "cmPackageInfoArguments.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
@@ -22,14 +23,8 @@
 #include "cmTargetExport.h"
 
 cmExportInstallPackageInfoGenerator::cmExportInstallPackageInfoGenerator(
-  cmInstallExportGenerator* iegen, std::string packageName,
-  std::string version, std::string versionCompat, std::string versionSchema,
-  std::vector<std::string> defaultTargets,
-  std::vector<std::string> defaultConfigurations)
-  : cmExportPackageInfoGenerator(
-      std::move(packageName), std::move(version), std::move(versionCompat),
-      std::move(versionSchema), std::move(defaultTargets),
-      std::move(defaultConfigurations))
+  cmInstallExportGenerator* iegen, cmPackageInfoArguments arguments)
+  : cmExportPackageInfoGenerator(std::move(arguments))
   , cmExportInstallFileGenerator(iegen)
 {
 }
@@ -71,8 +66,8 @@
   }
   root["cps_path"] = packagePath;
 
-  bool requiresConfigFiles = false;
   // Create all the imported targets.
+  bool requiresConfigFiles = false;
   for (cmTargetExport const* te : allTargets) {
     cmGeneratorTarget* gt = te->Target;
     cmStateEnums::TargetType targetType = this->GetExportTargetType(te);
@@ -122,7 +117,7 @@
 {
   Json::Value root;
   root["name"] = this->GetPackageName();
-  root["configuration"] = config;
+  root["configuration"] = (config.empty() ? "noconfig" : config);
 
   Json::Value& components = root["components"];
 
@@ -139,8 +134,11 @@
     this->PopulateImportProperties(config, suffix, te.get(), properties,
                                    importedLocations);
 
-    this->GenerateInterfaceConfigProperties(components, te->Target, suffix,
-                                            properties);
+    Json::Value component =
+      this->GenerateInterfaceConfigProperties(suffix, properties);
+    if (!component.empty()) {
+      components[te->Target->GetExportName()] = std::move(component);
+    }
   }
 
   this->WritePackageInfo(root, os);
diff --git a/Source/cmExportInstallPackageInfoGenerator.h b/Source/cmExportInstallPackageInfoGenerator.h
index d7f9c27..abdd015 100644
--- a/Source/cmExportInstallPackageInfoGenerator.h
+++ b/Source/cmExportInstallPackageInfoGenerator.h
@@ -6,13 +6,13 @@
 
 #include <iosfwd>
 #include <string>
-#include <vector>
 
 #include "cmExportInstallFileGenerator.h"
 #include "cmExportPackageInfoGenerator.h"
 
 class cmGeneratorTarget;
 class cmInstallExportGenerator;
+class cmPackageInfoArguments;
 
 /** \class cmExportInstallPackageInfoGenerator
  * \brief Generate files exporting targets from an install tree.
@@ -35,11 +35,8 @@
 public:
   /** Construct with the export installer that will install the
       files.  */
-  cmExportInstallPackageInfoGenerator(
-    cmInstallExportGenerator* iegen, std::string packageName,
-    std::string version, std::string versionCompat, std::string versionSchema,
-    std::vector<std::string> defaultTargets,
-    std::vector<std::string> defaultConfigurations);
+  cmExportInstallPackageInfoGenerator(cmInstallExportGenerator* iegen,
+                                      cmPackageInfoArguments arguments);
 
   /** Compute the globbing expression used to load per-config import
       files from the main file.  */
diff --git a/Source/cmExportPackageInfoGenerator.cxx b/Source/cmExportPackageInfoGenerator.cxx
index bd8b8f8..a683025 100644
--- a/Source/cmExportPackageInfoGenerator.cxx
+++ b/Source/cmExportPackageInfoGenerator.cxx
@@ -2,6 +2,7 @@
    file LICENSE.rst or https://cmake.org/licensing for details.  */
 #include "cmExportPackageInfoGenerator.h"
 
+#include <cstddef>
 #include <memory>
 #include <set>
 #include <utility>
@@ -14,6 +15,7 @@
 #include <cm3p/json/value.h>
 #include <cm3p/json/writer.h>
 
+#include "cmArgumentParserTypes.h"
 #include "cmExportSet.h"
 #include "cmFindPackageStack.h"
 #include "cmGeneratorExpression.h"
@@ -21,6 +23,7 @@
 #include "cmList.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmPackageInfoArguments.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmTarget.h"
@@ -29,15 +32,15 @@
 static std::string const kCPS_VERSION_STR = "0.13.0";
 
 cmExportPackageInfoGenerator::cmExportPackageInfoGenerator(
-  std::string packageName, std::string version, std::string versionCompat,
-  std::string versionSchema, std::vector<std::string> defaultTargets,
-  std::vector<std::string> defaultConfigurations)
-  : PackageName(std::move(packageName))
-  , PackageVersion(std::move(version))
-  , PackageVersionCompat(std::move(versionCompat))
-  , PackageVersionSchema(std::move(versionSchema))
-  , DefaultTargets(std::move(defaultTargets))
-  , DefaultConfigurations(std::move(defaultConfigurations))
+  cmPackageInfoArguments arguments)
+  : PackageName(std::move(arguments.PackageName))
+  , PackageVersion(std::move(arguments.Version))
+  , PackageVersionCompat(std::move(arguments.VersionCompat))
+  , PackageVersionSchema(std::move(arguments.VersionSchema))
+  , PackageDescription(std::move(arguments.Description))
+  , PackageWebsite(std::move(arguments.Website))
+  , DefaultTargets(std::move(arguments.DefaultTargets))
+  , DefaultConfigurations(std::move(arguments.DefaultConfigs))
 {
 }
 
@@ -62,8 +65,18 @@
 }
 
 namespace {
+bool SetProperty(Json::Value& object, std::string const& property,
+                 std::string const& value)
+{
+  if (!value.empty()) {
+    object[property] = value;
+    return true;
+  }
+  return false;
+}
+
 template <typename T>
-void buildArray(Json::Value& object, std::string const& property,
+void BuildArray(Json::Value& object, std::string const& property,
                 T const& values)
 {
   if (!values.empty()) {
@@ -104,20 +117,17 @@
   package["name"] = this->GetPackageName();
   package["cps_version"] = std::string(kCPS_VERSION_STR);
 
-  if (!this->PackageVersion.empty()) {
-    package["version"] = this->PackageVersion;
-    if (!this->PackageVersionCompat.empty()) {
-      package["compat_version"] = this->PackageVersionCompat;
-    }
-    if (!this->PackageVersionSchema.empty()) {
-      package["version_schema"] = this->PackageVersionSchema;
-    }
+  if (SetProperty(package, "version", this->PackageVersion)) {
+    SetProperty(package, "compat_version", this->PackageVersionCompat);
+    SetProperty(package, "version_schema", this->PackageVersionSchema);
   }
 
-  buildArray(package, "default_components", this->DefaultTargets);
-  buildArray(package, "configurations", this->DefaultConfigurations);
+  BuildArray(package, "default_components", this->DefaultTargets);
+  BuildArray(package, "configurations", this->DefaultConfigurations);
 
-  // TODO: description, website, license
+  SetProperty(package, "description", this->PackageDescription);
+  SetProperty(package, "website", this->PackageWebsite);
+  // TODO: license
 
   return package;
 }
@@ -204,19 +214,24 @@
   this->GenerateInterfaceListProperty(result, component, target, "includes",
                                       "INCLUDE_DIRECTORIES"_s, properties);
 
-  // TODO: description, license
+  this->GenerateProperty(result, component, target, "license", "SPDX_LICENSE",
+                         properties);
+
+  // TODO: description
 
   return result;
 }
 
 namespace {
-bool forbidGeneratorExpressions(std::string const& propertyName,
-                                std::string const& propertyValue,
-                                cmGeneratorTarget const* target)
+bool ForbidGeneratorExpressions(
+  cmGeneratorTarget const* target, std::string const& propertyName,
+  std::string const& propertyValue, std::string& evaluatedValue,
+  std::map<std::string, std::vector<std::string>>& allowList)
 {
-  std::string const& evaluatedValue = cmGeneratorExpression::Preprocess(
-    propertyValue, cmGeneratorExpression::StripAllGeneratorExpressions);
-  if (evaluatedValue != propertyValue) {
+  size_t const allowedExpressions = allowList.size();
+  evaluatedValue = cmGeneratorExpression::Collect(propertyValue, allowList);
+  if (evaluatedValue != propertyValue &&
+      allowList.size() > allowedExpressions) {
     target->Makefile->IssueMessage(
       MessageType::FATAL_ERROR,
       cmStrCat("Property \"", propertyName, "\" of target \"",
@@ -224,8 +239,32 @@
                "\" contains a generator expression. This is not allowed."));
     return false;
   }
+  // Forbid Nested Generator Expressions
+  for (auto const& genexp : allowList) {
+    for (auto const& value : genexp.second) {
+      if (value.find("$<") != std::string::npos) {
+        target->Makefile->IssueMessage(
+          MessageType::FATAL_ERROR,
+          cmStrCat(
+            "$<", genexp.first, ":...> expression in \"", propertyName,
+            "\" of target \"", target->GetName(),
+            "\" contains a generator expression. This is not allowed."));
+        return false;
+      }
+    }
+  }
   return true;
 }
+
+bool ForbidGeneratorExpressions(cmGeneratorTarget const* target,
+                                std::string const& propertyName,
+                                std::string const& propertyValue)
+{
+  std::map<std::string, std::vector<std::string>> allowList;
+  std::string evaluatedValue;
+  return ForbidGeneratorExpressions(target, propertyName, propertyValue,
+                                    evaluatedValue, allowList);
+}
 }
 
 bool cmExportPackageInfoGenerator::NoteLinkedTarget(
@@ -266,7 +305,8 @@
         cmStrCat("Target \"", target->GetName(), "\" references target \"",
                  linkedName, "\", which comes from the \"", pkgName,
                  "\" package, but does not belong to the package's "
-                 "canonical namespace. This is not allowed."));
+                 "canonical namespace (\"",
+                 prefix, "\"). This is not allowed."));
       return false;
     }
 
@@ -277,7 +317,7 @@
     return true;
   }
 
-  // Target belongs to multiple namespaces or multiple export sets.
+  // Target belongs to another export from this build.
   auto const& exportInfo = this->FindExportInfo(linkedTarget);
   if (exportInfo.Namespaces.size() == 1 && exportInfo.Sets.size() == 1) {
     auto const& linkNamespace = *exportInfo.Namespaces.begin();
@@ -302,6 +342,7 @@
     return true;
   }
 
+  // Target belongs to multiple namespaces or multiple export sets.
   // cmExportFileGenerator::HandleMissingTarget should have complained about
   // this already.
   return false;
@@ -316,32 +357,44 @@
     return;
   }
 
-  // TODO: Support $<LINK_ONLY>.
-  if (!forbidGeneratorExpressions(iter->first, iter->second, target)) {
+  // Extract any $<LINK_ONLY:...> from the link libraries, and assert that no
+  // other generator expressions are present.
+  std::map<std::string, std::vector<std::string>> allowList = { { "LINK_ONLY",
+                                                                  {} } };
+  std::string interfaceLinkLibraries;
+  if (!ForbidGeneratorExpressions(target, iter->first, iter->second,
+                                  interfaceLinkLibraries, allowList)) {
     result = false;
     return;
   }
 
-  std::vector<std::string> buildRequires;
-  // std::vector<std::string> linkRequires; TODO
   std::vector<std::string> linkLibraries;
+  std::vector<std::string> linkRequires;
+  std::vector<std::string> buildRequires;
 
-  for (auto const& name : cmList{ iter->second }) {
-    auto const& ti = this->LinkTargets.find(name);
-    if (ti != this->LinkTargets.end()) {
-      if (ti->second.empty()) {
-        result = false;
+  auto addLibraries = [this, &linkLibraries,
+                       &result](std::vector<std::string> const& names,
+                                std::vector<std::string>& output) -> void {
+    for (auto const& name : names) {
+      auto const& ti = this->LinkTargets.find(name);
+      if (ti != this->LinkTargets.end()) {
+        if (ti->second.empty()) {
+          result = false;
+        } else {
+          output.emplace_back(ti->second);
+        }
       } else {
-        buildRequires.emplace_back(ti->second);
+        linkLibraries.emplace_back(name);
       }
-    } else {
-      linkLibraries.emplace_back(name);
     }
-  }
+  };
 
-  buildArray(component, "requires", buildRequires);
-  // buildArray(component, "link_requires", linkRequires); TODO
-  buildArray(component, "link_libraries", linkLibraries);
+  addLibraries(allowList["LINK_ONLY"], linkRequires);
+  addLibraries(cmList{ interfaceLinkLibraries }, buildRequires);
+
+  BuildArray(component, "requires", buildRequires);
+  BuildArray(component, "link_requires", linkRequires);
+  BuildArray(component, "link_libraries", linkLibraries);
 }
 
 void cmExportPackageInfoGenerator::GenerateInterfaceCompileFeatures(
@@ -353,7 +406,7 @@
     return;
   }
 
-  if (!forbidGeneratorExpressions(iter->first, iter->second, target)) {
+  if (!ForbidGeneratorExpressions(target, iter->first, iter->second)) {
     result = false;
     return;
   }
@@ -369,7 +422,7 @@
     }
   }
 
-  buildArray(component, "compile_features", features);
+  BuildArray(component, "compile_features", features);
 }
 
 void cmExportPackageInfoGenerator::GenerateInterfaceCompileDefines(
@@ -382,7 +435,7 @@
   }
 
   // TODO: Support language-specific defines.
-  if (!forbidGeneratorExpressions(iter->first, iter->second, target)) {
+  if (!ForbidGeneratorExpressions(target, iter->first, iter->second)) {
     result = false;
     return;
   }
@@ -398,7 +451,7 @@
   }
 
   if (!defines.empty()) {
-    component["compile_definitions"]["*"] = std::move(defines);
+    component["definitions"]["*"] = std::move(defines);
   }
 }
 
@@ -413,7 +466,7 @@
     return;
   }
 
-  if (!forbidGeneratorExpressions(prop, iter->second, target)) {
+  if (!ForbidGeneratorExpressions(target, prop, iter->second)) {
     result = false;
     return;
   }
@@ -424,8 +477,25 @@
   }
 }
 
-void cmExportPackageInfoGenerator::GenerateInterfaceConfigProperties(
-  Json::Value& components, cmGeneratorTarget const* target,
+void cmExportPackageInfoGenerator::GenerateProperty(
+  bool& result, Json::Value& component, cmGeneratorTarget const* target,
+  std::string const& outName, std::string const& inName,
+  ImportPropertyMap const& properties) const
+{
+  auto const& iter = properties.find(inName);
+  if (iter == properties.end()) {
+    return;
+  }
+
+  if (!ForbidGeneratorExpressions(target, inName, iter->second)) {
+    result = false;
+    return;
+  }
+
+  component[outName] = iter->second;
+}
+
+Json::Value cmExportPackageInfoGenerator::GenerateInterfaceConfigProperties(
   std::string const& suffix, ImportPropertyMap const& properties) const
 {
   Json::Value component;
@@ -452,11 +522,9 @@
           languages.emplace_back(std::move(ll));
         }
       }
-      buildArray(component, "link_languages", languages);
+      BuildArray(component, "link_languages", languages);
     }
   }
 
-  if (!component.empty()) {
-    components[target->GetExportName()] = component;
-  }
+  return component;
 }
diff --git a/Source/cmExportPackageInfoGenerator.h b/Source/cmExportPackageInfoGenerator.h
index 4ca9dd3..fb7d79f 100644
--- a/Source/cmExportPackageInfoGenerator.h
+++ b/Source/cmExportPackageInfoGenerator.h
@@ -15,11 +15,13 @@
 #include "cmExportFileGenerator.h"
 #include "cmStateTypes.h"
 
-class cmGeneratorTarget;
 namespace Json {
 class Value;
 }
 
+class cmGeneratorTarget;
+class cmPackageInfoArguments;
+
 /** \class cmExportPackageInfoGenerator
  * \brief Generate Common Package Specification package information files
  * exporting targets from a build or install tree.
@@ -32,11 +34,7 @@
 class cmExportPackageInfoGenerator : virtual public cmExportFileGenerator
 {
 public:
-  cmExportPackageInfoGenerator(std::string packageName, std::string version,
-                               std::string versionCompat,
-                               std::string versionSchema,
-                               std::vector<std::string> defaultTargets,
-                               std::vector<std::string> defaultConfigurations);
+  cmExportPackageInfoGenerator(cmPackageInfoArguments arguments);
 
   using cmExportFileGenerator::GenerateImportFile;
 
@@ -62,8 +60,7 @@
   bool GenerateInterfaceProperties(Json::Value& component,
                                    cmGeneratorTarget const* target,
                                    ImportPropertyMap const& properties) const;
-  void GenerateInterfaceConfigProperties(
-    Json::Value& components, cmGeneratorTarget const* target,
+  Json::Value GenerateInterfaceConfigProperties(
     std::string const& suffix, ImportPropertyMap const& properties) const;
 
   cm::string_view GetImportPrefixWithSlash() const override;
@@ -102,10 +99,17 @@
     std::string const& outName, cm::string_view inName,
     ImportPropertyMap const& properties) const;
 
+  void GenerateProperty(bool& result, Json::Value& component,
+                        cmGeneratorTarget const* target,
+                        std::string const& outName, std::string const& inName,
+                        ImportPropertyMap const& properties) const;
+
   std::string const PackageName;
   std::string const PackageVersion;
   std::string const PackageVersionCompat;
   std::string const PackageVersionSchema;
+  std::string const PackageDescription;
+  std::string const PackageWebsite;
   std::vector<std::string> DefaultTargets;
   std::vector<std::string> DefaultConfigurations;
 
diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx
index f5d93ba..d96523e 100644
--- a/Source/cmExportSet.cxx
+++ b/Source/cmExportSet.cxx
@@ -40,9 +40,8 @@
       tgtExport->Target->Target->GetAllInterfaceFileSets();
     auto const fileSetInTargetExport =
       [&tgtExport, lg](std::string const& fileSetName) -> bool {
-      auto* fileSet = tgtExport->Target->Target->GetFileSet(fileSetName);
-
-      if (!tgtExport->FileSetGenerators.count(fileSet)) {
+      if (tgtExport->FileSetGenerators.find(fileSetName) ==
+          tgtExport->FileSetGenerators.end()) {
         lg->IssueMessage(MessageType::FATAL_ERROR,
                          cmStrCat("File set \"", fileSetName,
                                   "\" is listed in interface file sets of ",
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index e67df5f..20c0714 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -9,6 +9,7 @@
 #include <cm/string_view>
 
 #include "cmFileSet.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorTarget.h"
@@ -76,6 +77,8 @@
     return std::string();
   }
 
+  cm::GenEx::Context context(tgt->LocalGenerator, this->Config, language);
+
   cmGeneratorExpression ge(*tgt->Makefile->GetCMakeInstance());
 
   std::unique_ptr<cmGeneratorExpressionDAGChecker> parentDagChecker;
@@ -83,16 +86,10 @@
     // To please constraint checks of DAGChecker, this property must have
     // LINK_OPTIONS property as parent
     parentDagChecker = cm::make_unique<cmGeneratorExpressionDAGChecker>(
-      tgt, "LINK_OPTIONS", nullptr, nullptr, tgt->GetLocalGenerator(),
-      this->Config);
+      tgt, "LINK_OPTIONS", nullptr, nullptr, context);
   }
   cmGeneratorExpressionDAGChecker dagChecker{
-    tgt,
-    propName,
-    nullptr,
-    parentDagChecker.get(),
-    tgt->GetLocalGenerator(),
-    this->Config,
+    tgt, propName, nullptr, parentDagChecker.get(), context,
   };
 
   std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*prop);
@@ -103,8 +100,7 @@
 
   cmGeneratorTarget gDummyHead(&dummyHead, tgt->GetLocalGenerator());
 
-  std::string result = cge->Evaluate(tgt->GetLocalGenerator(), this->Config,
-                                     &gDummyHead, &dagChecker, tgt, language);
+  std::string result = cge->Evaluate(context, &dagChecker, &gDummyHead, tgt);
 
   std::set<cmGeneratorTarget const*> const& allTargets =
     cge->GetAllTargetsSeen();
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index d6b24a1..a484f42 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -183,19 +183,19 @@
 {
   for (std::string const& f : this->files) {
     xml.StartElement("Unit");
-    xml.Attribute("filename", cmStrCat(fsPath, this->path, "/", f));
+    xml.Attribute("filename", cmStrCat(fsPath, this->path, '/', f));
 
     xml.StartElement("Option");
     xml.Attribute(
       "virtualFolder",
-      cmStrCat("CMake Files\\", virtualFolderPath, this->path, "\\"));
+      cmStrCat("CMake Files\\", virtualFolderPath, this->path, '\\'));
     xml.EndElement();
 
     xml.EndElement();
   }
   for (Tree const& folder : this->folders) {
-    folder.BuildUnitImpl(xml, cmStrCat(virtualFolderPath, this->path, "\\"),
-                         cmStrCat(fsPath, this->path, "/"));
+    folder.BuildUnitImpl(xml, cmStrCat(virtualFolderPath, this->path, '\\'),
+                         cmStrCat(fsPath, this->path, '/'));
   }
 }
 
@@ -461,14 +461,13 @@
 
 // Write a dummy file for OBJECT libraries, so C::B can reference some file
 std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
-  cmLocalGenerator* lg, cmGeneratorTarget* target) const
+  cmGeneratorTarget* target) const
 {
   // this file doesn't seem to be used by C::B in custom makefile mode,
   // but we generate a unique file for each OBJECT library so in case
   // C::B uses it in some way, the targets don't interfere with each other.
-  std::string filename = cmStrCat(lg->GetCurrentBinaryDirectory(), '/',
-                                  lg->GetTargetDirectory(target), '/',
-                                  target->GetName(), ".objlib");
+  std::string filename =
+    cmStrCat(target->GetSupportDirectory(), '/', target->GetName(), ".objlib");
   cmGeneratedFileStream fout(filename);
   if (fout) {
     /* clang-format off */
@@ -516,8 +515,7 @@
     std::string buildType = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
     std::string location;
     if (target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
-      location =
-        this->CreateDummyTargetFile(const_cast<cmLocalGenerator*>(lg), target);
+      location = this->CreateDummyTargetFile(target);
     } else {
       location = target->GetLocation(buildType);
     }
diff --git a/Source/cmExtraCodeBlocksGenerator.h b/Source/cmExtraCodeBlocksGenerator.h
index 38ffc79..a11cf38 100644
--- a/Source/cmExtraCodeBlocksGenerator.h
+++ b/Source/cmExtraCodeBlocksGenerator.h
@@ -36,8 +36,7 @@
 
   void CreateNewProjectFile(std::vector<cmLocalGenerator*> const& lgs,
                             std::string const& filename);
-  std::string CreateDummyTargetFile(cmLocalGenerator* lg,
-                                    cmGeneratorTarget* target) const;
+  std::string CreateDummyTargetFile(cmGeneratorTarget* target) const;
 
   std::string GetCBCompilerId(cmMakefile const* mf);
   int GetCBTargetType(cmGeneratorTarget* target);
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 7538a75..3d8c939 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -123,7 +123,7 @@
       cmStateEnums::TargetType type = lt->GetType();
       std::string const& outputDir = lg->GetCurrentBinaryDirectory();
       std::string targetName = lt->GetName();
-      std::string filename = cmStrCat(outputDir, "/", targetName, ".project");
+      std::string filename = cmStrCat(outputDir, '/', targetName, ".project");
       retval.push_back(targetName);
       // Make the project file relative to the workspace
       std::string relafilename =
@@ -163,7 +163,7 @@
     std::string const& outputDir = it.second[0]->GetCurrentBinaryDirectory();
     std::string projectName = it.second[0]->GetProjectName();
     retval.push_back(projectName);
-    std::string filename = cmStrCat(outputDir, "/", projectName, ".project");
+    std::string filename = cmStrCat(outputDir, '/', projectName, ".project");
 
     // Make the project file relative to the workspace
     filename = cmSystemTools::RelativePath(this->WorkspacePath, filename);
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index b2deea8..cabfe19 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -972,8 +972,8 @@
               xml, "Build", make, buildArgs, virtDir, "", targetName.c_str());
 
             std::string cleanArgs =
-              cmStrCat("-E chdir \"", lgen->GetCurrentBinaryDirectory(),
-                       "\" \"", cmSystemTools::GetCMakeCommand(), "\" -P \"");
+              cmStrCat("-E chdir \"", lgen->GetObjectOutputRoot(), "\" \"",
+                       cmSystemTools::GetCMakeCommand(), "\" -P \"");
             cleanArgs += lgen->GetTargetDirectory(target.get());
             cleanArgs += "/cmake_clean.cmake\"";
             cmExtraEclipseCDT4Generator::AppendTarget(
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index 6bdbd9c..8d0ed60 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -270,7 +270,7 @@
         R"((^|[ ])-[DIOUWfgs][^= ]+(=\"[^"]+\"|=[^"][^ ]+)?)";
       flagRegex.compile(regexString);
       std::string workString =
-        cmStrCat(flagsString, " ", definesString, " ", includesString);
+        cmStrCat(flagsString, ' ', definesString, ' ', includesString);
       while (flagRegex.find(workString)) {
         std::string::size_type start = flagRegex.start();
         if (workString[start] == ' ') {
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index bfca378..3f60956 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -78,9 +78,9 @@
     // to generate .cxx and .h files
     if (!curr || !curr->GetPropertyAsBool("WRAP_EXCLUDE")) {
       std::string outName = cmStrCat(
-        outputDirectory, "/", cmSystemTools::GetFilenameWithoutExtension(arg));
+        outputDirectory, '/', cmSystemTools::GetFilenameWithoutExtension(arg));
       std::string hname = cmStrCat(outName, ".h");
-      std::string origname = cmStrCat(cdir, "/", arg);
+      std::string origname = cmStrCat(cdir, '/', arg);
       // add starting depends
       std::vector<std::string> depends;
       depends.push_back(origname);
diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx
index 3573422..6795c2f 100644
--- a/Source/cmFileAPI.cxx
+++ b/Source/cmFileAPI.cxx
@@ -106,14 +106,20 @@
   return versions;
 }
 
-void cmFileAPI::WriteReplies()
+void cmFileAPI::WriteReplies(IndexFor indexFor)
 {
+  bool const success = indexFor == IndexFor::Success;
+  this->ReplyIndexFor = indexFor;
+
   if (this->QueryExists) {
     cmSystemTools::MakeDirectory(this->APIv1 + "/reply");
-    this->WriteJsonFile(this->BuildReplyIndex(), "index", ComputeSuffixTime);
+    this->WriteJsonFile(this->BuildReplyIndex(), success ? "index" : "error",
+                        ComputeSuffixTime);
   }
 
-  this->RemoveOldReplyFiles();
+  if (success) {
+    this->RemoveOldReplyFiles();
+  }
 }
 
 std::vector<std::string> cmFileAPI::LoadDir(std::string const& dir)
@@ -137,7 +143,7 @@
   std::vector<std::string> files = this->LoadDir(reply_dir);
   for (std::string const& f : files) {
     if (this->ReplyFiles.find(f) == this->ReplyFiles.end()) {
-      std::string file = cmStrCat(reply_dir, "/", f);
+      std::string file = cmStrCat(reply_dir, '/', f);
       cmSystemTools::RemoveFile(file);
     }
   }
@@ -202,7 +208,7 @@
 
   // Compute the final name for the file.
   std::string suffix = computeSuffix(tmpFile);
-  std::string suffixWithExtension = cmStrCat("-", suffix, ".json");
+  std::string suffixWithExtension = cmStrCat('-', suffix, ".json");
   fileName = cmStrCat(prefix, suffixWithExtension);
 
   // Truncate the file name length
@@ -220,7 +226,7 @@
     suffix = cmCryptoHash(cmCryptoHash::AlgoSHA256)
                .HashString(toBeRemoved)
                .substr(0, newHashLength);
-    suffixWithExtension = cmStrCat("-", suffix, ".json");
+    suffixWithExtension = cmStrCat('-', suffix, ".json");
     fileName.replace(startPos, overLength, suffixWithExtension);
   }
 
@@ -443,7 +449,7 @@
   Json::Value reply = Json::objectValue;
   for (Object const& o : q.Known) {
     std::string const& name = ObjectName(o);
-    reply[name] = this->AddReplyIndexObject(o);
+    reply[name] = this->BuildReplyEntry(o);
   }
 
   for (std::string const& name : q.Unknown) {
@@ -452,6 +458,23 @@
   return reply;
 }
 
+Json::Value cmFileAPI::BuildReplyEntry(Object const& object)
+{
+  if (this->ReplyIndexFor != IndexFor::Success) {
+    switch (object.Kind) {
+      case ObjectKind::ConfigureLog:
+        break;
+      case ObjectKind::CodeModel:
+      case ObjectKind::Cache:
+      case ObjectKind::CMakeFiles:
+      case ObjectKind::Toolchains:
+      case ObjectKind::InternalTest:
+        return this->BuildReplyError("no buildsystem generated");
+    }
+  }
+  return this->AddReplyIndexObject(object);
+}
+
 Json::Value cmFileAPI::BuildReplyError(std::string const& error)
 {
   Json::Value e = Json::objectValue;
@@ -682,7 +705,7 @@
     response = this->BuildReplyError(request.Error);
     return response;
   }
-  response = this->AddReplyIndexObject(request);
+  response = this->BuildReplyEntry(request);
   return response;
 }
 
diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h
index 79fc5ad..5b639ce 100644
--- a/Source/cmFileAPI.h
+++ b/Source/cmFileAPI.h
@@ -27,8 +27,17 @@
   /** Get the list of configureLog object kind versions requested.  */
   std::vector<unsigned long> GetConfigureLogVersions();
 
+  /** Identify the situation in which WriteReplies is called.  */
+  enum class IndexFor
+  {
+    Success,
+    FailedConfigure,
+    FailedCompute,
+    FailedGenerate,
+  };
+
   /** Write fileapi replies to disk.  */
-  void WriteReplies();
+  void WriteReplies(IndexFor indexFor);
 
   /** Get the "cmake" instance with which this was constructed.  */
   cmake* GetCMakeInstance() const { return this->CMakeInstance; }
@@ -157,6 +166,9 @@
       This populates the "objects" field of the reply index.  */
   std::map<Object, Json::Value> ReplyIndexObjects;
 
+  /** Identify the situation in which WriteReplies was called.  */
+  IndexFor ReplyIndexFor = IndexFor::Success;
+
   std::unique_ptr<Json::CharReader> JsonReader;
   std::unique_ptr<Json::StreamWriter> JsonWriter;
 
@@ -177,6 +189,7 @@
   Json::Value BuildReplyIndex();
   Json::Value BuildCMake();
   Json::Value BuildReply(Query const& q);
+  Json::Value BuildReplyEntry(Object const& object);
   static Json::Value BuildReplyError(std::string const& error);
   Json::Value const& AddReplyIndexObject(Object const& o);
 
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index 5054021..eb1cb6c 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -24,6 +24,7 @@
 #include "cmExportSet.h"
 #include "cmFileAPI.h"
 #include "cmFileSet.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorTarget.h"
 #include "cmGlobalGenerator.h"
@@ -1068,22 +1069,27 @@
     }
   } else if (auto* installFileSet =
                dynamic_cast<cmInstallFileSetGenerator*>(gen)) {
+    auto const* fileSet = installFileSet->GetFileSet();
+
+    // No fileSet by that name exists for the associated target
+    if (!fileSet) {
+      return installer;
+    }
+
     installer["type"] = "fileSet";
     installer["destination"] = installFileSet->GetDestination(this->Config);
 
-    auto* fileSet = installFileSet->GetFileSet();
     auto* target = installFileSet->GetTarget();
 
+    cm::GenEx::Context context(target->LocalGenerator, this->Config);
+
     auto dirCges = fileSet->CompileDirectoryEntries();
-    auto dirs = fileSet->EvaluateDirectoryEntries(
-      dirCges, target->GetLocalGenerator(), this->Config, target);
+    auto dirs = fileSet->EvaluateDirectoryEntries(dirCges, context, target);
 
     auto entryCges = fileSet->CompileFileEntries();
     std::map<std::string, std::vector<std::string>> entries;
     for (auto const& entryCge : entryCges) {
-      fileSet->EvaluateFileEntry(dirs, entries, entryCge,
-                                 target->GetLocalGenerator(), this->Config,
-                                 target);
+      fileSet->EvaluateFileEntry(dirs, entries, entryCge, context, target);
     }
 
     Json::Value files = Json::arrayValue;
@@ -1602,18 +1608,19 @@
         continue;
       }
 
+      cm::GenEx::Context context(this->GT->LocalGenerator, this->Config);
+
       auto fileEntries = fs->CompileFileEntries();
       auto directoryEntries = fs->CompileDirectoryEntries();
 
-      auto directories = fs->EvaluateDirectoryEntries(
-        directoryEntries, this->GT->LocalGenerator, this->Config, this->GT);
+      auto directories =
+        fs->EvaluateDirectoryEntries(directoryEntries, context, this->GT);
 
       fsJson.append(this->DumpFileSet(fs, directories));
 
       std::map<std::string, std::vector<std::string>> files_per_dirs;
       for (auto const& entry : fileEntries) {
-        fs->EvaluateFileEntry(directories, files_per_dirs, entry,
-                              this->GT->LocalGenerator, this->Config,
+        fs->EvaluateFileEntry(directories, files_per_dirs, entry, context,
                               this->GT);
       }
 
diff --git a/Source/cmFileAPICommand.cxx b/Source/cmFileAPICommand.cxx
index ddc78f4..797d207 100644
--- a/Source/cmFileAPICommand.cxx
+++ b/Source/cmFileAPICommand.cxx
@@ -51,7 +51,7 @@
     }
     if (majorVersion < 1 || minorVersion < 0) {
       return cmStrCat("Given a malformed version \"", ver, "\" for ", keyword,
-                      ".");
+                      '.');
     }
     if (fileApi.AddProjectQuery(objectKind,
                                 static_cast<unsigned>(majorVersion),
diff --git a/Source/cmFileAPIConfigureLog.cxx b/Source/cmFileAPIConfigureLog.cxx
index 8870d77..3e5ba94 100644
--- a/Source/cmFileAPIConfigureLog.cxx
+++ b/Source/cmFileAPIConfigureLog.cxx
@@ -52,9 +52,11 @@
   // major version of the configureLog object kind is needed.
   Json::Value eventKindNames = Json::arrayValue;
   if (this->Version == 1) {
-    eventKindNames.append("message-v1");     // WriteMessageEvent
-    eventKindNames.append("try_compile-v1"); // WriteTryCompileEvent
-    eventKindNames.append("try_run-v1");     // WriteTryRunEvent
+    eventKindNames.append("message-v1");      // WriteMessageEvent
+    eventKindNames.append("try_compile-v1");  // WriteTryCompileEvent
+    eventKindNames.append("try_run-v1");      // WriteTryRunEvent
+    eventKindNames.append("find-v1");         // WriteFindBaseEvent
+    eventKindNames.append("find_package-v1"); // WriteFindPackageEvent
   }
   return eventKindNames;
 }
diff --git a/Source/cmFileAPIToolchains.cxx b/Source/cmFileAPIToolchains.cxx
index 516aefa..74d69bf 100644
--- a/Source/cmFileAPIToolchains.cxx
+++ b/Source/cmFileAPIToolchains.cxx
@@ -122,7 +122,7 @@
                                        ToolchainVariable const& variable)
 {
   std::string const variableName =
-    cmStrCat("CMAKE_", lang, "_", variable.VariableSuffix);
+    cmStrCat("CMAKE_", lang, '_', variable.VariableSuffix);
 
   if (variable.IsList) {
     cmValue data = mf->GetDefinition(variableName);
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d215681..88f9f0c 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -234,7 +234,7 @@
     char c;
     while ((sizeLimit > 0) && (file.get(c))) {
       char hex[4];
-      snprintf(hex, sizeof(hex), "%.2x", c & 0xff);
+      snprintf(hex, sizeof(hex), "%.2x", c & 0xFFu);
       output += hex;
       sizeLimit--;
     }
@@ -417,7 +417,8 @@
                 "CMAKE_POLICY_WARNING_CMP0159")) {
             status.GetMakefile().IssueMessage(
               MessageType::AUTHOR_WARNING,
-              cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0159), '\n',
+              cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0159),
+                       "\n"
                        "For compatibility, CMake is leaving CMAKE_MATCH_<n> "
                        "unchanged."));
           }
@@ -446,7 +447,7 @@
       arg_mode = arg_none;
     } else {
       status.SetError(
-        cmStrCat("STRINGS given unknown argument \"", args[i], "\""));
+        cmStrCat("STRINGS given unknown argument \"", args[i], '"'));
       return false;
     }
   }
@@ -1703,7 +1704,9 @@
   cmsys::ofstream* fout = static_cast<cmsys::ofstream*>(data);
   if (fout) {
     char const* chPtr = static_cast<char*>(ptr);
-    fout->write(chPtr, realsize);
+    if (!fout->write(chPtr, realsize)) {
+      return CURL_WRITEFUNC_ERROR;
+    }
   }
   return realsize;
 }
@@ -2129,7 +2132,9 @@
   if (!file.empty()) {
     fout.open(file.c_str(), std::ios::binary);
     if (!fout) {
-      status.SetError("DOWNLOAD cannot open file for write.");
+      status.SetError(cmStrCat("DOWNLOAD cannot open file for write\n"
+                               "  file: \"",
+                               file, '"'));
       return false;
     }
   }
@@ -2282,6 +2287,14 @@
   g_curl.release();
   ::curl_easy_cleanup(curl);
 
+  // Explicitly close the file so we can check for write errors.
+  if (!file.empty()) {
+    fout.close();
+    if (!fout) {
+      res = CURLE_WRITE_ERROR;
+    }
+  }
+
   if (!statusVar.empty()) {
     std::string m = curl_easy_strerror(res);
     if ((res == CURLE_SSL_CONNECT_ERROR ||
@@ -2305,27 +2318,23 @@
     status.GetMakefile().AddDefinition(logVar, chunkDebug.data());
   }
 
-  // Explicitly flush/close so we can measure the md5 accurately.
-  //
-  if (!file.empty()) {
-    fout.flush();
-    fout.close();
-  }
-
   // Verify MD5 sum if requested:
   //
   if (hash) {
     if (res != CURLE_OK) {
-      status.SetError(cmStrCat(
-        "DOWNLOAD cannot compute hash on failed download\n"
-        "  status: [",
-        static_cast<int>(res), ";\"", ::curl_easy_strerror(res), "\"]"));
+      status.SetError(
+        cmStrCat("DOWNLOAD cannot compute hash on failed download\n"
+                 "  from url: \"",
+                 url, "\"\n  status: [", static_cast<int>(res), ";\"",
+                 ::curl_easy_strerror(res), "\"]"));
       return false;
     }
 
     std::string actualHash = hash->HashFile(file);
     if (actualHash.empty()) {
-      status.SetError("DOWNLOAD cannot compute hash on downloaded file");
+      status.SetError(cmStrCat("DOWNLOAD cannot compute hash on download\n"
+                               "  for file: \"",
+                               file, '"'));
       return false;
     }
 
@@ -2339,14 +2348,14 @@
       }
 
       status.SetError(cmStrCat("DOWNLOAD HASH mismatch\n"
-                               "  for file: [",
+                               "  for file: \"",
                                file,
-                               "]\n"
-                               "    expected hash: [",
+                               "\"\n"
+                               "    expected hash: \"",
                                expectedHash,
-                               "]\n"
-                               "      actual hash: [",
-                               actualHash, "]\n"));
+                               "\"\n"
+                               "      actual hash: \"",
+                               actualHash, "\"\n"));
       return false;
     }
   }
@@ -2984,8 +2993,9 @@
     } else {
       status.GetMakefile().IssueMessage(
         MessageType::FATAL_ERROR,
-        cmStrCat("expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or ",
-                 "TIMEOUT\nbut got: \"", args[i], "\"."));
+        cmStrCat("expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or "
+                 "TIMEOUT\nbut got: \"",
+                 args[i], "\"."));
       return false;
     }
   }
diff --git a/Source/cmFileCopier.cxx b/Source/cmFileCopier.cxx
index c541bb9..65320aa 100644
--- a/Source/cmFileCopier.cxx
+++ b/Source/cmFileCopier.cxx
@@ -487,7 +487,7 @@
   while (cmSystemTools::ReadSymlink(fromFile, newFromFile)) {
     if (!cmSystemTools::FileIsFullPath(newFromFile)) {
       std::string fromFilePath = cmSystemTools::GetFilenamePath(fromFile);
-      newFromFile = cmStrCat(fromFilePath, "/", newFromFile);
+      newFromFile = cmStrCat(fromFilePath, '/', newFromFile);
     }
 
     std::string symlinkTarget = cmSystemTools::GetFilenameName(newFromFile);
@@ -519,7 +519,7 @@
     }
 
     fromFile = newFromFile;
-    toFile = cmStrCat(toFilePath, "/", symlinkTarget);
+    toFile = cmStrCat(toFilePath, '/', symlinkTarget);
   }
 
   return true;
diff --git a/Source/cmFileSet.cxx b/Source/cmFileSet.cxx
index 066a494..3861d61 100644
--- a/Source/cmFileSet.cxx
+++ b/Source/cmFileSet.cxx
@@ -14,6 +14,7 @@
 
 #include "cmsys/RegularExpression.hxx"
 
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
 #include "cmList.h"
 #include "cmListFileCache.h"
@@ -156,8 +157,7 @@
 
 std::vector<std::string> cmFileSet::EvaluateDirectoryEntries(
   std::vector<std::unique_ptr<cmCompiledGeneratorExpression>> const& cges,
-  cmLocalGenerator* lg, std::string const& config,
-  cmGeneratorTarget const* target,
+  cm::GenEx::Context const& context, cmGeneratorTarget const* target,
   cmGeneratorExpressionDAGChecker* dagChecker) const
 {
   struct DirCacheEntry
@@ -169,11 +169,11 @@
   std::unordered_map<std::string, DirCacheEntry> dirCache;
   std::vector<std::string> result;
   for (auto const& cge : cges) {
-    auto entry = cge->Evaluate(lg, config, target, dagChecker);
+    auto entry = cge->Evaluate(context, dagChecker, target);
     cmList dirs{ entry };
     for (std::string dir : dirs) {
       if (!cmSystemTools::FileIsFullPath(dir)) {
-        dir = cmStrCat(lg->GetCurrentSourceDirectory(), '/', dir);
+        dir = cmStrCat(context.LG->GetCurrentSourceDirectory(), '/', dir);
       }
 
       auto dirCacheResult = dirCache.emplace(dir, DirCacheEntry());
@@ -198,7 +198,7 @@
                                            priorDirCacheEntry.collapsedDir) ||
              cmSystemTools::IsSubDirectory(priorDirCacheEntry.collapsedDir,
                                            dirCacheEntry.collapsedDir))) {
-          lg->GetCMakeInstance()->IssueMessage(
+          context.LG->GetCMakeInstance()->IssueMessage(
             MessageType::FATAL_ERROR,
             cmStrCat(
               "Base directories in file set cannot be subdirectories of each "
@@ -218,14 +218,13 @@
   std::vector<std::string> const& dirs,
   std::map<std::string, std::vector<std::string>>& filesPerDir,
   std::unique_ptr<cmCompiledGeneratorExpression> const& cge,
-  cmLocalGenerator* lg, std::string const& config,
-  cmGeneratorTarget const* target,
+  cm::GenEx::Context const& context, cmGeneratorTarget const* target,
   cmGeneratorExpressionDAGChecker* dagChecker) const
 {
-  auto files = cge->Evaluate(lg, config, target, dagChecker);
+  auto files = cge->Evaluate(context, dagChecker, target);
   for (std::string file : cmList{ files }) {
     if (!cmSystemTools::FileIsFullPath(file)) {
-      file = cmStrCat(lg->GetCurrentSourceDirectory(), '/', file);
+      file = cmStrCat(context.LG->GetCurrentSourceDirectory(), '/', file);
     }
     auto collapsedFile = cmSystemTools::CollapseFullPath(file);
     bool found = false;
@@ -246,8 +245,8 @@
       for (auto const& dir : dirs) {
         e << "\n  " << dir;
       }
-      lg->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
-                                           cge->GetBacktrace());
+      context.LG->GetCMakeInstance()->IssueMessage(
+        MessageType::FATAL_ERROR, e.str(), cge->GetBacktrace());
       return;
     }
 
diff --git a/Source/cmFileSet.h b/Source/cmFileSet.h
index 1175be8..3b37bf8 100644
--- a/Source/cmFileSet.h
+++ b/Source/cmFileSet.h
@@ -12,10 +12,15 @@
 
 #include "cmListFileCache.h"
 
+namespace cm {
+namespace GenEx {
+struct Context;
+}
+}
+
 class cmCompiledGeneratorExpression;
 struct cmGeneratorExpressionDAGChecker;
 class cmGeneratorTarget;
-class cmLocalGenerator;
 class cmMakefile;
 class cmake;
 
@@ -67,16 +72,14 @@
 
   std::vector<std::string> EvaluateDirectoryEntries(
     std::vector<std::unique_ptr<cmCompiledGeneratorExpression>> const& cges,
-    cmLocalGenerator* lg, std::string const& config,
-    cmGeneratorTarget const* target,
+    cm::GenEx::Context const& context, cmGeneratorTarget const* target,
     cmGeneratorExpressionDAGChecker* dagChecker = nullptr) const;
 
   void EvaluateFileEntry(
     std::vector<std::string> const& dirs,
     std::map<std::string, std::vector<std::string>>& filesPerDir,
     std::unique_ptr<cmCompiledGeneratorExpression> const& cge,
-    cmLocalGenerator* lg, std::string const& config,
-    cmGeneratorTarget const* target,
+    cm::GenEx::Context const& context, cmGeneratorTarget const* target,
     cmGeneratorExpressionDAGChecker* dagChecker = nullptr) const;
 
   static bool IsValidName(std::string const& name);
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index a7e00fd..b8d4765 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -7,6 +7,7 @@
 #include <deque>
 #include <iterator>
 #include <map>
+#include <memory>
 #include <utility>
 
 #include <cm/optional>
@@ -14,6 +15,7 @@
 #include <cmext/string_view>
 
 #include "cmCMakePath.h"
+#include "cmConfigureLog.h"
 #include "cmExecutionStatus.h"
 #include "cmList.h"
 #include "cmListFileCache.h"
@@ -36,6 +38,13 @@
 {
 }
 
+cmFindBase::~cmFindBase()
+{
+  if (this->DebugState) {
+    this->DebugState->Write();
+  }
+}
+
 bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
 {
   if (argsIn.size() < 2) {
@@ -79,8 +88,12 @@
     return false;
   }
   this->VariableName = args[0];
-  if (this->CheckForVariableDefined()) {
-    this->AlreadyDefined = true;
+  this->InitialState = this->GetInitialState();
+  if (this->IsFound()) {
+    if (this->DebugState) {
+      this->DebugState->FoundAt(
+        *this->Makefile->GetDefinition(this->VariableName));
+    }
     return true;
   }
 
@@ -94,6 +107,7 @@
   this->SelectDefaultMacMode();
 
   bool newStyle = false;
+  bool haveRequiredOrOptional = false;
   enum Doing
   {
     DoingNone,
@@ -129,8 +143,21 @@
       this->NoDefaultPath = true;
     } else if (args[j] == "REQUIRED") {
       doing = DoingNone;
+      if (haveRequiredOrOptional && !this->Required) {
+        this->SetError("cannot be both REQUIRED and OPTIONAL");
+        return false;
+      }
       this->Required = true;
       newStyle = true;
+      haveRequiredOrOptional = true;
+    } else if (args[j] == "OPTIONAL") {
+      doing = DoingNone;
+      if (haveRequiredOrOptional && this->Required) {
+        this->SetError("cannot be both REQUIRED and OPTIONAL");
+        return false;
+      }
+      newStyle = true;
+      haveRequiredOrOptional = true;
     } else if (args[j] == "REGISTRY_VIEW") {
       if (++j == args.size()) {
         this->SetError("missing required argument for REGISTRY_VIEW");
@@ -187,6 +214,10 @@
     }
   }
 
+  if (!haveRequiredOrOptional) {
+    this->Required = this->Makefile->IsOn("CMAKE_FIND_REQUIRED");
+  }
+
   if (this->VariableDocumentation.empty()) {
     this->VariableDocumentation = "Where can ";
     if (this->Names.empty()) {
@@ -452,7 +483,7 @@
   paths.AddSuffixes(this->SearchPathSuffixes);
 }
 
-bool cmFindBase::CheckForVariableDefined()
+cmFindBase::FindState cmFindBase::GetInitialState()
 {
   if (cmValue value = this->Makefile->GetDefinition(this->VariableName)) {
     cmState* state = this->Makefile->GetState();
@@ -478,14 +509,26 @@
       if (cached && cacheType == cmStateEnums::UNINITIALIZED) {
         this->AlreadyInCacheWithoutMetaInfo = true;
       }
-      return true;
+      return FindState::Found;
     }
+    return FindState::NotFound;
   }
-  return false;
+  return FindState::Undefined;
+}
+
+bool cmFindBase::IsFound() const
+{
+  return this->InitialState == FindState::Found;
+}
+
+bool cmFindBase::IsDefined() const
+{
+  return this->InitialState != FindState::Undefined;
 }
 
 void cmFindBase::NormalizeFindResult()
 {
+  std::string foundValue;
   if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0125) ==
       cmPolicies::NEW) {
     // ensure the path returned by find_* command is absolute
@@ -504,6 +547,7 @@
       }
     }
 
+    foundValue = value;
     if (this->StoreResultInCache) {
       // If the user specifies the entry on the command line without a
       // type we should add the type and docstring but keep the original
@@ -533,6 +577,10 @@
     // type we should add the type and docstring but keep the original
     // value.
     if (this->StoreResultInCache) {
+      auto const& existingValue =
+        this->Makefile->GetCMakeInstance()->GetCacheDefinition(
+          this->VariableName);
+      foundValue = *existingValue;
       if (this->AlreadyInCacheWithoutMetaInfo) {
         this->Makefile->AddCacheDefinition(this->VariableName, "",
                                            this->VariableDocumentation,
@@ -540,19 +588,20 @@
         if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0126) ==
               cmPolicies::NEW &&
             this->Makefile->IsNormalDefinitionSet(this->VariableName)) {
-          this->Makefile->AddDefinition(
-            this->VariableName,
-            *this->Makefile->GetCMakeInstance()->GetCacheDefinition(
-              this->VariableName));
+          this->Makefile->AddDefinition(this->VariableName, *existingValue);
         }
       }
     } else {
+      auto const& existingValue =
+        this->Makefile->GetSafeDefinition(this->VariableName);
+      foundValue = existingValue;
       // ensure a normal variable is defined.
-      this->Makefile->AddDefinition(
-        this->VariableName,
-        this->Makefile->GetSafeDefinition(this->VariableName));
+      this->Makefile->AddDefinition(this->VariableName, existingValue);
     }
   }
+  if (this->DebugState) {
+    this->DebugState->FoundAt(foundValue);
+  }
 }
 
 void cmFindBase::StoreFindResult(std::string const& value)
@@ -575,6 +624,10 @@
       this->Makefile->AddDefinition(this->VariableName, value);
     }
 
+    if (this->DebugState) {
+      this->DebugState->FoundAt(value);
+    }
+
     return;
   }
 
@@ -604,35 +657,44 @@
   }
 }
 
-cmFindBaseDebugState::cmFindBaseDebugState(std::string commandName,
-                                           cmFindBase const* findBase)
-  : FindCommand(findBase)
-  , CommandName(std::move(commandName))
+cmFindBaseDebugState::cmFindBaseDebugState(cmFindBase const* findBase)
+  : cmFindCommonDebugState(findBase->FindCommandName, findBase)
+  , FindBaseCommand(findBase)
 {
 }
 
-cmFindBaseDebugState::~cmFindBaseDebugState()
-{
-  if (!this->FindCommand->DebugMode) {
-    return;
-  }
+cmFindBaseDebugState::~cmFindBaseDebugState() = default;
 
+void cmFindBaseDebugState::FoundAtImpl(std::string const& path,
+                                       std::string regexName)
+{
+  this->FoundSearchLocation = DebugLibState{ std::move(regexName), path };
+}
+
+void cmFindBaseDebugState::FailedAtImpl(std::string const& path,
+                                        std::string regexName)
+{
+  this->FailedSearchLocations.emplace_back(std::move(regexName), path);
+}
+
+void cmFindBaseDebugState::WriteDebug() const
+{
   // clang-format off
   auto buffer =
     cmStrCat(
       this->CommandName, " called with the following settings:"
-      "\n  VAR: ", this->FindCommand->VariableName,
-      "\n  NAMES: ", cmWrap('"', this->FindCommand->Names, '"', "\n         "),
-      "\n  Documentation: ", this->FindCommand->VariableDocumentation,
+      "\n  VAR: ", this->FindBaseCommand->VariableName,
+      "\n  NAMES: ", cmWrap('"', this->FindBaseCommand->Names, '"', "\n         "),
+      "\n  Documentation: ", this->FindBaseCommand->VariableDocumentation,
       "\n  Framework"
-      "\n    Only Search Frameworks: ", this->FindCommand->SearchFrameworkOnly,
-      "\n    Search Frameworks Last: ", this->FindCommand->SearchFrameworkLast,
-      "\n    Search Frameworks First: ", this->FindCommand->SearchFrameworkFirst,
+      "\n    Only Search Frameworks: ", this->FindBaseCommand->SearchFrameworkOnly,
+      "\n    Search Frameworks Last: ", this->FindBaseCommand->SearchFrameworkLast,
+      "\n    Search Frameworks First: ", this->FindBaseCommand->SearchFrameworkFirst,
       "\n  AppBundle"
-      "\n    Only Search AppBundle: ", this->FindCommand->SearchAppBundleOnly,
-      "\n    Search AppBundle Last: ", this->FindCommand->SearchAppBundleLast,
-      "\n    Search AppBundle First: ", this->FindCommand->SearchAppBundleFirst,
-      "\n"
+      "\n    Only Search AppBundle: ", this->FindBaseCommand->SearchAppBundleOnly,
+      "\n    Search AppBundle Last: ", this->FindBaseCommand->SearchAppBundleLast,
+      "\n    Search AppBundle First: ", this->FindBaseCommand->SearchAppBundleFirst,
+      '\n'
     );
   // clang-format on
 
@@ -646,7 +708,7 @@
       "\n  CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: ", !this->FindCommand->NoSystemEnvironmentPath,
       "\n  CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: ", !this->FindCommand->NoCMakeSystemPath,
       "\n  CMAKE_FIND_USE_INSTALL_PREFIX: ", !this->FindCommand->NoCMakeInstallPath,
-      "\n"
+      '\n'
      );
     // clang-format on
   }
@@ -661,7 +723,7 @@
     buffer += cmStrCat(path, '\n');
   }
 
-  if (!this->FoundSearchLocation.path.empty()) {
+  if (this->HasBeenFound()) {
     buffer += cmStrCat("The item was found at\n  ",
                        this->FoundSearchLocation.path, '\n');
   } else {
@@ -671,18 +733,81 @@
   this->FindCommand->DebugMessage(buffer);
 }
 
-void cmFindBaseDebugState::FoundAt(std::string const& path,
-                                   std::string regexName)
+#ifndef CMAKE_BOOTSTRAP
+void cmFindBaseDebugState::WriteEvent(cmConfigureLog& log,
+                                      cmMakefile const& mf) const
 {
-  if (this->FindCommand->DebugMode) {
-    this->FoundSearchLocation = DebugLibState{ std::move(regexName), path };
+  log.BeginEvent("find-v1", mf);
+
+  // Mode is the Command name without the "find_" prefix
+  log.WriteValue("mode"_s, this->CommandName.substr(5));
+  log.WriteValue("variable"_s, this->FindBaseCommand->VariableName);
+  log.WriteValue("description"_s,
+                 this->FindBaseCommand->VariableDocumentation);
+
+  // Yes, this needs to return a `std::string`. If it returns a `const char*`,
+  // the `WriteValue` method prefers the `bool` overload. There's no overload
+  // for a `cm::string_view` because the underlying JSON library doesn't
+  // support `string_view` arguments itself.
+  auto search_opt_to_str = [](bool first, bool last,
+                              bool only) -> std::string {
+    return first ? "FIRST" : (last ? "LAST" : (only ? "ONLY" : "NEVER"));
+  };
+  log.BeginObject("settings"_s);
+  log.WriteValue("SearchFramework"_s,
+                 search_opt_to_str(this->FindCommand->SearchFrameworkFirst,
+                                   this->FindCommand->SearchFrameworkLast,
+                                   this->FindCommand->SearchFrameworkOnly));
+  log.WriteValue("SearchAppBundle"_s,
+                 search_opt_to_str(this->FindCommand->SearchAppBundleFirst,
+                                   this->FindCommand->SearchAppBundleLast,
+                                   this->FindCommand->SearchAppBundleOnly));
+  log.WriteValue("CMAKE_FIND_USE_CMAKE_PATH"_s,
+                 !this->FindCommand->NoCMakePath);
+  log.WriteValue("CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH"_s,
+                 !this->FindCommand->NoCMakeEnvironmentPath);
+  log.WriteValue("CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH"_s,
+                 !this->FindCommand->NoSystemEnvironmentPath);
+  log.WriteValue("CMAKE_FIND_USE_CMAKE_SYSTEM_PATH"_s,
+                 !this->FindCommand->NoCMakeSystemPath);
+  log.WriteValue("CMAKE_FIND_USE_INSTALL_PREFIX"_s,
+                 !this->FindCommand->NoCMakeInstallPath);
+  log.EndObject();
+
+  if (!this->FindBaseCommand->Names.empty()) {
+    log.WriteValue("names"_s, this->FindBaseCommand->Names);
   }
+  std::vector<std::string> directories;
+  directories.reserve(this->FailedSearchLocations.size());
+  for (auto const& location : this->FailedSearchLocations) {
+    directories.push_back(location.path);
+  }
+  if (!this->FindCommand->SearchPaths.empty()) {
+    log.WriteValue("candidate_directories"_s, this->FindCommand->SearchPaths);
+  }
+  if (!directories.empty()) {
+    log.WriteValue("searched_directories"_s, directories);
+  }
+  if (!this->FoundSearchLocation.path.empty()) {
+    log.WriteValue("found"_s, this->FoundSearchLocation.path);
+  } else {
+    log.WriteValue("found"_s, false);
+  }
+
+  this->WriteSearchVariables(log, mf);
+
+  log.EndEvent();
 }
 
-void cmFindBaseDebugState::FailedAt(std::string const& path,
-                                    std::string regexName)
+std::vector<std::pair<cmFindCommonDebugState::VariableSource, std::string>>
+cmFindBaseDebugState::ExtraSearchVariables() const
 {
-  if (this->FindCommand->DebugMode) {
-    this->FailedSearchLocations.emplace_back(std::move(regexName), path);
+  std::vector<std::pair<cmFindCommonDebugState::VariableSource, std::string>>
+    extraSearches;
+  if (!this->FindBaseCommand->EnvironmentPath.empty()) {
+    extraSearches.emplace_back(VariableSource::EnvironmentList,
+                               this->FindBaseCommand->EnvironmentPath);
   }
+  return extraSearches;
 }
+#endif
diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h
index 8655b22..0be2d73 100644
--- a/Source/cmFindBase.h
+++ b/Source/cmFindBase.h
@@ -11,7 +11,9 @@
 #include "cmFindCommon.h"
 #include "cmStateTypes.h"
 
+class cmConfigureLog;
 class cmExecutionStatus;
+class cmMakefile;
 
 /** \class cmFindBase
  * \brief Base class for most FIND_XXX commands.
@@ -23,7 +25,7 @@
 {
 public:
   cmFindBase(std::string findCommandName, cmExecutionStatus& status);
-  virtual ~cmFindBase() = default;
+  ~cmFindBase() override;
 
   /**
    * This is called when the command is first encountered in
@@ -40,10 +42,8 @@
   friend class cmFindBaseDebugState;
   void ExpandPaths();
 
-  // see if the VariableName is already set,
-  // also copy the documentation from the cache to VariableDocumentation
-  // if it has documentation in the cache
-  bool CheckForVariableDefined();
+  bool IsFound() const override;
+  bool IsDefined() const override;
 
   void NormalizeFindResult();
   void StoreFindResult(std::string const& value);
@@ -62,7 +62,6 @@
   // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
   std::string EnvironmentPath; // LIB,INCLUDE
 
-  bool AlreadyDefined = false;
   bool AlreadyInCacheWithoutMetaInfo = false;
   bool StoreResultInCache = true;
 
@@ -71,6 +70,18 @@
   std::string ValidatorName;
 
 private:
+  enum class FindState
+  {
+    Undefined,
+    Found,
+    NotFound,
+  };
+  // see if the VariableName is already set,
+  // also copy the documentation from the cache to VariableDocumentation
+  // if it has documentation in the cache
+  FindState GetInitialState();
+  FindState InitialState = FindState::Undefined;
+
   // Add pieces of the search.
   void FillPackageRootPath();
   void FillCMakeVariablePath();
@@ -81,17 +92,16 @@
   void FillUserGuessPath();
 };
 
-class cmFindBaseDebugState
+class cmFindBaseDebugState : public cmFindCommonDebugState
 {
 public:
-  explicit cmFindBaseDebugState(std::string name, cmFindBase const* findBase);
-  ~cmFindBaseDebugState();
-
-  void FoundAt(std::string const& path, std::string regexName = std::string());
-  void FailedAt(std::string const& path,
-                std::string regexName = std::string());
+  explicit cmFindBaseDebugState(cmFindBase const* findBase);
+  ~cmFindBaseDebugState() override;
 
 private:
+  void FoundAtImpl(std::string const& path, std::string regexName) override;
+  void FailedAtImpl(std::string const& path, std::string regexName) override;
+
   struct DebugLibState
   {
     DebugLibState() = default;
@@ -104,8 +114,14 @@
     std::string path;
   };
 
-  cmFindBase const* FindCommand;
-  std::string CommandName;
+  void WriteDebug() const override;
+#ifndef CMAKE_BOOTSTRAP
+  void WriteEvent(cmConfigureLog& log, cmMakefile const& mf) const override;
+  std::vector<std::pair<VariableSource, std::string>> ExtraSearchVariables()
+    const override;
+#endif
+
+  cmFindBase const* const FindBaseCommand;
   std::vector<DebugLibState> FailedSearchLocations;
   DebugLibState FoundSearchLocation;
 };
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index b7783b6..fb7cc9f 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -18,6 +18,18 @@
 #include "cmValue.h"
 #include "cmake.h"
 
+#ifndef CMAKE_BOOTSTRAP
+#  include <deque>
+#  include <iterator>
+
+#  include <cm/optional>
+#  include <cm/string_view>
+#  include <cmext/string_view>
+
+#  include "cmConfigureLog.h"
+#  include "cmRange.h"
+#endif
+
 cmFindCommon::PathGroup cmFindCommon::PathGroup::All("ALL");
 cmFindCommon::PathLabel cmFindCommon::PathLabel::PackageRoot(
   "PackageName_ROOT");
@@ -35,6 +47,7 @@
   , Status(status)
 {
   this->FindRootPathMode = RootPathModeBoth;
+  this->FullDebugMode = false;
   this->NoDefaultPath = false;
   this->NoPackageRootPath = false;
   this->NoCMakePath = false;
@@ -59,8 +72,6 @@
 
   this->InitializeSearchPathGroups();
 
-  this->DebugMode = false;
-
   // Windows Registry views
   // When policy CMP0134 is not NEW, rely on previous behavior:
   if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0134) !=
@@ -73,11 +84,18 @@
   }
 }
 
+cmFindCommon::~cmFindCommon() = default;
+
 void cmFindCommon::SetError(std::string const& e)
 {
   this->Status.SetError(e);
 }
 
+bool cmFindCommon::DebugModeEnabled() const
+{
+  return this->FullDebugMode;
+}
+
 void cmFindCommon::DebugMessage(std::string const& msg) const
 {
   if (this->Makefile) {
@@ -98,6 +116,14 @@
     this->Makefile->GetCMakeInstance()->GetDebugFindOutput(var);
 }
 
+bool cmFindCommon::ComputeIfImplicitDebugModeSuppressed()
+{
+  // XXX(find-events): In the future, mirror the `ComputeIfDebugModeWanted`
+  // methods if more control is desired.
+  return this->Makefile->IsOn(
+    "CMAKE_FIND_DEBUG_MODE_NO_IMPLICIT_CONFIGURE_LOG");
+}
+
 void cmFindCommon::InitializeSearchPathGroups()
 {
   std::vector<PathLabel>* labels;
@@ -226,14 +252,14 @@
     return;
   }
 
-  if (this->DebugMode && debugBuffer) {
+  if (this->DebugModeEnabled() && debugBuffer) {
     *debugBuffer = cmStrCat(
       *debugBuffer, "Prepending the following roots to each prefix:\n");
   }
 
   auto debugRoot = [this, debugBuffer](std::string const& name,
                                        cmValue value) {
-    if (this->DebugMode && debugBuffer) {
+    if (this->DebugModeEnabled() && debugBuffer) {
       *debugBuffer = cmStrCat(*debugBuffer, name, '\n');
       cmList roots{ value };
       if (roots.empty()) {
@@ -457,3 +483,184 @@
                   }
                 });
 }
+
+cmFindCommonDebugState::cmFindCommonDebugState(std::string name,
+                                               cmFindCommon const* findCommand)
+  : FindCommand(findCommand)
+  , CommandName(std::move(name))
+  // Strip the `find_` prefix.
+  , Mode(this->CommandName.substr(5))
+{
+}
+
+void cmFindCommonDebugState::FoundAt(std::string const& path,
+                                     std::string regexName)
+{
+  this->IsFound = true;
+
+  if (!this->TrackSearchProgress()) {
+    return;
+  }
+
+  this->FoundAtImpl(path, regexName);
+}
+
+void cmFindCommonDebugState::FailedAt(std::string const& path,
+                                      std::string regexName)
+{
+  if (!this->TrackSearchProgress()) {
+    return;
+  }
+
+  this->FailedAtImpl(path, regexName);
+}
+
+bool cmFindCommonDebugState::ShouldImplicitlyLogEvents() const
+{
+  return true;
+}
+
+void cmFindCommonDebugState::Write()
+{
+  auto const* const fc = this->FindCommand;
+
+#ifndef CMAKE_BOOTSTRAP
+  // Write find event to the configure log if the log exists
+  if (cmConfigureLog* log =
+        fc->Makefile->GetCMakeInstance()->GetConfigureLog()) {
+    // Write event if any of:
+    //   - debug mode is enabled
+    //   - implicit logging should happen and:
+    //     - the variable was not defined (first run)
+    //     - the variable found state does not match the new found state (state
+    //       transition)
+    if (fc->DebugModeEnabled() ||
+        (this->ShouldImplicitlyLogEvents() &&
+         (!fc->IsDefined() || fc->IsFound() != this->IsFound))) {
+      this->WriteEvent(*log, *fc->Makefile);
+    }
+  }
+#endif
+
+  if (fc->DebugModeEnabled()) {
+    this->WriteDebug();
+  }
+}
+
+#ifndef CMAKE_BOOTSTRAP
+void cmFindCommonDebugState::WriteSearchVariables(cmConfigureLog& log,
+                                                  cmMakefile const& mf) const
+{
+  auto WriteString = [&log, &mf](std::string const& name) {
+    if (cmValue value = mf.GetDefinition(name)) {
+      log.WriteValue(name, *value);
+    }
+  };
+  auto WriteCMakeList = [&log, &mf](std::string const& name) {
+    if (cmValue value = mf.GetDefinition(name)) {
+      cmList values{ *value };
+      if (!values.empty()) {
+        log.WriteValue(name, values);
+      }
+    }
+  };
+  auto WriteEnvList = [&log](std::string const& name) {
+    if (auto value = cmSystemTools::GetEnvVar(name)) {
+      auto values = cmSystemTools::SplitEnvPath(*value);
+      if (!values.empty()) {
+        log.WriteValue(cmStrCat("ENV{", name, '}'), values);
+      }
+    }
+  };
+
+  auto const* fc = this->FindCommand;
+  log.BeginObject("search_context"_s);
+  auto const& packageRootStack = mf.FindPackageRootPathStack;
+  if (!packageRootStack.empty()) {
+    bool havePaths =
+      std::any_of(packageRootStack.begin(), packageRootStack.end(),
+                  [](std::vector<std::string> const& entry) -> bool {
+                    return !entry.empty();
+                  });
+    if (havePaths) {
+      log.BeginObject("package_stack");
+      log.BeginArray();
+      for (auto const& pkgPaths : cmReverseRange(packageRootStack)) {
+        if (!pkgPaths.empty()) {
+          log.NextArrayElement();
+          log.WriteValue("package_paths", pkgPaths);
+        }
+      }
+      log.EndArray();
+      log.EndObject();
+    }
+  }
+  auto cmakePathVar = cmStrCat("CMAKE_", fc->CMakePathName, "_PATH");
+  WriteCMakeList(cmakePathVar);
+  WriteCMakeList("CMAKE_PREFIX_PATH");
+  if (fc->CMakePathName == "PROGRAM"_s) {
+    WriteCMakeList("CMAKE_APPBUNDLE_PATH");
+  } else {
+    WriteCMakeList("CMAKE_FRAMEWORK_PATH");
+  }
+  // Same as above, but ask the environment instead.
+  WriteEnvList(cmakePathVar);
+  WriteEnvList("CMAKE_PREFIX_PATH");
+  if (fc->CMakePathName == "PROGRAM"_s) {
+    WriteEnvList("CMAKE_APPBUNDLE_PATH");
+  } else {
+    WriteEnvList("CMAKE_FRAMEWORK_PATH");
+  }
+  WriteEnvList("PATH");
+  WriteString("CMAKE_INSTALL_PREFIX");
+  WriteString("CMAKE_STAGING_PREFIX");
+  WriteCMakeList("CMAKE_SYSTEM_PREFIX_PATH");
+  auto systemPathVar = cmStrCat("CMAKE_SYSTEM_", fc->CMakePathName, "_PATH");
+  WriteCMakeList(systemPathVar);
+  // Sysroot paths.
+  WriteString("CMAKE_SYSROOT");
+  WriteString("CMAKE_SYSROOT_COMPILE");
+  WriteString("CMAKE_SYSROOT_LINK");
+  WriteString("CMAKE_FIND_ROOT_PATH");
+  // Write out paths which are ignored.
+  WriteCMakeList("CMAKE_IGNORE_PATH");
+  WriteCMakeList("CMAKE_IGNORE_PREFIX_PATH");
+  WriteCMakeList("CMAKE_SYSTEM_IGNORE_PATH");
+  WriteCMakeList("CMAKE_SYSTEM_IGNORE_PREFIX_PATH");
+  if (fc->CMakePathName == "PROGRAM"_s) {
+    WriteCMakeList("CMAKE_SYSTEM_APPBUNDLE_PATH");
+  } else {
+    WriteCMakeList("CMAKE_SYSTEM_FRAMEWORK_PATH");
+  }
+  for (auto const& extraVar : this->ExtraSearchVariables()) {
+    switch (extraVar.first) {
+      case VariableSource::String:
+        WriteString(extraVar.second);
+        break;
+      case VariableSource::PathList:
+        WriteCMakeList(extraVar.second);
+        break;
+      case VariableSource::EnvironmentList:
+        WriteEnvList(extraVar.second);
+        break;
+    }
+  }
+  log.EndObject();
+}
+
+std::vector<std::pair<cmFindCommonDebugState::VariableSource, std::string>>
+cmFindCommonDebugState::ExtraSearchVariables() const
+{
+  return {};
+}
+#endif
+
+bool cmFindCommonDebugState::TrackSearchProgress() const
+{
+  // Track search progress if debugging or logging the configure.
+  return this->FindCommand->DebugModeEnabled()
+#ifndef CMAKE_BOOTSTRAP
+    || this->FindCommand->Makefile->GetCMakeInstance()->GetConfigureLog()
+#endif
+    ;
+}
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index cf1a7aa..de0974b 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -5,14 +5,18 @@
 #include "cmConfigure.h" // IWYU pragma: keep
 
 #include <map>
+#include <memory>
 #include <set>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "cmPathLabel.h"
 #include "cmSearchPath.h"
 #include "cmWindowsRegistry.h"
 
+class cmConfigureLog;
+class cmFindCommonDebugState;
 class cmExecutionStatus;
 class cmMakefile;
 
@@ -27,14 +31,17 @@
 {
 public:
   cmFindCommon(cmExecutionStatus& status);
+  virtual ~cmFindCommon();
 
   void SetError(std::string const& e);
 
-  bool DebugModeEnabled() const { return this->DebugMode; }
+  bool DebugModeEnabled() const;
 
 protected:
   friend class cmSearchPath;
   friend class cmFindBaseDebugState;
+  friend class cmFindCommonDebugState;
+  friend class cmFindPackageDebugState;
 
   /** Used to define groups of path labels */
   class PathGroup : public cmPathLabel
@@ -77,6 +84,9 @@
     RootPathModeBoth
   };
 
+  virtual bool IsFound() const = 0;
+  virtual bool IsDefined() const = 0;
+
   /** Construct the various path groups and labels */
   void InitializeSearchPathGroups();
 
@@ -111,10 +121,15 @@
   void SelectDefaultSearchModes();
 
   /** The `InitialPass` functions of the child classes should set
-      this->DebugMode to the result of these.  */
+      this->FullDebugMode to the result of these.  */
   bool ComputeIfDebugModeWanted();
   bool ComputeIfDebugModeWanted(std::string const& var);
 
+  /** The `InitialPass` functions of the child classes should not initialize
+     `DebugState` if there is not a debug mode wanted and these return `true`.
+   */
+  bool ComputeIfImplicitDebugModeSuppressed();
+
   // Path arguments prior to path manipulation routines
   std::vector<std::string> UserHintsArgs;
   std::vector<std::string> UserGuessArgs;
@@ -126,7 +141,8 @@
   void AddPathSuffix(std::string const& arg);
 
   void DebugMessage(std::string const& msg) const;
-  bool DebugMode;
+  bool FullDebugMode;
+  std::unique_ptr<cmFindCommonDebugState> DebugState;
   bool NoDefaultPath;
   bool NoPackageRootPath;
   bool NoCMakePath;
@@ -157,3 +173,46 @@
   cmMakefile* Makefile;
   cmExecutionStatus& Status;
 };
+
+class cmFindCommonDebugState
+{
+public:
+  cmFindCommonDebugState(std::string name, cmFindCommon const* findCommand);
+  virtual ~cmFindCommonDebugState() = default;
+
+  void FoundAt(std::string const& path, std::string regexName = std::string());
+  void FailedAt(std::string const& path,
+                std::string regexName = std::string());
+
+  void Write();
+
+protected:
+  virtual void FoundAtImpl(std::string const& path, std::string regexName) = 0;
+  virtual void FailedAtImpl(std::string const& path,
+                            std::string regexName) = 0;
+  virtual bool ShouldImplicitlyLogEvents() const;
+
+  virtual void WriteDebug() const = 0;
+#ifndef CMAKE_BOOTSTRAP
+  virtual void WriteEvent(cmConfigureLog& log, cmMakefile const& mf) const = 0;
+  void WriteSearchVariables(cmConfigureLog& log, cmMakefile const& mf) const;
+  enum class VariableSource
+  {
+    String,
+    PathList,
+    EnvironmentList,
+  };
+  virtual std::vector<std::pair<VariableSource, std::string>>
+  ExtraSearchVariables() const;
+#endif
+
+  cmFindCommon const* const FindCommand;
+  std::string const CommandName;
+  std::string const Mode;
+  bool HasBeenFound() const { return this->IsFound; }
+
+private:
+  bool TrackSearchProgress() const;
+
+  bool IsFound{ false };
+};
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 83bc09f..f7da32e 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -9,10 +9,12 @@
 #include <set>
 #include <utility>
 
+#include <cm/memory>
 #include <cm/optional>
 
 #include "cmsys/RegularExpression.hxx"
 
+#include "cmFindCommon.h"
 #include "cmGlobalGenerator.h"
 #include "cmList.h"
 #include "cmMakefile.h"
@@ -42,9 +44,12 @@
     return false;
   }
 
-  this->DebugMode = this->ComputeIfDebugModeWanted(this->VariableName);
+  this->FullDebugMode = this->ComputeIfDebugModeWanted(this->VariableName);
+  if (this->FullDebugMode || !this->ComputeIfImplicitDebugModeSuppressed()) {
+    this->DebugState = cm::make_unique<cmFindBaseDebugState>(this);
+  }
 
-  if (this->AlreadyDefined) {
+  if (this->IsFound()) {
     this->NormalizeFindResult();
     return true;
   }
@@ -85,11 +90,11 @@
   original.swap(this->SearchPaths);
   for (std::string const& o : original) {
     this->AddArchitecturePath(o, 0, suffix);
-    if (this->DebugMode) {
+    if (this->DebugModeEnabled()) {
       std::string msg = cmStrCat(
         "find_library(", this->VariableName, ") removed original suffix ", o,
         " from PATH_SUFFIXES while adding architecture paths for suffix '",
-        suffix, "'");
+        suffix, '\'');
       this->DebugMessage(msg);
     }
   }
@@ -153,10 +158,10 @@
 
     if (use_dirX) {
       dirX += "/";
-      if (this->DebugMode) {
+      if (this->DebugModeEnabled()) {
         std::string msg = cmStrCat(
           "find_library(", this->VariableName, ") added replacement path ",
-          dirX, " to PATH_SUFFIXES for architecture suffix '", suffix, "'");
+          dirX, " to PATH_SUFFIXES for architecture suffix '", suffix, '\'');
         this->DebugMessage(msg);
       }
       this->SearchPaths.push_back(std::move(dirX));
@@ -164,10 +169,10 @@
 
     if (use_dir) {
       this->SearchPaths.push_back(dir);
-      if (this->DebugMode) {
+      if (this->DebugModeEnabled()) {
         std::string msg = cmStrCat(
           "find_library(", this->VariableName, ") added replacement path ",
-          dir, " to PATH_SUFFIXES for architecture suffix '", suffix, "'");
+          dir, " to PATH_SUFFIXES for architecture suffix '", suffix, '\'');
         this->DebugMessage(msg);
       }
     }
@@ -191,8 +196,8 @@
 
 struct cmFindLibraryHelper
 {
-  cmFindLibraryHelper(std::string debugName, cmMakefile* mf,
-                      cmFindBase const* findBase);
+  cmFindLibraryHelper(cmMakefile* mf, cmFindBase const* findBase,
+                      cmFindCommonDebugState* debugState);
 
   // Context information.
   cmMakefile* Makefile;
@@ -214,8 +219,6 @@
   // Support for OpenBSD shared library naming: lib<name>.so.<major>.<minor>
   bool IsOpenBSD;
 
-  bool DebugMode;
-
   // Current names under consideration.
   struct Name
   {
@@ -251,11 +254,11 @@
     return this->FindBase->Validate(path);
   }
 
-  cmFindBaseDebugState DebugSearches;
+  cmFindCommonDebugState* DebugState;
 
   void DebugLibraryFailed(std::string const& name, std::string const& path)
   {
-    if (this->DebugMode) {
+    if (this->DebugState) {
       // To improve readability of the debug output, if there is only one
       // prefix/suffix, use the plain prefix/suffix instead of the regex.
       auto const& prefix = (this->Prefixes.size() == 1) ? this->Prefixes[0]
@@ -264,16 +267,16 @@
                                                         : this->SuffixRegexStr;
 
       auto regexName = cmStrCat(prefix, name, suffix);
-      this->DebugSearches.FailedAt(path, regexName);
+      this->DebugState->FailedAt(path, regexName);
     }
   }
 
   void DebugLibraryFound(std::string const& name, std::string const& path)
   {
-    if (this->DebugMode) {
+    if (this->DebugState) {
       auto regexName =
         cmStrCat(this->PrefixRegexStr, name, this->SuffixRegexStr);
-      this->DebugSearches.FoundAt(path, regexName);
+      this->DebugState->FoundAt(path, regexName);
     }
   }
 };
@@ -306,12 +309,12 @@
   return (suffixProp) ? *suffixProp : defaultSuffix;
 }
 }
-cmFindLibraryHelper::cmFindLibraryHelper(std::string debugName, cmMakefile* mf,
-                                         cmFindBase const* base)
+cmFindLibraryHelper::cmFindLibraryHelper(cmMakefile* mf,
+                                         cmFindBase const* base,
+                                         cmFindCommonDebugState* debugState)
   : Makefile(mf)
   , FindBase(base)
-  , DebugMode(base->DebugModeEnabled())
-  , DebugSearches(std::move(debugName), base)
+  , DebugState(debugState)
 {
   this->GG = this->Makefile->GetGlobalGenerator();
 
@@ -540,7 +543,7 @@
 std::string cmFindLibraryCommand::FindNormalLibraryNamesPerDir()
 {
   // Search for all names in each directory.
-  cmFindLibraryHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindLibraryHelper helper(this->Makefile, this, this->DebugState.get());
   for (std::string const& n : this->Names) {
     helper.AddName(n);
   }
@@ -557,7 +560,7 @@
 std::string cmFindLibraryCommand::FindNormalLibraryDirsPerName()
 {
   // Search the entire path for each name.
-  cmFindLibraryHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindLibraryHelper helper(this->Makefile, this, this->DebugState.get());
   for (std::string const& n : this->Names) {
     // Switch to searching for this name.
     helper.SetName(n);
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 0081c6c..23083b0 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -9,8 +9,10 @@
 #include <functional>
 #include <iterator>
 #include <sstream>
+#include <unordered_set>
 #include <utility>
 
+#include <cm/memory>
 #include <cm/optional>
 #include <cmext/algorithm>
 #include <cmext/string_view>
@@ -22,6 +24,7 @@
 #include "cmsys/String.h"
 
 #include "cmAlgorithms.h"
+#include "cmConfigureLog.h"
 #include "cmDependencyProvider.h"
 #include "cmExecutionStatus.h"
 #include "cmExperimental.h"
@@ -29,10 +32,12 @@
 #include "cmListFileCache.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmPackageState.h"
 #include "cmPolicies.h"
 #include "cmRange.h"
 #include "cmSearchPath.h"
 #include "cmState.h"
+#include "cmStateSnapshot.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
@@ -530,17 +535,25 @@
   , VersionRangeMax(VERSION_ENDPOINT_INCLUDED)
 {
   this->CMakePathName = "PACKAGE";
-  this->DebugMode = false;
   this->AppendSearchPathGroups();
 
   this->DeprecatedFindModules["Boost"] = cmPolicies::CMP0167;
+  this->DeprecatedFindModules["CABLE"] = cmPolicies::CMP0191;
   this->DeprecatedFindModules["CUDA"] = cmPolicies::CMP0146;
   this->DeprecatedFindModules["Dart"] = cmPolicies::CMP0145;
+  this->DeprecatedFindModules["GCCXML"] = cmPolicies::CMP0188;
   this->DeprecatedFindModules["PythonInterp"] = cmPolicies::CMP0148;
   this->DeprecatedFindModules["PythonLibs"] = cmPolicies::CMP0148;
   this->DeprecatedFindModules["Qt"] = cmPolicies::CMP0084;
 }
 
+cmFindPackageCommand::~cmFindPackageCommand()
+{
+  if (this->DebugState) {
+    this->DebugState->Write();
+  }
+}
+
 void cmFindPackageCommand::AppendSearchPathGroups()
 {
   // Update the All group with new paths. Note that package redirection must
@@ -599,6 +612,17 @@
   this->Quiet = other->Quiet;
 }
 
+bool cmFindPackageCommand::IsFound() const
+{
+  return this->InitialState == FindState::Found;
+}
+
+bool cmFindPackageCommand::IsDefined() const
+{
+  return this->InitialState == FindState::Found ||
+    this->InitialState == FindState::NotFound;
+}
+
 bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
 {
   if (args.empty()) {
@@ -681,7 +705,7 @@
   }
   if (cmValue const sd =
         this->Makefile->GetDefinition("CMAKE_FIND_PACKAGE_SORT_DIRECTION")) {
-    this->SortDirection = (*sd == "ASC") ? Asc : Dec;
+    this->SortDirection = (*sd == "DEC") ? Dec : Asc;
   }
 
   // Find what search path locations have been enabled/disable.
@@ -696,14 +720,16 @@
   // Record options.
   this->Name = args[0];
   cm::string_view componentsSep = ""_s;
-  bool bypassProvider = false;
 
   // Always search directly in a generated path.
   this->SearchPathSuffixes.emplace_back();
 
   // Process debug mode
   cmMakefile::DebugFindPkgRAII debugFindPkgRAII(this->Makefile, this->Name);
-  this->DebugMode = this->ComputeIfDebugModeWanted();
+  this->FullDebugMode = this->ComputeIfDebugModeWanted();
+  if (this->FullDebugMode || !this->ComputeIfImplicitDebugModeSuppressed()) {
+    this->DebugState = cm::make_unique<cmFindPackageDebugState>(this);
+  }
 
   // Parse the arguments.
   enum Doing
@@ -728,7 +754,7 @@
       this->Quiet = true;
       doing = DoingNone;
     } else if (args[i] == "BYPASS_PROVIDER") {
-      bypassProvider = true;
+      this->BypassProvider = true;
       doing = DoingNone;
     } else if (args[i] == "EXACT") {
       this->VersionExact = true;
@@ -750,7 +776,18 @@
       configArgs.push_back(i);
       doing = DoingNone;
     } else if (args[i] == "REQUIRED") {
-      this->Required = true;
+      if (this->Required == RequiredStatus::OptionalExplicit) {
+        this->SetError("cannot be both REQUIRED and OPTIONAL");
+        return false;
+      }
+      this->Required = RequiredStatus::RequiredExplicit;
+      doing = DoingComponents;
+    } else if (args[i] == "OPTIONAL") {
+      if (this->Required == RequiredStatus::RequiredExplicit) {
+        this->SetError("cannot be both REQUIRED and OPTIONAL");
+        return false;
+      }
+      this->Required = RequiredStatus::OptionalExplicit;
       doing = DoingComponents;
     } else if (args[i] == "COMPONENTS") {
       doing = DoingComponents;
@@ -842,11 +879,16 @@
       this->VersionComplete = args[i];
     } else {
       this->SetError(
-        cmStrCat("called with invalid argument \"", args[i], "\""));
+        cmStrCat("called with invalid argument \"", args[i], '"'));
       return false;
     }
   }
 
+  if (this->Required == RequiredStatus::Optional &&
+      this->Makefile->IsOn("CMAKE_FIND_REQUIRED")) {
+    this->Required = RequiredStatus::RequiredFromFindVar;
+  }
+
   if (!this->GlobalScope) {
     cmValue value(
       this->Makefile->GetDefinition("CMAKE_FIND_PACKAGE_TARGETS_GLOBAL"));
@@ -891,6 +933,41 @@
     return false;
   }
 
+  bool canBeIrrelevant = true;
+  if (this->UseConfigFiles || this->UseCpsFiles) {
+    canBeIrrelevant = false;
+    if (cmValue v = this->Makefile->GetState()->GetCacheEntryValue(
+          cmStrCat(this->Name, "_DIR"))) {
+      if (!v.IsNOTFOUND()) {
+        this->InitialState = FindState::Found;
+      } else {
+        this->InitialState = FindState::NotFound;
+      }
+    }
+  }
+
+  if (this->UseFindModules &&
+      (this->InitialState == FindState::Undefined ||
+       this->InitialState == FindState::NotFound)) {
+    // There are no definitive cache variables to know if a given `Find` module
+    // has been searched for or not. However, if we have a `_FOUND` variable,
+    // use that as an indication of a previous search.
+    if (cmValue v =
+          this->Makefile->GetDefinition(cmStrCat(this->Name, "_FOUND"))) {
+      if (v.IsOn()) {
+        this->InitialState = FindState::Found;
+      } else {
+        this->InitialState = FindState::NotFound;
+      }
+    }
+  }
+
+  // If there is no signaling variable and there's no reason to expect a cache
+  // variable, mark the initial state as "irrelevant".
+  if (this->InitialState == FindState::Undefined && canBeIrrelevant) {
+    this->InitialState = FindState::Irrelevant;
+  }
+
   // Ignore EXACT with no version.
   if (this->VersionComplete.empty() && this->VersionExact) {
     this->VersionExact = false;
@@ -976,7 +1053,8 @@
       this->VersionMaxPatch, this->VersionMaxTweak);
   }
 
-  return this->FindPackage(bypassProvider ? std::vector<std::string>{} : args);
+  return this->FindPackage(this->BypassProvider ? std::vector<std::string>{}
+                                                : args);
 }
 
 bool cmFindPackageCommand::FindPackage(
@@ -987,21 +1065,21 @@
   bool const makePackageRequiredSet =
     this->Makefile->IsOn(makePackageRequiredVar);
   if (makePackageRequiredSet) {
-    if (this->Required) {
+    if (this->IsRequired()) {
       this->Makefile->IssueMessage(
         MessageType::WARNING,
         cmStrCat("for module ", this->Name,
                  " already called with REQUIRED, thus ",
                  makePackageRequiredVar, " has no effect."));
     } else {
-      this->Required = true;
+      this->Required = RequiredStatus::RequiredFromPackageVar;
     }
   }
 
   std::string const disableFindPackageVar =
     cmStrCat("CMAKE_DISABLE_FIND_PACKAGE_", this->Name);
   if (this->Makefile->IsOn(disableFindPackageVar)) {
-    if (this->Required) {
+    if (this->IsRequired()) {
       this->SetError(
         cmStrCat("for module ", this->Name,
                  (makePackageRequiredSet
@@ -1056,12 +1134,12 @@
   cmState::Command const providerCommand = state->GetDependencyProviderCommand(
     cmDependencyProvider::Method::FindPackage);
   if (argsForProvider.empty()) {
-    if (this->DebugMode && providerCommand) {
+    if (this->DebugModeEnabled() && providerCommand) {
       this->DebugMessage(
         "BYPASS_PROVIDER given, skipping dependency provider");
     }
   } else if (providerCommand) {
-    if (this->DebugMode) {
+    if (this->DebugModeEnabled()) {
       this->DebugMessage(cmStrCat("Trying dependency provider command: ",
                                   state->GetDependencyProvider()->GetCommand(),
                                   "()"));
@@ -1077,13 +1155,27 @@
     if (!providerCommand(listFileArgs, this->Status)) {
       return false;
     }
+    std::string providerName;
+    if (auto depProvider = state->GetDependencyProvider()) {
+      providerName = depProvider->GetCommand();
+    } else {
+      providerName = "<no provider?>";
+    }
+    auto searchPath = cmStrCat("dependency_provider::", providerName);
     if (this->Makefile->IsOn(cmStrCat(this->Name, "_FOUND"))) {
-      if (this->DebugMode) {
+      if (this->DebugModeEnabled()) {
         this->DebugMessage("Package was found by the dependency provider");
       }
+      if (this->DebugState) {
+        this->DebugState->FoundAt(searchPath);
+      }
+      this->FileFound = searchPath;
+      this->FileFoundMode = FoundPackageMode::Provider;
       this->AppendSuccessInformation();
       return true;
     }
+    this->ConsideredPaths.emplace_back(searchPath, FoundPackageMode::Provider,
+                                       SearchResult::NotFound);
   }
 
   // Limit package nesting depth well below the recursion depth limit because
@@ -1319,6 +1411,9 @@
 {
   this->AddFindDefinition("CMAKE_FIND_PACKAGE_NAME", this->Name);
 
+  // Nested find calls are not automatically required.
+  this->AddFindDefinition("CMAKE_FIND_REQUIRED", ""_s);
+
   // Store the list of components and associated variable definitions.
   std::string components_var = this->Name + "_FIND_COMPONENTS";
   this->AddFindDefinition(components_var, this->Components);
@@ -1338,7 +1433,7 @@
     this->AddFindDefinition(quietly, "1"_s);
   }
 
-  if (this->Required) {
+  if (this->IsRequired()) {
     // Tell the module that is about to be read that it should report
     // a fatal error if the package is not found.
     std::string req = cmStrCat(this->Name, "_FIND_REQUIRED");
@@ -1427,8 +1522,8 @@
   std::string debugBuffer = cmStrCat(
     "find_package considered the following paths for ", moduleFileName, ":\n");
   std::string mfile = this->Makefile->GetModulesFile(
-    moduleFileName, system, this->DebugMode, debugBuffer);
-  if (this->DebugMode) {
+    moduleFileName, system, this->DebugModeEnabled(), debugBuffer);
+  if (this->DebugModeEnabled()) {
     if (mfile.empty()) {
       debugBuffer = cmStrCat(debugBuffer, "The file was not found.\n");
     } else {
@@ -1467,15 +1562,35 @@
     bool result = this->ReadListFile(mfile, DoPolicyScope);
     this->Makefile->RemoveDefinition(var);
 
-    if (this->DebugMode) {
-      std::string const foundVar = cmStrCat(this->Name, "_FOUND");
-      if (this->Makefile->IsDefinitionSet(foundVar) &&
-          !this->Makefile->IsOn(foundVar)) {
+    std::string const foundVar = cmStrCat(this->Name, "_FOUND");
+    if (this->Makefile->IsDefinitionSet(foundVar) &&
+        !this->Makefile->IsOn(foundVar)) {
 
+      if (this->DebugModeEnabled()) {
         this->DebugBuffer = cmStrCat(
           this->DebugBuffer, "The module is considered not found due to ",
           foundVar, " being FALSE.");
       }
+
+      this->ConsideredPaths.emplace_back(mfile, FoundPackageMode::Module,
+                                         SearchResult::NotFound);
+      std::string const notFoundMessageVar =
+        cmStrCat(this->Name, "_NOT_FOUND_MESSAGE");
+      if (cmValue notFoundMessage =
+            this->Makefile->GetDefinition(notFoundMessageVar)) {
+
+        this->ConsideredPaths.back().Message = *notFoundMessage;
+      }
+    } else {
+      if (this->DebugState) {
+        this->DebugState->FoundAt(mfile);
+      }
+      this->FileFound = mfile;
+      this->FileFoundMode = FoundPackageMode::Module;
+      std::string const versionVar = cmStrCat(this->Name, "_VERSION");
+      if (cmValue version = this->Makefile->GetDefinition(versionVar)) {
+        this->VersionFound = *version;
+      }
     }
     return result;
   }
@@ -1505,8 +1620,13 @@
       }
       // The file location was cached.  Look for the correct file.
       std::string file;
-      if (this->FindConfigFile(dir, pdt::Any, file)) {
+      FoundPackageMode foundMode = FoundPackageMode::None;
+      if (this->FindConfigFile(dir, pdt::Any, file, foundMode)) {
+        if (this->DebugState) {
+          this->DebugState->FoundAt(file);
+        }
         this->FileFound = std::move(file);
+        this->FileFoundMode = foundMode;
         fileFound = true;
       }
       def = this->Makefile->GetDefinition(this->Variable);
@@ -1526,7 +1646,6 @@
     }
   }
 
-  std::string const fileVar = cmStrCat(this->Name, "_CONFIG");
   std::string const foundVar = cmStrCat(this->Name, "_FOUND");
   std::string const notFoundMessageVar =
     cmStrCat(this->Name, "_NOT_FOUND_MESSAGE");
@@ -1557,15 +1676,7 @@
     if (this->CpsReader) {
       // The package has been found.
       found = true;
-
-      // Don't read a CPS file if we've already read it.
-      cmValue const& previousFileFound =
-        this->Makefile->GetDefinition(fileVar);
-      if (previousFileFound.Compare(this->FileFound) == 0) {
-        result = true;
-      } else {
-        result = this->ReadPackage();
-      }
+      result = this->ReadPackage();
     } else if (this->ReadListFile(this->FileFound, DoPolicyScope)) {
       // The package has been found.
       found = true;
@@ -1605,11 +1716,13 @@
 
   // package not found
   if (result && !found) {
-    // warn if package required or neither quiet nor in config mode
-    if (this->Required ||
-        !(this->Quiet ||
-          (this->UseConfigFiles && !this->UseFindModules &&
-           this->ConsideredConfigs.empty()))) {
+    // warn if package required or
+    // (neither quiet nor in config mode and not explicitly optional)
+    if (this->IsRequired() ||
+        (!(this->Quiet ||
+           (this->UseConfigFiles && !this->UseFindModules &&
+            this->ConsideredConfigs.empty())) &&
+         this->Required != RequiredStatus::OptionalExplicit)) {
       // The variable is not set.
       std::ostringstream e;
       std::ostringstream aw;
@@ -1713,11 +1826,19 @@
                "without ensuring that it is actually available.\n";
         }
       }
+      if (this->Required == RequiredStatus::RequiredFromFindVar) {
+        e << "\nThis package is considered required because the "
+             "CMAKE_FIND_REQUIRED variable has been enabled.\n";
+      } else if (this->Required == RequiredStatus::RequiredFromPackageVar) {
+        e << "\nThis package is considered required because the "
+          << cmStrCat("CMAKE_REQUIRE_FIND_PACKAGE_", this->Name)
+          << " variable has been enabled.\n";
+      }
 
-      this->Makefile->IssueMessage(this->Required ? MessageType::FATAL_ERROR
-                                                  : MessageType::WARNING,
-                                   e.str());
-      if (this->Required) {
+      this->Makefile->IssueMessage(
+        this->IsRequired() ? MessageType::FATAL_ERROR : MessageType::WARNING,
+        e.str());
+      if (this->IsRequired()) {
         cmSystemTools::SetFatalErrorOccurred();
       }
 
@@ -1738,6 +1859,7 @@
   this->Makefile->AddDefinition(foundVar, found ? "1" : "0");
 
   // Set a variable naming the configuration file that was found.
+  std::string const fileVar = cmStrCat(this->Name, "_CONFIG");
   if (found) {
     this->Makefile->AddDefinition(fileVar, this->FileFound);
   } else {
@@ -1775,7 +1897,7 @@
 
   // Look for the project's configuration file.
   bool found = false;
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     this->DebugBuffer = cmStrCat(this->DebugBuffer,
                                  "find_package considered the following "
                                  "locations for ",
@@ -1811,7 +1933,7 @@
     found = this->FindAppBundleConfig();
   }
 
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     if (found) {
       this->DebugBuffer = cmStrCat(
         this->DebugBuffer, "The file was found at\n  ", this->FileFound, '\n');
@@ -1949,7 +2071,7 @@
   // Loop over appendices.
   auto iter = this->CpsAppendices.begin();
   while (iter != this->CpsAppendices.end()) {
-    bool required = false;
+    RequiredStatus required = RequiredStatus::Optional;
     bool important = false;
 
     // Check if this appendix provides any requested components.
@@ -1989,8 +2111,15 @@
     }
   }
 
+  // If we made it here, we want to actually import something, but we also
+  // need to ensure we don't try to import the same file more than once (which
+  // will fail due to the targets already existing). Retrieve the package state
+  // so we can record what we're doing.
+  cmPackageState& state =
+    this->Makefile->GetStateSnapshot().GetPackageState(this->FileFound);
+
   // Import targets from root file.
-  if (!this->ImportPackageTargets(this->FileFound, *this->CpsReader)) {
+  if (!this->ImportPackageTargets(state, this->FileFound, *this->CpsReader)) {
     return false;
   }
 
@@ -1999,7 +2128,7 @@
   for (auto const& appendix : this->CpsAppendices) {
     cmMakefile::CallRAII appendixScope{ this->Makefile, appendix.first,
                                         this->Status };
-    if (!this->ImportPackageTargets(appendix.first, appendix.second)) {
+    if (!this->ImportPackageTargets(state, appendix.first, appendix.second)) {
       return false;
     }
   }
@@ -2008,13 +2137,13 @@
 }
 
 bool cmFindPackageCommand::FindPackageDependencies(
-  std::string const& fileName, cmPackageInfoReader const& reader,
-  bool required)
+  std::string const& filePath, cmPackageInfoReader const& reader,
+  RequiredStatus required)
 {
   // Get package requirements.
   for (cmPackageRequirement const& dep : reader.GetRequirements()) {
     cmExecutionStatus status{ *this->Makefile };
-    cmMakefile::CallRAII scope{ this->Makefile, fileName, status };
+    cmMakefile::CallRAII scope{ this->Makefile, filePath, status };
 
     // For each requirement, set up a nested instance to find it.
     cmFindPackageCommand fp{ status };
@@ -2050,9 +2179,16 @@
   return true;
 }
 
-bool cmFindPackageCommand::ImportPackageTargets(std::string const& fileName,
+bool cmFindPackageCommand::ImportPackageTargets(cmPackageState& packageState,
+                                                std::string const& filePath,
                                                 cmPackageInfoReader& reader)
 {
+  // Check if we've already imported this file.
+  std::string fileName = cmSystemTools::GetFilenameName(filePath);
+  if (cm::contains(packageState.ImportedFiles, fileName)) {
+    return true;
+  }
+
   // Import base file.
   if (!reader.ImportTargets(this->Makefile, this->Status)) {
     return false;
@@ -2062,8 +2198,8 @@
   cmsys::Glob glob;
   glob.RecurseOff();
   if (glob.FindFiles(
-        cmStrCat(cmSystemTools::GetFilenamePath(fileName), '/',
-                 cmSystemTools::GetFilenameWithoutExtension(fileName),
+        cmStrCat(cmSystemTools::GetFilenamePath(filePath), '/',
+                 cmSystemTools::GetFilenameWithoutExtension(filePath),
                  "@*.[Cc][Pp][Ss]"_s))) {
 
     // Try to read supplemental data from each file found.
@@ -2079,6 +2215,7 @@
     }
   }
 
+  packageState.ImportedFiles.emplace(std::move(fileName));
   return true;
 }
 
@@ -2148,7 +2285,7 @@
   }
   this->Makefile->GetState()->SetGlobalProperty(versionInfoPropName,
                                                 versionInfo);
-  if (this->Required) {
+  if (this->IsRequired()) {
     std::string const requiredInfoPropName =
       cmStrCat("_CMAKE_", this->Name, "_TYPE");
     this->Makefile->GetState()->SetGlobalProperty(requiredInfoPropName,
@@ -2285,7 +2422,7 @@
   if (redirectDir && !redirectDir->empty()) {
     paths.AddPath(*redirectDir);
   }
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer =
       "The internally managed CMAKE_FIND_PACKAGE_REDIRECTS_DIR.\n";
     collectPathsForDebug(debugBuffer, paths);
@@ -2305,7 +2442,7 @@
       paths.AddPath(path);
     }
   }
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer = "<PackageName>_ROOT CMake variable "
                               "[CMAKE_FIND_USE_PACKAGE_ROOT_PATH].\n";
     collectPathsForDebug(debugBuffer, paths);
@@ -2322,7 +2459,7 @@
   // Check the environment variable with the same name as the cache
   // entry.
   paths.AddEnvPath(this->Variable);
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     debugBuffer = cmStrCat("Env variable ", this->Variable,
                            " [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].\n");
     debugOffset = collectPathsForDebug(debugBuffer, paths);
@@ -2330,7 +2467,7 @@
 
   // And now the general CMake environment variables
   paths.AddEnvPath("CMAKE_PREFIX_PATH");
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     debugBuffer = cmStrCat(debugBuffer,
                            "CMAKE_PREFIX_PATH env variable "
                            "[CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH].\n");
@@ -2339,7 +2476,7 @@
 
   paths.AddEnvPath("CMAKE_FRAMEWORK_PATH");
   paths.AddEnvPath("CMAKE_APPBUNDLE_PATH");
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     debugBuffer =
       cmStrCat(debugBuffer,
                "CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env "
@@ -2356,14 +2493,14 @@
   std::size_t debugOffset = 0;
 
   paths.AddCMakePath("CMAKE_PREFIX_PATH");
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     debugBuffer = "CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH].\n";
     debugOffset = collectPathsForDebug(debugBuffer, paths);
   }
 
   paths.AddCMakePath("CMAKE_FRAMEWORK_PATH");
   paths.AddCMakePath("CMAKE_APPBUNDLE_PATH");
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     debugBuffer =
       cmStrCat(debugBuffer,
                "CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables "
@@ -2390,7 +2527,7 @@
       paths.AddPath(i);
     }
   }
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer = "Standard system environment variables "
                               "[CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH].\n";
     collectPathsForDebug(debugBuffer, paths);
@@ -2419,7 +2556,7 @@
                                  this->LabeledPaths[PathLabel::UserRegistry]);
   }
 #endif
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer =
       "CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY].\n";
     collectPathsForDebug(debugBuffer,
@@ -2438,7 +2575,7 @@
   this->LoadPackageRegistryWinSystem();
 #endif
 
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer =
       "CMake System Package Registry "
       "[CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY].\n";
@@ -2642,7 +2779,7 @@
   paths.AddCMakePath("CMAKE_SYSTEM_FRAMEWORK_PATH");
   paths.AddCMakePath("CMAKE_SYSTEM_APPBUNDLE_PATH");
 
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer = "CMake variables defined in the Platform file "
                               "[CMAKE_FIND_USE_CMAKE_SYSTEM_PATH].\n";
     collectPathsForDebug(debugBuffer, paths);
@@ -2657,7 +2794,7 @@
   for (std::string const& p : this->UserGuessArgs) {
     paths.AddUserPath(p);
   }
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer =
       "Paths specified by the find_package PATHS option.\n";
     collectPathsForDebug(debugBuffer, paths);
@@ -2672,7 +2809,7 @@
   for (std::string const& p : this->UserHintsArgs) {
     paths.AddUserPath(p);
   }
-  if (this->DebugMode) {
+  if (this->DebugModeEnabled()) {
     std::string debugBuffer =
       "Paths specified by the find_package HINTS option.\n";
     collectPathsForDebug(debugBuffer, paths);
@@ -2706,13 +2843,17 @@
 
   std::string const d = dir.substr(0, dir.size() - 1);
   if (cm::contains(this->IgnoredPaths, d)) {
+    this->ConsideredPaths.emplace_back(
+      dir, cmFindPackageCommand::FoundMode(type), SearchResult::Ignored);
     return false;
   }
 
   // Look for the file in this directory.
   std::string file;
-  if (this->FindConfigFile(d, type, file)) {
+  FoundPackageMode foundMode = FoundPackageMode::None;
+  if (this->FindConfigFile(d, type, file, foundMode)) {
     this->FileFound = std::move(file);
+    this->FileFoundMode = foundMode;
     return true;
   }
   return false;
@@ -2720,14 +2861,15 @@
 
 bool cmFindPackageCommand::FindConfigFile(std::string const& dir,
                                           PackageDescriptionType type,
-                                          std::string& file)
+                                          std::string& file,
+                                          FoundPackageMode& foundMode)
 {
   for (auto const& config : this->Configs) {
     if (type != pdt::Any && config.Type != type) {
       continue;
     }
     file = cmStrCat(dir, '/', config.Name);
-    if (this->DebugMode) {
+    if (this->DebugModeEnabled()) {
       this->DebugBuffer = cmStrCat(this->DebugBuffer, "  ", file, '\n');
     }
     if (cmSystemTools::FileExists(file, true)) {
@@ -2737,7 +2879,16 @@
       } else {
         file = cmSystemTools::ToNormalizedPathOnDisk(file);
       }
-      return this->CheckVersion(file);
+      if (this->CheckVersion(file)) {
+        foundMode = cmFindPackageCommand::FoundMode(config.Type);
+        return true;
+      }
+      this->ConsideredPaths.emplace_back(file,
+                                         cmFindPackageCommand::FoundMode(type),
+                                         SearchResult::InsufficientVersion);
+    } else {
+      this->ConsideredPaths.emplace_back(
+        file, cmFindPackageCommand::FoundMode(type), SearchResult::NoExist);
     }
   }
   return false;
@@ -3308,6 +3459,27 @@
   return TryGeneratedPaths(searchFn, pdt::Cps, prefix, pkgDirGen);
 }
 
+bool cmFindPackageCommand::IsRequired() const
+{
+  return this->Required == RequiredStatus::RequiredExplicit ||
+    this->Required == RequiredStatus::RequiredFromPackageVar ||
+    this->Required == RequiredStatus::RequiredFromFindVar;
+}
+
+cmFindPackageCommand::FoundPackageMode cmFindPackageCommand::FoundMode(
+  PackageDescriptionType type)
+{
+  switch (type) {
+    case PackageDescriptionType::Any:
+      return FoundPackageMode::None;
+    case PackageDescriptionType::CMake:
+      return FoundPackageMode::Config;
+    case PackageDescriptionType::Cps:
+      return FoundPackageMode::Cps;
+  }
+  return FoundPackageMode::None;
+}
+
 // TODO: Debug cmsys::Glob double slash problem.
 
 bool cmFindPackage(std::vector<std::string> const& args,
@@ -3315,3 +3487,266 @@
 {
   return cmFindPackageCommand(status).InitialPass(args);
 }
+
+cmFindPackageDebugState::cmFindPackageDebugState(
+  cmFindPackageCommand const* findPackage)
+  : cmFindCommonDebugState("find_package", findPackage)
+  , FindPackageCommand(findPackage)
+{
+}
+
+cmFindPackageDebugState::~cmFindPackageDebugState() = default;
+
+void cmFindPackageDebugState::FoundAtImpl(std::string const& path,
+                                          std::string regexName)
+{
+  (void)path;
+  (void)regexName;
+}
+
+void cmFindPackageDebugState::FailedAtImpl(std::string const& path,
+                                           std::string regexName)
+{
+  (void)path;
+  (void)regexName;
+}
+
+bool cmFindPackageDebugState::ShouldImplicitlyLogEvents() const
+{
+  auto const* fpc = this->FindPackageCommand;
+  bool const canUsePackage = fpc->UseConfigFiles || fpc->UseCpsFiles;
+  return canUsePackage &&
+    fpc->FileFoundMode != cmFindPackageCommand::FoundPackageMode::Module &&
+    std::any_of(fpc->ConsideredPaths.begin(), fpc->ConsideredPaths.end(),
+                [](cmFindPackageCommand::ConsideredPath const& cp) {
+                  return cp.Mode >
+                    cmFindPackageCommand::FoundPackageMode::Module;
+                });
+}
+
+void cmFindPackageDebugState::WriteDebug() const
+{
+}
+
+#ifndef CMAKE_BOOTSTRAP
+void cmFindPackageDebugState::WriteEvent(cmConfigureLog& log,
+                                         cmMakefile const& mf) const
+{
+  (void)log;
+  (void)mf;
+
+  log.BeginEvent("find_package-v1", mf);
+
+  auto const* fpc = this->FindPackageCommand;
+
+  log.WriteValue("name"_s, fpc->Name);
+  if (!fpc->Components.empty()) {
+    log.BeginObject("components"_s);
+    log.BeginArray();
+    for (auto const& component : cmList{ fpc->Components }) {
+      log.NextArrayElement();
+      log.WriteValue("name"_s, component);
+      log.WriteValue("required"_s,
+                     fpc->RequiredComponents.find(component) !=
+                       fpc->RequiredComponents.end());
+      log.WriteValue("found"_s,
+                     mf.IsOn(cmStrCat(fpc->Name, '_', component, "_FOUND")));
+    }
+    log.EndArray();
+    log.EndObject();
+  }
+  if (!fpc->Configs.empty()) {
+    auto pdt_name =
+      [](cmFindPackageCommand::PackageDescriptionType type) -> std::string {
+      switch (type) {
+        case pdt::Any:
+          return "any";
+        case pdt::CMake:
+          return "cmake";
+        case pdt::Cps:
+          return "cps";
+      }
+      assert(false);
+      return "<UNKNOWN>";
+    };
+
+    log.BeginObject("configs"_s);
+    log.BeginArray();
+    for (auto const& config : fpc->Configs) {
+      log.NextArrayElement();
+      log.WriteValue("filename"_s, config.Name);
+      log.WriteValue("kind"_s, pdt_name(config.Type));
+    }
+    log.EndArray();
+    log.EndObject();
+  }
+  {
+    log.BeginObject("version_request"_s);
+    if (!fpc->Version.empty()) {
+      log.WriteValue("version"_s, fpc->Version);
+    }
+    if (!fpc->VersionComplete.empty()) {
+      log.WriteValue("version_complete"_s, fpc->VersionComplete);
+    }
+    if (!fpc->VersionRange.empty()) {
+      log.WriteValue("min"_s, std::string(fpc->VersionRangeMin));
+      log.WriteValue("max"_s, std::string(fpc->VersionRangeMax));
+    }
+    log.WriteValue("exact"_s, fpc->VersionExact);
+    log.EndObject();
+  }
+  {
+    auto required_str =
+      [](cmFindPackageCommand::RequiredStatus status) -> std::string {
+      switch (status) {
+        case cmFindPackageCommand::RequiredStatus::Optional:
+          return "optional";
+        case cmFindPackageCommand::RequiredStatus::OptionalExplicit:
+          return "optional_explicit";
+        case cmFindPackageCommand::RequiredStatus::RequiredExplicit:
+          return "required_explicit";
+        case cmFindPackageCommand::RequiredStatus::RequiredFromPackageVar:
+          return "required_from_package_variable";
+        case cmFindPackageCommand::RequiredStatus::RequiredFromFindVar:
+          return "required_from_find_variable";
+      }
+      assert(false);
+      return "<UNKNOWN>";
+    };
+    log.BeginObject("settings"_s);
+    log.WriteValue("required"_s, required_str(fpc->Required));
+    log.WriteValue("quiet"_s, fpc->Quiet);
+    log.WriteValue("global"_s, fpc->GlobalScope);
+    log.WriteValue("policy_scope"_s, fpc->PolicyScope);
+    log.WriteValue("bypass_provider"_s, fpc->BypassProvider);
+    if (!fpc->UserHintsArgs.empty()) {
+      log.WriteValue("hints"_s, fpc->UserHintsArgs);
+    }
+    if (!fpc->Names.empty()) {
+      log.WriteValue("names"_s, fpc->Names);
+    }
+    if (!fpc->UserGuessArgs.empty()) {
+      log.WriteValue("search_paths"_s, fpc->UserGuessArgs);
+    }
+    if (!fpc->SearchPathSuffixes.empty()) {
+      log.WriteValue("path_suffixes"_s, fpc->SearchPathSuffixes);
+    }
+    if (fpc->RegistryViewDefined) {
+      log.WriteValue(
+        "registry_view"_s,
+        std::string(cmWindowsRegistry::FromView(fpc->RegistryView)));
+    }
+    {
+      auto find_root_path_mode =
+        [](cmFindCommon::RootPathMode mode) -> std::string {
+        switch (mode) {
+          case cmFindCommon::RootPathModeNever:
+            return "NEVER";
+          case cmFindCommon::RootPathModeOnly:
+            return "ONLY";
+          case cmFindCommon::RootPathModeBoth:
+            return "BOTH";
+        }
+        assert(false);
+        return "<UNKNOWN>";
+      };
+      log.BeginObject("paths"_s);
+      log.WriteValue("CMAKE_FIND_USE_CMAKE_PATH"_s, !fpc->NoDefaultPath);
+      log.WriteValue("CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH"_s,
+                     !fpc->NoCMakeEnvironmentPath);
+      log.WriteValue("CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH"_s,
+                     !fpc->NoSystemEnvironmentPath);
+      log.WriteValue("CMAKE_FIND_USE_CMAKE_SYSTEM_PATH"_s,
+                     !fpc->NoCMakeSystemPath);
+      log.WriteValue("CMAKE_FIND_USE_INSTALL_PREFIX"_s,
+                     !fpc->NoCMakeInstallPath);
+      log.WriteValue("CMAKE_FIND_USE_PACKAGE_ROOT_PATH"_s,
+                     !fpc->NoPackageRootPath);
+      log.WriteValue("CMAKE_FIND_USE_CMAKE_PACKAGE_REGISTRY"_s,
+                     !fpc->NoUserRegistry);
+      log.WriteValue("CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY"_s,
+                     !fpc->NoSystemRegistry);
+      log.WriteValue("CMAKE_FIND_ROOT_PATH_MODE"_s,
+                     find_root_path_mode(fpc->FindRootPathMode));
+      log.EndObject();
+    }
+    log.EndObject();
+  }
+
+  auto found_mode =
+    [](cmFindPackageCommand::FoundPackageMode status) -> std::string {
+    switch (status) {
+      case cmFindPackageCommand::FoundPackageMode::None:
+        return "none?";
+      case cmFindPackageCommand::FoundPackageMode::Module:
+        return "module";
+      case cmFindPackageCommand::FoundPackageMode::Config:
+        return "config";
+      case cmFindPackageCommand::FoundPackageMode::Cps:
+        return "cps";
+      case cmFindPackageCommand::FoundPackageMode::Provider:
+        return "provider";
+    }
+    assert(false);
+    return "<UNKNOWN>";
+  };
+  if (!fpc->ConsideredPaths.empty()) {
+    auto search_result =
+      [](cmFindPackageCommand::SearchResult type) -> std::string {
+      switch (type) {
+        case cmFindPackageCommand::SearchResult::InsufficientVersion:
+          return "insufficient_version";
+        case cmFindPackageCommand::SearchResult::NoExist:
+          return "no_exist";
+        case cmFindPackageCommand::SearchResult::Ignored:
+          return "ignored";
+        case cmFindPackageCommand::SearchResult::NoConfigFile:
+          return "no_config_file";
+        case cmFindPackageCommand::SearchResult::NotFound:
+          return "not_found";
+      }
+      assert(false);
+      return "<UNKNOWN>";
+    };
+
+    log.BeginObject("candidates"_s);
+    log.BeginArray();
+    for (auto const& considered : fpc->ConsideredPaths) {
+      log.NextArrayElement();
+      log.WriteValue("path"_s, considered.Path);
+      log.WriteValue("mode"_s, found_mode(considered.Mode));
+      log.WriteValue("reason"_s, search_result(considered.Reason));
+      if (!considered.Message.empty()) {
+        log.WriteValue("message"_s, considered.Message);
+      }
+    }
+    log.EndArray();
+    log.EndObject();
+  }
+  // TODO: Add provider information (see #26925)
+  if (!fpc->FileFound.empty()) {
+    log.BeginObject("found"_s);
+    log.WriteValue("path"_s, fpc->FileFound);
+    log.WriteValue("mode"_s, found_mode(fpc->FileFoundMode));
+    log.WriteValue("version"_s, fpc->VersionFound);
+    log.EndObject();
+  } else {
+    log.WriteValue("found"_s, nullptr);
+  }
+
+  this->WriteSearchVariables(log, mf);
+
+  log.EndEvent();
+}
+
+std::vector<std::pair<cmFindCommonDebugState::VariableSource, std::string>>
+cmFindPackageDebugState::ExtraSearchVariables() const
+{
+  std::vector<std::pair<cmFindCommonDebugState::VariableSource, std::string>>
+    extraSearches;
+  if (this->FindPackageCommand->UseFindModules) {
+    extraSearches.emplace_back(VariableSource::PathList, "CMAKE_MODULE_PATH");
+  }
+  return extraSearches;
+}
+#endif
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index bac09ee..10448a8 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -32,7 +32,10 @@
 /* clang-format on */
 #endif
 
+class cmConfigureLog;
 class cmExecutionStatus;
+class cmMakefile;
+class cmPackageState;
 class cmSearchPath;
 
 /** \class cmFindPackageCommand
@@ -72,6 +75,7 @@
                    SortDirectionType dir);
 
   cmFindPackageCommand(cmExecutionStatus& status);
+  ~cmFindPackageCommand() override;
 
   bool InitialPass(std::vector<std::string> const& args);
 
@@ -94,6 +98,9 @@
 
   void InheritOptions(cmFindPackageCommand* other);
 
+  bool IsFound() const override;
+  bool IsDefined() const override;
+
   // Try to find a package, assuming most state has already been set up. This
   // is used for recursive dependency solving, particularly when importing
   // packages via CPS. Bypasses providers if argsForProvider is empty.
@@ -151,11 +158,20 @@
   using AppendixMap = std::map<std::string, Appendix>;
   AppendixMap FindAppendices(std::string const& base,
                              cmPackageInfoReader const& baseReader) const;
-  bool FindPackageDependencies(std::string const& fileName,
+  enum RequiredStatus
+  {
+    Optional,
+    OptionalExplicit,
+    RequiredExplicit,
+    RequiredFromPackageVar,
+    RequiredFromFindVar
+  };
+  bool FindPackageDependencies(std::string const& filePath,
                                cmPackageInfoReader const& reader,
-                               bool required);
+                               RequiredStatus required);
 
-  bool ImportPackageTargets(std::string const& fileName,
+  bool ImportPackageTargets(cmPackageState& packageState,
+                            std::string const& filePath,
                             cmPackageInfoReader& reader);
   void StoreVersionFound();
   void SetConfigDirCacheVariable(std::string const& value);
@@ -164,6 +180,15 @@
   void PopFindPackageRootPathStack();
   class PushPopRootPathStack;
 
+  enum class FoundPackageMode
+  {
+    None,
+    Module,
+    // Do not implicitly log for prior package types.
+    Config,
+    Cps,
+    Provider,
+  };
   void ComputePrefixes();
   void FillPrefixesPackageRedirect();
   void FillPrefixesPackageRoot();
@@ -185,7 +210,7 @@
   bool SearchDirectory(std::string const& dir, PackageDescriptionType type);
   bool CheckDirectory(std::string const& dir, PackageDescriptionType type);
   bool FindConfigFile(std::string const& dir, PackageDescriptionType type,
-                      std::string& file);
+                      std::string& file, FoundPackageMode& foundMode);
   bool CheckVersion(std::string const& config_file);
   bool CheckVersionFile(std::string const& version_file,
                         std::string& result_version);
@@ -194,6 +219,8 @@
   bool SearchAppBundlePrefix(std::string const& prefix);
   bool SearchEnvironmentPrefix(std::string const& prefix);
 
+  bool IsRequired() const;
+
   struct OriginalDef
   {
     bool exists;
@@ -226,6 +253,7 @@
   unsigned int VersionMaxCount = 0;
   bool VersionExact = false;
   std::string FileFound;
+  FoundPackageMode FileFoundMode = FoundPackageMode::None;
   std::string VersionFound;
   unsigned int VersionFoundMajor = 0;
   unsigned int VersionFoundMinor = 0;
@@ -233,8 +261,9 @@
   unsigned int VersionFoundTweak = 0;
   unsigned int VersionFoundCount = 0;
   KWIML_INT_uint64_t RequiredCMakeVersion = 0;
+  bool BypassProvider = false;
   bool Quiet = false;
-  bool Required = false;
+  RequiredStatus Required = RequiredStatus::Optional;
   bool UseCpsFiles = false;
   bool UseConfigFiles = true;
   bool UseFindModules = true;
@@ -256,6 +285,32 @@
   std::set<std::string> OptionalComponents;
   std::set<std::string> RequiredTargets;
   std::string DebugBuffer;
+  enum class SearchResult
+  {
+    InsufficientVersion,
+    NoExist,
+    Ignored,
+    NoConfigFile,
+    NotFound,
+  };
+  struct ConsideredPath
+  {
+    ConsideredPath(std::string path, FoundPackageMode mode,
+                   SearchResult reason)
+      : Path(std::move(path))
+      , Mode(mode)
+      , Reason(reason)
+    {
+    }
+
+    std::string Path;
+    FoundPackageMode Mode;
+    SearchResult Reason;
+    std::string Message;
+  };
+  std::vector<ConsideredPath> ConsideredPaths;
+
+  static FoundPackageMode FoundMode(PackageDescriptionType type);
 
   struct ConfigName
   {
@@ -310,6 +365,16 @@
   AppendixMap CpsAppendices;
 
   friend struct std::hash<ConfigFileInfo>;
+  friend class cmFindPackageDebugState;
+
+  enum class FindState
+  {
+    Undefined,
+    Irrelevant,
+    Found,
+    NotFound,
+  };
+  FindState InitialState = FindState::Undefined;
 };
 
 namespace std {
@@ -330,3 +395,24 @@
 
 bool cmFindPackage(std::vector<std::string> const& args,
                    cmExecutionStatus& status);
+
+class cmFindPackageDebugState : public cmFindCommonDebugState
+{
+public:
+  explicit cmFindPackageDebugState(cmFindPackageCommand const* findPackage);
+  ~cmFindPackageDebugState() override;
+
+private:
+  void FoundAtImpl(std::string const& path, std::string regexName) override;
+  void FailedAtImpl(std::string const& path, std::string regexName) override;
+  bool ShouldImplicitlyLogEvents() const override;
+
+  void WriteDebug() const override;
+#ifndef CMAKE_BOOTSTRAP
+  void WriteEvent(cmConfigureLog& log, cmMakefile const& mf) const override;
+  std::vector<std::pair<VariableSource, std::string>> ExtraSearchVariables()
+    const override;
+#endif
+
+  cmFindPackageCommand const* const FindPackageCommand;
+};
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index 2169a06..a15dc82 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -4,8 +4,11 @@
 
 #include <utility>
 
+#include <cm/memory>
+
 #include "cmsys/Glob.hxx"
 
+#include "cmFindCommon.h"
 #include "cmStateTypes.h"
 #include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
@@ -35,9 +38,12 @@
     return false;
   }
 
-  this->DebugMode = this->ComputeIfDebugModeWanted(this->VariableName);
+  this->FullDebugMode = this->ComputeIfDebugModeWanted(this->VariableName);
+  if (this->FullDebugMode || !this->ComputeIfImplicitDebugModeSuppressed()) {
+    this->DebugState = cm::make_unique<cmFindBaseDebugState>(this);
+  }
 
-  if (this->AlreadyDefined) {
+  if (this->IsFound()) {
     this->NormalizeFindResult();
     return true;
   }
@@ -49,24 +55,22 @@
 
 std::string cmFindPathCommand::FindHeader()
 {
-  cmFindBaseDebugState debug(this->FindCommandName, this);
   std::string header;
   if (this->SearchFrameworkFirst || this->SearchFrameworkOnly) {
-    header = this->FindFrameworkHeader(debug);
+    header = this->FindFrameworkHeader();
   }
   if (header.empty() && !this->SearchFrameworkOnly) {
-    header = this->FindNormalHeader(debug);
+    header = this->FindNormalHeader();
   }
   if (header.empty() && this->SearchFrameworkLast) {
-    header = this->FindFrameworkHeader(debug);
+    header = this->FindFrameworkHeader();
   }
 
   return header;
 }
 
 std::string cmFindPathCommand::FindHeaderInFramework(
-  std::string const& file, std::string const& dir,
-  cmFindBaseDebugState& debug) const
+  std::string const& file, std::string const& dir) const
 {
   std::string fileName = file;
   std::string frameWorkName;
@@ -90,13 +94,17 @@
       std::string intPath = cmStrCat(fpath, "/Headers/", fileName);
       if (cmSystemTools::FileExists(intPath) &&
           this->Validate(this->IncludeFileInPath ? intPath : fpath)) {
-        debug.FoundAt(intPath);
+        if (this->DebugState) {
+          this->DebugState->FoundAt(intPath);
+        }
         if (this->IncludeFileInPath) {
           return intPath;
         }
         return fpath;
       }
-      debug.FailedAt(intPath);
+      if (this->DebugState) {
+        this->DebugState->FailedAt(intPath);
+      }
     }
   }
   // if it is not found yet or not a framework header, then do a glob search
@@ -107,7 +115,9 @@
   std::vector<std::string> files = globIt.GetFiles();
   if (!files.empty()) {
     std::string fheader = cmSystemTools::ToNormalizedPathOnDisk(files[0]);
-    debug.FoundAt(fheader);
+    if (this->DebugState) {
+      this->DebugState->FoundAt(fheader);
+    }
     if (this->IncludeFileInPath) {
       return fheader;
     }
@@ -119,7 +129,7 @@
   return "";
 }
 
-std::string cmFindPathCommand::FindNormalHeader(cmFindBaseDebugState& debug)
+std::string cmFindPathCommand::FindNormalHeader()
 {
   std::string tryPath;
   for (std::string const& n : this->Names) {
@@ -127,23 +137,27 @@
       tryPath = cmStrCat(sp, n);
       if (cmSystemTools::FileExists(tryPath) &&
           this->Validate(this->IncludeFileInPath ? tryPath : sp)) {
-        debug.FoundAt(tryPath);
+        if (this->DebugState) {
+          this->DebugState->FoundAt(tryPath);
+        }
         if (this->IncludeFileInPath) {
           return tryPath;
         }
         return sp;
       }
-      debug.FailedAt(tryPath);
+      if (this->DebugState) {
+        this->DebugState->FailedAt(tryPath);
+      }
     }
   }
   return "";
 }
 
-std::string cmFindPathCommand::FindFrameworkHeader(cmFindBaseDebugState& debug)
+std::string cmFindPathCommand::FindFrameworkHeader()
 {
   for (std::string const& n : this->Names) {
     for (std::string const& sp : this->SearchPaths) {
-      std::string fwPath = this->FindHeaderInFramework(n, sp, debug);
+      std::string fwPath = this->FindHeaderInFramework(n, sp);
       if (!fwPath.empty()) {
         return fwPath;
       }
diff --git a/Source/cmFindPathCommand.h b/Source/cmFindPathCommand.h
index 3870a09..ba4683c 100644
--- a/Source/cmFindPathCommand.h
+++ b/Source/cmFindPathCommand.h
@@ -30,11 +30,10 @@
 
 private:
   std::string FindHeaderInFramework(std::string const& file,
-                                    std::string const& dir,
-                                    cmFindBaseDebugState& debug) const;
+                                    std::string const& dir) const;
   std::string FindHeader();
-  std::string FindNormalHeader(cmFindBaseDebugState& debug);
-  std::string FindFrameworkHeader(cmFindBaseDebugState& debug);
+  std::string FindNormalHeader();
+  std::string FindFrameworkHeader();
 };
 
 bool cmFindPath(std::vector<std::string> const& args,
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 3b9a16c..df8cb02 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -4,8 +4,10 @@
 
 #include <algorithm>
 #include <string>
-#include <utility>
 
+#include <cm/memory>
+
+#include "cmFindCommon.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmPolicies.h"
@@ -25,9 +27,9 @@
 
 struct cmFindProgramHelper
 {
-  cmFindProgramHelper(std::string debugName, cmMakefile* makefile,
-                      cmFindBase const* base)
-    : DebugSearches(std::move(debugName), base)
+  cmFindProgramHelper(cmMakefile* makefile, cmFindBase const* base,
+                      cmFindCommonDebugState* debugState)
+    : DebugState(debugState)
     , Makefile(makefile)
     , FindBase(base)
     , PolicyCMP0109(makefile->GetPolicyStatus(cmPolicies::CMP0109))
@@ -51,7 +53,7 @@
   std::vector<std::string> Names;
 
   // Debug state
-  cmFindBaseDebugState DebugSearches;
+  cmFindCommonDebugState* DebugState;
   cmMakefile* Makefile;
   cmFindBase const* FindBase;
 
@@ -95,11 +97,15 @@
                              cmSystemTools::ToNormalizedPathOnDisk(testPath);
                            if (this->FindBase->Validate(testPath)) {
                              this->BestPath = testPath;
-                             this->DebugSearches.FoundAt(testPath);
+                             if (this->DebugState) {
+                               this->DebugState->FoundAt(testPath);
+                             }
                              return true;
                            }
                          }
-                         this->DebugSearches.FailedAt(testPath);
+                         if (this->DebugState) {
+                           this->DebugState->FailedAt(testPath);
+                         }
                          return false;
                        });
   }
@@ -193,9 +199,13 @@
   if (!this->ParseArguments(argsIn)) {
     return false;
   }
-  this->DebugMode = this->ComputeIfDebugModeWanted(this->VariableName);
 
-  if (this->AlreadyDefined) {
+  this->FullDebugMode = this->ComputeIfDebugModeWanted(this->VariableName);
+  if (this->FullDebugMode || !this->ComputeIfImplicitDebugModeSuppressed()) {
+    this->DebugState = cm::make_unique<cmFindBaseDebugState>(this);
+  }
+
+  if (this->IsFound()) {
     this->NormalizeFindResult();
     return true;
   }
@@ -233,7 +243,7 @@
 std::string cmFindProgramCommand::FindNormalProgramNamesPerDir()
 {
   // Search for all names in each directory.
-  cmFindProgramHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindProgramHelper helper(this->Makefile, this, this->DebugState.get());
   for (std::string const& n : this->Names) {
     helper.AddName(n);
   }
@@ -256,7 +266,7 @@
 std::string cmFindProgramCommand::FindNormalProgramDirsPerName()
 {
   // Search the entire path for each name.
-  cmFindProgramHelper helper(this->FindCommandName, this->Makefile, this);
+  cmFindProgramHelper helper(this->Makefile, this, this->DebugState.get());
   for (std::string const& n : this->Names) {
     // Switch to searching for this name.
     helper.SetName(n);
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 83a6abf..96867e2 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -357,7 +357,7 @@
 
     } else {
       makefile.IssueMessage(MessageType::FATAL_ERROR,
-                            cmStrCat("Unknown argument:\n", "  ", arg, '\n'));
+                            cmStrCat("Unknown argument:\n  ", arg, '\n'));
       return true;
     }
   }
diff --git a/Source/cmGenExContext.cxx b/Source/cmGenExContext.cxx
new file mode 100644
index 0000000..1699051
--- /dev/null
+++ b/Source/cmGenExContext.cxx
@@ -0,0 +1,37 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file LICENSE.rst or https://cmake.org/licensing for details.  */
+#include "cmGenExContext.h"
+
+#include <utility>
+
+#include <cm/optional>
+
+#include "cmLocalGenerator.h"
+#include "cmPolicies.h"
+
+namespace cm {
+namespace GenEx {
+
+Context::Context(cmLocalGenerator const* lg, std::string config,
+                 std::string language)
+  : LG(lg)
+  , Config(std::move(config))
+  , Language(std::move(language))
+{
+}
+
+void Context::SetCMP0189(cmPolicies::PolicyStatus cmp0189)
+{
+  this->CMP0189 = cmp0189;
+}
+
+cmPolicies::PolicyStatus Context::GetCMP0189() const
+{
+  if (this->CMP0189.has_value()) {
+    return *this->CMP0189;
+  }
+  return this->LG->GetPolicyStatus(cmPolicies::CMP0189);
+}
+
+}
+}
diff --git a/Source/cmGenExContext.h b/Source/cmGenExContext.h
new file mode 100644
index 0000000..85c8ab2
--- /dev/null
+++ b/Source/cmGenExContext.h
@@ -0,0 +1,33 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file LICENSE.rst or https://cmake.org/licensing for details.  */
+#pragma once
+
+#include <string>
+
+#include <cm/optional>
+
+#include "cmPolicies.h"
+
+class cmLocalGenerator;
+
+namespace cm {
+namespace GenEx {
+
+struct Context final
+{
+  Context(cmLocalGenerator const* lg, std::string config,
+          std::string language = std::string());
+
+  cmLocalGenerator const* LG;
+  std::string Config;
+  std::string Language;
+
+  void SetCMP0189(cmPolicies::PolicyStatus cmp0189);
+  cmPolicies::PolicyStatus GetCMP0189() const;
+
+private:
+  cm::optional<cmPolicies::PolicyStatus> CMP0189;
+};
+
+}
+}
diff --git a/Source/cmGenExEvaluation.cxx b/Source/cmGenExEvaluation.cxx
new file mode 100644
index 0000000..226a71c
--- /dev/null
+++ b/Source/cmGenExEvaluation.cxx
@@ -0,0 +1,27 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file LICENSE.rst or https://cmake.org/licensing for details.  */
+#include "cmGenExEvaluation.h"
+
+#include <utility>
+
+#include "cmGenExContext.h"
+
+namespace cm {
+namespace GenEx {
+
+Evaluation::Evaluation(GenEx::Context context, bool quiet,
+                       cmGeneratorTarget const* headTarget,
+                       cmGeneratorTarget const* currentTarget,
+                       bool evaluateForBuildsystem,
+                       cmListFileBacktrace backtrace)
+  : Context(std::move(context))
+  , Backtrace(std::move(backtrace))
+  , HeadTarget(headTarget)
+  , CurrentTarget(currentTarget)
+  , Quiet(quiet)
+  , EvaluateForBuildsystem(evaluateForBuildsystem)
+{
+}
+
+}
+}
diff --git a/Source/cmGenExEvaluation.h b/Source/cmGenExEvaluation.h
new file mode 100644
index 0000000..c291d4c
--- /dev/null
+++ b/Source/cmGenExEvaluation.h
@@ -0,0 +1,46 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+   file LICENSE.rst or https://cmake.org/licensing for details.  */
+#pragma once
+
+#include <map>
+#include <set>
+#include <string>
+
+#include "cmGenExContext.h"
+#include "cmListFileCache.h"
+
+class cmGeneratorTarget;
+
+namespace cm {
+namespace GenEx {
+
+struct Evaluation final
+{
+  Evaluation(GenEx::Context context, bool quiet,
+             cmGeneratorTarget const* headTarget,
+             cmGeneratorTarget const* currentTarget,
+             bool evaluateForBuildsystem, cmListFileBacktrace backtrace);
+
+  GenEx::Context const Context;
+  cmListFileBacktrace Backtrace;
+  std::set<cmGeneratorTarget*> DependTargets;
+  std::set<cmGeneratorTarget const*> AllTargets;
+  std::set<std::string> SeenTargetProperties;
+  std::set<cmGeneratorTarget const*> SourceSensitiveTargets;
+  std::map<cmGeneratorTarget const*, std::map<std::string, std::string>>
+    MaxLanguageStandard;
+  // The target whose property is being evaluated.
+  cmGeneratorTarget const* HeadTarget;
+  // The dependent of HeadTarget which appears
+  // directly or indirectly in the property.
+  cmGeneratorTarget const* CurrentTarget;
+  bool Quiet;
+  bool HadError = false;
+  bool HadContextSensitiveCondition = false;
+  bool HadHeadSensitiveCondition = false;
+  bool HadLinkLanguageSensitiveCondition = false;
+  bool EvaluateForBuildsystem;
+};
+
+}
+}
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 873ed7e..dd4c886 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -5,13 +5,15 @@
 #include <algorithm>
 #include <cassert>
 #include <memory>
+#include <stack>
 #include <utility>
 
 #include <cm/string_view>
 
 #include "cmsys/RegularExpression.hxx"
 
-#include "cmGeneratorExpressionContext.h"
+#include "cmGenExContext.h"
+#include "cmGenExEvaluation.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorExpressionEvaluator.h"
 #include "cmGeneratorExpressionLexer.h"
@@ -42,7 +44,7 @@
 }
 
 std::string cmGeneratorExpression::Evaluate(
-  std::string input, cmLocalGenerator* lg, std::string const& config,
+  std::string input, cmLocalGenerator const* lg, std::string const& config,
   cmGeneratorTarget const* headTarget,
   cmGeneratorExpressionDAGChecker* dagChecker,
   cmGeneratorTarget const* currentTarget, std::string const& language)
@@ -53,24 +55,31 @@
       "genex_compile_eval", input);
 #endif
 
+    cm::GenEx::Context context(lg, config, language);
     cmCompiledGeneratorExpression cge(*lg->GetCMakeInstance(),
                                       cmListFileBacktrace(), std::move(input));
-    return cge.Evaluate(lg, config, headTarget, dagChecker, currentTarget,
-                        language);
+    return cge.Evaluate(context, dagChecker, headTarget, currentTarget);
   }
   return input;
 }
 
 std::string const& cmCompiledGeneratorExpression::Evaluate(
-  cmLocalGenerator* lg, std::string const& config,
-  cmGeneratorTarget const* headTarget,
-  cmGeneratorExpressionDAGChecker* dagChecker,
-  cmGeneratorTarget const* currentTarget, std::string const& language) const
+  cmLocalGenerator const* lg, std::string const& config,
+  cmGeneratorTarget const* headTarget) const
 {
-  cmGeneratorExpressionContext context(
-    lg, config, this->Quiet, headTarget,
-    currentTarget ? currentTarget : headTarget, this->EvaluateForBuildsystem,
-    this->Backtrace, language);
+  cm::GenEx::Context context(lg, config);
+  return this->Evaluate(context, nullptr, headTarget);
+}
+
+std::string const& cmCompiledGeneratorExpression::Evaluate(
+  cm::GenEx::Context const& context,
+  cmGeneratorExpressionDAGChecker* dagChecker,
+  cmGeneratorTarget const* headTarget,
+  cmGeneratorTarget const* currentTarget) const
+{
+  cm::GenEx::Evaluation eval(context, this->Quiet, headTarget,
+                             currentTarget ? currentTarget : headTarget,
+                             this->EvaluateForBuildsystem, this->Backtrace);
 
   if (!this->NeedsEvaluation) {
     return this->Input;
@@ -79,28 +88,28 @@
   this->Output.clear();
 
   for (auto const& it : this->Evaluators) {
-    this->Output += it->Evaluate(&context, dagChecker);
+    this->Output += it->Evaluate(&eval, dagChecker);
 
-    this->SeenTargetProperties.insert(context.SeenTargetProperties.cbegin(),
-                                      context.SeenTargetProperties.cend());
-    if (context.HadError) {
+    this->SeenTargetProperties.insert(eval.SeenTargetProperties.cbegin(),
+                                      eval.SeenTargetProperties.cend());
+    if (eval.HadError) {
       this->Output.clear();
       break;
     }
   }
 
-  this->MaxLanguageStandard = context.MaxLanguageStandard;
+  this->MaxLanguageStandard = eval.MaxLanguageStandard;
 
-  if (!context.HadError) {
-    this->HadContextSensitiveCondition = context.HadContextSensitiveCondition;
-    this->HadHeadSensitiveCondition = context.HadHeadSensitiveCondition;
+  if (!eval.HadError) {
+    this->HadContextSensitiveCondition = eval.HadContextSensitiveCondition;
+    this->HadHeadSensitiveCondition = eval.HadHeadSensitiveCondition;
     this->HadLinkLanguageSensitiveCondition =
-      context.HadLinkLanguageSensitiveCondition;
-    this->SourceSensitiveTargets = context.SourceSensitiveTargets;
+      eval.HadLinkLanguageSensitiveCondition;
+    this->SourceSensitiveTargets = eval.SourceSensitiveTargets;
   }
 
-  this->DependTargets = context.DependTargets;
-  this->AllTargetsSeen = context.AllTargets;
+  this->DependTargets = eval.DependTargets;
+  this->AllTargetsSeen = eval.AllTargets;
   return this->Output;
 }
 
@@ -156,27 +165,44 @@
   return result;
 }
 
-static std::string stripAllGeneratorExpressions(std::string const& input)
+static std::string extractAllGeneratorExpressions(
+  std::string const& input,
+  std::map<std::string, std::vector<std::string>>* collected)
 {
   std::string result;
   std::string::size_type pos = 0;
   std::string::size_type lastPos = pos;
-  int nestingLevel = 0;
+  std::stack<char const*> starts; // indices of "$<"
+  std::stack<char const*> colons; // indices of ":"
   while ((pos = input.find("$<", lastPos)) != std::string::npos) {
     result += input.substr(lastPos, pos - lastPos);
+    starts.push(input.c_str() + pos);
     pos += 2;
-    nestingLevel = 1;
     char const* c = input.c_str() + pos;
     char const* const cStart = c;
     for (; *c; ++c) {
       if (cmGeneratorExpression::StartsWithGeneratorExpression(c)) {
-        ++nestingLevel;
+        starts.push(c);
         ++c;
         continue;
       }
-      if (c[0] == '>') {
-        --nestingLevel;
-        if (nestingLevel == 0) {
+      if (c[0] == ':') {
+        if (colons.size() < starts.size()) {
+          colons.push(c);
+        }
+      } else if (c[0] == '>') {
+        if (!colons.empty() && !starts.empty() &&
+            starts.top() < colons.top()) {
+          if (collected) {
+            (*collected)[std::string(starts.top() + 2, colons.top())]
+              .push_back(std::string(colons.top() + 1, c));
+          }
+          colons.pop();
+        }
+        if (!starts.empty()) {
+          starts.pop();
+        }
+        if (starts.empty()) {
           break;
         }
       }
@@ -188,12 +214,17 @@
     pos += traversed;
     lastPos = pos;
   }
-  if (nestingLevel == 0) {
+  if (starts.empty()) {
     result += input.substr(lastPos);
   }
   return cmGeneratorExpression::StripEmptyListElements(result);
 }
 
+static std::string stripAllGeneratorExpressions(std::string const& input)
+{
+  return extractAllGeneratorExpressions(input, nullptr);
+}
+
 static void prefixItems(std::string const& content, std::string& result,
                         cm::string_view const& prefix)
 {
@@ -375,6 +406,13 @@
   return std::string();
 }
 
+std::string cmGeneratorExpression::Collect(
+  std::string const& input,
+  std::map<std::string, std::vector<std::string>>& collected)
+{
+  return extractAllGeneratorExpressions(input, &collected);
+}
+
 cm::string_view::size_type cmGeneratorExpression::Find(
   cm::string_view const& input)
 {
@@ -424,17 +462,18 @@
   this->CompiledGeneratorExpression =
     this->GeneratorExpression.Parse(std::move(expression));
 
+  cm::GenEx::Context context(this->LocalGenerator, this->Config,
+                             this->Language);
+
   // Specify COMPILE_OPTIONS to DAGchecker, same semantic as COMPILE_FLAGS
   cmGeneratorExpressionDAGChecker dagChecker{
     this->HeadTarget,
     property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property,
     nullptr,
     nullptr,
-    this->LocalGenerator,
-    this->Config,
+    context,
   };
 
-  return this->CompiledGeneratorExpression->Evaluate(
-    this->LocalGenerator, this->Config, this->HeadTarget, &dagChecker, nullptr,
-    this->Language);
+  return this->CompiledGeneratorExpression->Evaluate(context, &dagChecker,
+                                                     this->HeadTarget);
 }
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 293459c..1389144 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -16,6 +16,12 @@
 #include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
 
+namespace cm {
+namespace GenEx {
+struct Context;
+}
+}
+
 class cmake;
 class cmCompiledGeneratorExpression;
 class cmGeneratorTarget;
@@ -46,7 +52,7 @@
     std::string input) const;
 
   static std::string Evaluate(
-    std::string input, cmLocalGenerator* lg, std::string const& config,
+    std::string input, cmLocalGenerator const* lg, std::string const& config,
     cmGeneratorTarget const* headTarget = nullptr,
     cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
     cmGeneratorTarget const* currentTarget = nullptr,
@@ -63,6 +69,10 @@
                                 PreprocessContext context,
                                 cm::string_view importPrefix = {});
 
+  static std::string Collect(
+    std::string const& input,
+    std::map<std::string, std::vector<std::string>>& collected);
+
   static void Split(std::string const& input,
                     std::vector<std::string>& output);
 
@@ -99,11 +109,14 @@
     cmCompiledGeneratorExpression const&) = delete;
 
   std::string const& Evaluate(
-    cmLocalGenerator* lg, std::string const& config,
+    cmLocalGenerator const* lg, std::string const& config,
+    cmGeneratorTarget const* headTarget = nullptr) const;
+
+  std::string const& Evaluate(
+    cm::GenEx::Context const& context,
+    cmGeneratorExpressionDAGChecker* dagChecker,
     cmGeneratorTarget const* headTarget = nullptr,
-    cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
-    cmGeneratorTarget const* currentTarget = nullptr,
-    std::string const& language = std::string()) const;
+    cmGeneratorTarget const* currentTarget = nullptr) const;
 
   /** Get set of targets found during evaluations.  */
   std::set<cmGeneratorTarget*> const& GetTargets() const
@@ -181,7 +194,7 @@
 class cmGeneratorExpressionInterpreter
 {
 public:
-  cmGeneratorExpressionInterpreter(cmLocalGenerator* localGenerator,
+  cmGeneratorExpressionInterpreter(cmLocalGenerator const* localGenerator,
                                    std::string config,
                                    cmGeneratorTarget const* headTarget,
                                    std::string language = std::string())
@@ -204,7 +217,7 @@
 protected:
   cmGeneratorExpression GeneratorExpression;
   std::unique_ptr<cmCompiledGeneratorExpression> CompiledGeneratorExpression;
-  cmLocalGenerator* LocalGenerator = nullptr;
+  cmLocalGenerator const* LocalGenerator = nullptr;
   std::string Config;
   cmGeneratorTarget const* HeadTarget = nullptr;
   std::string Language;
diff --git a/Source/cmGeneratorExpressionContext.cxx b/Source/cmGeneratorExpressionContext.cxx
deleted file mode 100644
index a934717..0000000
--- a/Source/cmGeneratorExpressionContext.cxx
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file LICENSE.rst or https://cmake.org/licensing for details.  */
-#include "cmGeneratorExpressionContext.h"
-
-#include <utility>
-
-cmGeneratorExpressionContext::cmGeneratorExpressionContext(
-  cmLocalGenerator* lg, std::string config, bool quiet,
-  cmGeneratorTarget const* headTarget, cmGeneratorTarget const* currentTarget,
-  bool evaluateForBuildsystem, cmListFileBacktrace backtrace,
-  std::string language)
-  : Backtrace(std::move(backtrace))
-  , LG(lg)
-  , Config(std::move(config))
-  , Language(std::move(language))
-  , HeadTarget(headTarget)
-  , CurrentTarget(currentTarget)
-  , Quiet(quiet)
-  , EvaluateForBuildsystem(evaluateForBuildsystem)
-{
-}
diff --git a/Source/cmGeneratorExpressionContext.h b/Source/cmGeneratorExpressionContext.h
deleted file mode 100644
index d013477..0000000
--- a/Source/cmGeneratorExpressionContext.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
-   file LICENSE.rst or https://cmake.org/licensing for details.  */
-#pragma once
-
-#include <map>
-#include <set>
-#include <string>
-
-#include "cmListFileCache.h"
-
-class cmGeneratorTarget;
-class cmLocalGenerator;
-
-struct cmGeneratorExpressionContext
-{
-  cmGeneratorExpressionContext(cmLocalGenerator* lg, std::string config,
-                               bool quiet, cmGeneratorTarget const* headTarget,
-                               cmGeneratorTarget const* currentTarget,
-                               bool evaluateForBuildsystem,
-                               cmListFileBacktrace backtrace,
-                               std::string language);
-
-  cmListFileBacktrace Backtrace;
-  std::set<cmGeneratorTarget*> DependTargets;
-  std::set<cmGeneratorTarget const*> AllTargets;
-  std::set<std::string> SeenTargetProperties;
-  std::set<cmGeneratorTarget const*> SourceSensitiveTargets;
-  std::map<cmGeneratorTarget const*, std::map<std::string, std::string>>
-    MaxLanguageStandard;
-  cmLocalGenerator* LG;
-  std::string Config;
-  std::string Language;
-  // The target whose property is being evaluated.
-  cmGeneratorTarget const* HeadTarget;
-  // The dependent of HeadTarget which appears
-  // directly or indirectly in the property.
-  cmGeneratorTarget const* CurrentTarget;
-  bool Quiet;
-  bool HadError = false;
-  bool HadContextSensitiveCondition = false;
-  bool HadHeadSensitiveCondition = false;
-  bool HadLinkLanguageSensitiveCondition = false;
-  bool EvaluateForBuildsystem;
-};
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 3e8e885..77946f3 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -9,7 +9,8 @@
 #include <cm/string_view>
 #include <cmext/string_view>
 
-#include "cmGeneratorExpressionContext.h"
+#include "cmGenExContext.h"
+#include "cmGenExEvaluation.h"
 #include "cmGeneratorExpressionEvaluator.h"
 #include "cmGeneratorTarget.h"
 #include "cmLocalGenerator.h"
@@ -20,9 +21,8 @@
 cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
   cmGeneratorTarget const* target, std::string property,
   GeneratorExpressionContent const* content,
-  cmGeneratorExpressionDAGChecker* parent, cmLocalGenerator const* contextLG,
-  std::string const& contextConfig, cmListFileBacktrace backtrace,
-  ComputingLinkLibraries computingLinkLibraries)
+  cmGeneratorExpressionDAGChecker* parent, cm::GenEx::Context const& context,
+  cmListFileBacktrace backtrace, ComputingLinkLibraries computingLinkLibraries)
   : Parent(parent)
   , Top(parent ? parent->Top : this)
   , Target(target)
@@ -35,8 +35,7 @@
     this->TopIsTransitiveProperty = parent->TopIsTransitiveProperty;
   } else {
     this->TopIsTransitiveProperty =
-      this->Target
-        ->IsTransitiveProperty(this->Property, contextLG, contextConfig, this)
+      this->Target->IsTransitiveProperty(this->Property, context, this)
         .has_value();
   }
 
@@ -62,15 +61,15 @@
   return this->CheckResult;
 }
 
-void cmGeneratorExpressionDAGChecker::ReportError(
-  cmGeneratorExpressionContext* context, std::string const& expr)
+void cmGeneratorExpressionDAGChecker::ReportError(cm::GenEx::Evaluation* eval,
+                                                  std::string const& expr)
 {
   if (this->CheckResult == DAG) {
     return;
   }
 
-  context->HadError = true;
-  if (context->Quiet) {
+  eval->HadError = true;
+  if (eval->Quiet) {
     return;
   }
 
@@ -80,10 +79,10 @@
     std::ostringstream e;
     e << "Error evaluating generator expression:\n"
       << "  " << expr << "\n"
-      << "Self reference on target \"" << context->HeadTarget->GetName()
+      << "Self reference on target \"" << eval->HeadTarget->GetName()
       << "\".\n";
-    context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
-                                                  e.str(), parent->Backtrace);
+    eval->Context.LG->GetCMakeInstance()->IssueMessage(
+      MessageType::FATAL_ERROR, e.str(), parent->Backtrace);
     return;
   }
 
@@ -94,8 +93,8 @@
     << "  " << expr << "\n"
     << "Dependency loop found.";
     /* clang-format on */
-    context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
-                                                  e.str(), context->Backtrace);
+    eval->Context.LG->GetCMakeInstance()->IssueMessage(
+      MessageType::FATAL_ERROR, e.str(), eval->Backtrace);
   }
 
   int loopStep = 1;
@@ -105,8 +104,8 @@
       << "  "
       << (parent->Content ? parent->Content->GetOriginalExpression() : expr)
       << "\n";
-    context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
-                                                  e.str(), parent->Backtrace);
+    eval->Context.LG->GetCMakeInstance()->IssueMessage(
+      MessageType::FATAL_ERROR, e.str(), parent->Backtrace);
     parent = parent->Parent;
     ++loopStep;
   }
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 1601afb..c310c8e 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -10,10 +10,15 @@
 
 #include "cmListFileCache.h"
 
+namespace cm {
+namespace GenEx {
+struct Context;
+struct Evaluation;
+}
+}
+
 struct GeneratorExpressionContent;
-struct cmGeneratorExpressionContext;
 class cmGeneratorTarget;
-class cmLocalGenerator;
 
 struct cmGeneratorExpressionDAGChecker
 {
@@ -25,8 +30,7 @@
   cmGeneratorExpressionDAGChecker(
     cmGeneratorTarget const* target, std::string property,
     GeneratorExpressionContent const* content,
-    cmGeneratorExpressionDAGChecker* parent, cmLocalGenerator const* contextLG,
-    std::string const& contextConfig,
+    cmGeneratorExpressionDAGChecker* parent, cm::GenEx::Context const& context,
     cmListFileBacktrace backtrace = cmListFileBacktrace(),
     ComputingLinkLibraries computingLinkLibraries =
       ComputingLinkLibraries::No);
@@ -41,8 +45,7 @@
 
   Result Check() const;
 
-  void ReportError(cmGeneratorExpressionContext* context,
-                   std::string const& expr);
+  void ReportError(cm::GenEx::Evaluation* eval, std::string const& expr);
 
   bool EvaluatingTransitiveProperty() const;
   bool EvaluatingGenexExpression() const;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 4664dea..38a320b 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -8,6 +8,7 @@
 
 #include "cmsys/FStream.hxx"
 
+#include "cmGenExContext.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGlobalGenerator.h"
 #include "cmListFileCache.h"
@@ -22,7 +23,8 @@
   std::unique_ptr<cmCompiledGeneratorExpression> outputFileExpr,
   std::unique_ptr<cmCompiledGeneratorExpression> condition,
   bool inputIsContent, std::string newLineCharacter, mode_t permissions,
-  cmPolicies::PolicyStatus policyStatusCMP0070)
+  cmPolicies::PolicyStatus policyStatusCMP0070,
+  cmPolicies::PolicyStatus policyStatusCMP0189)
   : Input(std::move(input))
   , Target(std::move(target))
   , OutputFileExpr(std::move(outputFileExpr))
@@ -30,6 +32,7 @@
   , InputIsContent(inputIsContent)
   , NewLineCharacter(std::move(newLineCharacter))
   , PolicyStatusCMP0070(policyStatusCMP0070)
+  , PolicyStatusCMP0189(policyStatusCMP0189)
   , Permissions(permissions)
 {
 }
@@ -39,11 +42,13 @@
   cmCompiledGeneratorExpression* inputExpression,
   std::map<std::string, std::string>& outputFiles, mode_t perm)
 {
+  cm::GenEx::Context context(lg, config, lang);
+  context.SetCMP0189(this->PolicyStatusCMP0189);
   std::string rawCondition = this->Condition->GetInput();
   cmGeneratorTarget* target = lg->FindGeneratorTargetToUse(this->Target);
   if (!rawCondition.empty()) {
     std::string condResult =
-      this->Condition->Evaluate(lg, config, target, nullptr, nullptr, lang);
+      this->Condition->Evaluate(context, nullptr, target);
     if (condResult == "0") {
       return;
     }
@@ -58,10 +63,9 @@
     }
   }
 
-  std::string const outputFileName =
-    this->GetOutputFileName(lg, target, config, lang);
+  std::string const outputFileName = this->GetOutputFileName(context, target);
   std::string const& outputContent =
-    inputExpression->Evaluate(lg, config, target, nullptr, nullptr, lang);
+    inputExpression->Evaluate(context, nullptr, target);
 
   auto it = outputFiles.find(outputFileName);
 
@@ -123,8 +127,10 @@
   cmGeneratorTarget* target = lg->FindGeneratorTargetToUse(this->Target);
   gg->GetEnabledLanguages(enabledLanguages);
 
-  for (std::string const& le : enabledLanguages) {
-    std::string const name = this->GetOutputFileName(lg, target, config, le);
+  for (std::string const& lang : enabledLanguages) {
+    cm::GenEx::Context context(lg, config, lang);
+    context.SetCMP0189(this->PolicyStatusCMP0189);
+    std::string const name = this->GetOutputFileName(context, target);
     cmSourceFile* sf = lg->GetMakefile()->GetOrCreateGeneratedSource(name);
 
     // Tell the build system generators that there is no build rule
@@ -190,7 +196,7 @@
 }
 
 std::string cmGeneratorExpressionEvaluationFile::GetInputFileName(
-  cmLocalGenerator* lg)
+  cmLocalGenerator const* lg)
 {
   std::string inputFileName = this->Input;
 
@@ -204,23 +210,23 @@
 }
 
 std::string cmGeneratorExpressionEvaluationFile::GetOutputFileName(
-  cmLocalGenerator* lg, cmGeneratorTarget* target, std::string const& config,
-  std::string const& lang)
+  cm::GenEx::Context const& context, cmGeneratorTarget* target)
 {
   std::string outputFileName =
-    this->OutputFileExpr->Evaluate(lg, config, target, nullptr, nullptr, lang);
+    this->OutputFileExpr->Evaluate(context, nullptr, target);
 
   if (cmSystemTools::FileIsFullPath(outputFileName)) {
     outputFileName = cmSystemTools::CollapseFullPath(outputFileName);
   } else {
-    outputFileName = this->FixRelativePath(outputFileName, PathForOutput, lg);
+    outputFileName =
+      this->FixRelativePath(outputFileName, PathForOutput, context.LG);
   }
 
   return outputFileName;
 }
 
 std::string cmGeneratorExpressionEvaluationFile::FixRelativePath(
-  std::string const& relativePath, PathRole role, cmLocalGenerator* lg)
+  std::string const& relativePath, PathRole role, cmLocalGenerator const* lg)
 {
   std::string resultPath;
   switch (this->PolicyStatusCMP0070) {
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 5826636..01955ba 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -14,6 +14,12 @@
 #include "cmGeneratorExpression.h"
 #include "cmPolicies.h"
 
+namespace cm {
+namespace GenEx {
+struct Context;
+}
+}
+
 class cmGeneratorTarget;
 class cmLocalGenerator;
 
@@ -25,7 +31,8 @@
     std::unique_ptr<cmCompiledGeneratorExpression> outputFileExpr,
     std::unique_ptr<cmCompiledGeneratorExpression> condition,
     bool inputIsContent, std::string newLineCharacter, mode_t permissions,
-    cmPolicies::PolicyStatus policyStatusCMP0070);
+    cmPolicies::PolicyStatus policyStatusCMP0070,
+    cmPolicies::PolicyStatus policyStatusCMP0189);
 
   void Generate(cmLocalGenerator* lg);
 
@@ -39,18 +46,16 @@
                 cmCompiledGeneratorExpression* inputExpression,
                 std::map<std::string, std::string>& outputFiles, mode_t perm);
 
-  std::string GetInputFileName(cmLocalGenerator* lg);
-  std::string GetOutputFileName(cmLocalGenerator* lg,
-                                cmGeneratorTarget* target,
-                                std::string const& config,
-                                std::string const& lang);
+  std::string GetInputFileName(cmLocalGenerator const* lg);
+  std::string GetOutputFileName(cm::GenEx::Context const& context,
+                                cmGeneratorTarget* target);
   enum PathRole
   {
     PathForInput,
     PathForOutput
   };
   std::string FixRelativePath(std::string const& filePath, PathRole role,
-                              cmLocalGenerator* lg);
+                              cmLocalGenerator const* lg);
 
   std::string const Input;
   std::string const Target;
@@ -60,5 +65,6 @@
   bool const InputIsContent;
   std::string const NewLineCharacter;
   cmPolicies::PolicyStatus PolicyStatusCMP0070;
+  cmPolicies::PolicyStatus PolicyStatusCMP0189;
   mode_t Permissions;
 };
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 47c455f..8ad2be5 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -8,7 +8,8 @@
 #  include <cm3p/json/value.h>
 #endif
 
-#include "cmGeneratorExpressionContext.h"
+#include "cmGenExContext.h"
+#include "cmGenExEvaluation.h"
 #include "cmGeneratorExpressionNode.h"
 #include "cmLocalGenerator.h"
 #include "cmake.h"
@@ -29,8 +30,7 @@
 
 std::string GeneratorExpressionContent::ProcessArbitraryContent(
   cmGeneratorExpressionNode const* node, std::string const& identifier,
-  cmGeneratorExpressionContext* context,
-  cmGeneratorExpressionDAGChecker* dagChecker,
+  cm::GenEx::Evaluation* eval, cmGeneratorExpressionDAGChecker* dagChecker,
   std::vector<cmGeneratorExpressionEvaluatorVector>::const_iterator pit) const
 {
   std::string result;
@@ -40,14 +40,14 @@
     for (auto const& pExprEval : *pit) {
       if (node->RequiresLiteralInput()) {
         if (pExprEval->GetType() != cmGeneratorExpressionEvaluator::Text) {
-          reportError(context, this->GetOriginalExpression(),
+          reportError(eval, this->GetOriginalExpression(),
                       "$<" + identifier +
                         "> expression requires literal input.");
           return std::string();
         }
       }
-      result += pExprEval->Evaluate(context, dagChecker);
-      if (context->HadError) {
+      result += pExprEval->Evaluate(eval, dagChecker);
+      if (eval->HadError) {
         return std::string();
       }
     }
@@ -58,26 +58,26 @@
   if (node->RequiresLiteralInput()) {
     std::vector<std::string> parameters;
     parameters.push_back(result);
-    return node->Evaluate(parameters, context, this, dagChecker);
+    return node->Evaluate(parameters, eval, this, dagChecker);
   }
   return result;
 }
 
 std::string GeneratorExpressionContent::Evaluate(
-  cmGeneratorExpressionContext* context,
+  cm::GenEx::Evaluation* eval,
   cmGeneratorExpressionDAGChecker* dagChecker) const
 {
 #ifndef CMAKE_BOOTSTRAP
   auto evalProfilingRAII =
-    context->LG->GetCMakeInstance()->CreateProfilingEntry(
+    eval->Context.LG->GetCMakeInstance()->CreateProfilingEntry(
       "genex_eval", this->GetOriginalExpression());
 #endif
 
   std::string identifier;
   {
     for (auto const& pExprEval : this->IdentifierChildren) {
-      identifier += pExprEval->Evaluate(context, dagChecker);
-      if (context->HadError) {
+      identifier += pExprEval->Evaluate(eval, dagChecker);
+      if (eval->HadError) {
         return std::string();
       }
     }
@@ -87,7 +87,7 @@
     cmGeneratorExpressionNode::GetNode(identifier);
 
   if (!node) {
-    reportError(context, this->GetOriginalExpression(),
+    reportError(eval, this->GetOriginalExpression(),
                 "Expression did not evaluate to a known generator expression");
     return std::string();
   }
@@ -96,27 +96,26 @@
     if (node->NumExpectedParameters() == 1 &&
         node->AcceptsArbitraryContentParameter()) {
       if (this->ParamChildren.empty()) {
-        reportError(context, this->GetOriginalExpression(),
+        reportError(eval, this->GetOriginalExpression(),
                     "$<" + identifier + "> expression requires a parameter.");
       }
     } else {
       std::vector<std::string> parameters;
-      this->EvaluateParameters(node, identifier, context, dagChecker,
-                               parameters);
+      this->EvaluateParameters(node, identifier, eval, dagChecker, parameters);
     }
     return std::string();
   }
 
   std::vector<std::string> parameters;
-  this->EvaluateParameters(node, identifier, context, dagChecker, parameters);
-  if (context->HadError) {
+  this->EvaluateParameters(node, identifier, eval, dagChecker, parameters);
+  if (eval->HadError) {
     return std::string();
   }
 
   {
 #ifndef CMAKE_BOOTSTRAP
     auto execProfilingRAII =
-      context->LG->GetCMakeInstance()->CreateProfilingEntry(
+      eval->Context.LG->GetCMakeInstance()->CreateProfilingEntry(
         "genex_exec", identifier, [&parameters]() -> Json::Value {
           Json::Value args = Json::objectValue;
           if (!parameters.empty()) {
@@ -129,14 +128,13 @@
         });
 #endif
 
-    return node->Evaluate(parameters, context, this, dagChecker);
+    return node->Evaluate(parameters, eval, this, dagChecker);
   }
 }
 
 std::string GeneratorExpressionContent::EvaluateParameters(
   cmGeneratorExpressionNode const* node, std::string const& identifier,
-  cmGeneratorExpressionContext* context,
-  cmGeneratorExpressionDAGChecker* dagChecker,
+  cm::GenEx::Evaluation* eval, cmGeneratorExpressionDAGChecker* dagChecker,
   std::vector<std::string>& parameters) const
 {
   int const numExpected = node->NumExpectedParameters();
@@ -149,14 +147,14 @@
     for (; pit != pend; ++pit, ++counter) {
       if (acceptsArbitraryContent && counter == numExpected) {
         parameters.push_back(this->ProcessArbitraryContent(
-          node, identifier, context, dagChecker, pit));
+          node, identifier, eval, dagChecker, pit));
         return std::string();
       }
       std::string parameter;
       if (node->ShouldEvaluateNextParameter(parameters, parameter)) {
         for (auto const& pExprEval : *pit) {
-          parameter += pExprEval->Evaluate(context, dagChecker);
-          if (context->HadError) {
+          parameter += pExprEval->Evaluate(eval, dagChecker);
+          if (eval->HadError) {
             return std::string();
           }
         }
@@ -168,10 +166,10 @@
   if ((numExpected > cmGeneratorExpressionNode::DynamicParameters &&
        static_cast<unsigned int>(numExpected) != parameters.size())) {
     if (numExpected == 0) {
-      reportError(context, this->GetOriginalExpression(),
+      reportError(eval, this->GetOriginalExpression(),
                   "$<" + identifier + "> expression requires no parameters.");
     } else if (numExpected == 1) {
-      reportError(context, this->GetOriginalExpression(),
+      reportError(eval, this->GetOriginalExpression(),
                   "$<" + identifier +
                     "> expression requires "
                     "exactly one parameter.");
@@ -180,24 +178,24 @@
       e << "$<" + identifier + "> expression requires " << numExpected
         << " comma separated parameters, but got " << parameters.size()
         << " instead.";
-      reportError(context, this->GetOriginalExpression(), e.str());
+      reportError(eval, this->GetOriginalExpression(), e.str());
     }
     return std::string();
   }
 
   if (numExpected == cmGeneratorExpressionNode::OneOrMoreParameters &&
       parameters.empty()) {
-    reportError(context, this->GetOriginalExpression(),
+    reportError(eval, this->GetOriginalExpression(),
                 "$<" + identifier +
                   "> expression requires at least one parameter.");
   } else if (numExpected == cmGeneratorExpressionNode::TwoOrMoreParameters &&
              parameters.size() < 2) {
-    reportError(context, this->GetOriginalExpression(),
+    reportError(eval, this->GetOriginalExpression(),
                 "$<" + identifier +
                   "> expression requires at least two parameters.");
   } else if (numExpected == cmGeneratorExpressionNode::OneOrZeroParameters &&
              parameters.size() > 1) {
-    reportError(context, this->GetOriginalExpression(),
+    reportError(eval, this->GetOriginalExpression(),
                 "$<" + identifier +
                   "> expression requires one or zero parameters.");
   }
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index d985e63..c71c338 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -10,7 +10,12 @@
 #include <utility>
 #include <vector>
 
-struct cmGeneratorExpressionContext;
+namespace cm {
+namespace GenEx {
+struct Evaluation;
+}
+}
+
 struct cmGeneratorExpressionDAGChecker;
 struct cmGeneratorExpressionNode;
 
@@ -32,7 +37,7 @@
 
   virtual Type GetType() const = 0;
 
-  virtual std::string Evaluate(cmGeneratorExpressionContext* context,
+  virtual std::string Evaluate(cm::GenEx::Evaluation* eval,
                                cmGeneratorExpressionDAGChecker*) const = 0;
 };
 
@@ -47,7 +52,7 @@
   {
   }
 
-  std::string Evaluate(cmGeneratorExpressionContext*,
+  std::string Evaluate(cm::GenEx::Evaluation*,
                        cmGeneratorExpressionDAGChecker*) const override
   {
     return std::string(this->Content, this->Length);
@@ -87,7 +92,7 @@
     return cmGeneratorExpressionEvaluator::Generator;
   }
 
-  std::string Evaluate(cmGeneratorExpressionContext* context,
+  std::string Evaluate(cm::GenEx::Evaluation* eval,
                        cmGeneratorExpressionDAGChecker*) const override;
 
   std::string GetOriginalExpression() const;
@@ -97,14 +102,13 @@
 private:
   std::string EvaluateParameters(cmGeneratorExpressionNode const* node,
                                  std::string const& identifier,
-                                 cmGeneratorExpressionContext* context,
+                                 cm::GenEx::Evaluation* eval,
                                  cmGeneratorExpressionDAGChecker* dagChecker,
                                  std::vector<std::string>& parameters) const;
 
   std::string ProcessArbitraryContent(
     cmGeneratorExpressionNode const* node, std::string const& identifier,
-    cmGeneratorExpressionContext* context,
-    cmGeneratorExpressionDAGChecker* dagChecker,
+    cm::GenEx::Evaluation* eval, cmGeneratorExpressionDAGChecker* dagChecker,
     std::vector<cmGeneratorExpressionEvaluatorVector>::const_iterator pit)
     const;
 
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 31923d6..082fd3d 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -27,8 +27,9 @@
 
 #include "cmCMakePath.h"
 #include "cmComputeLinkInformation.h"
+#include "cmGenExContext.h"
+#include "cmGenExEvaluation.h"
 #include "cmGeneratorExpression.h"
-#include "cmGeneratorExpressionContext.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorExpressionEvaluator.h"
 #include "cmGeneratorTarget.h"
@@ -52,26 +53,26 @@
 #include "cmake.h"
 
 std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
-  std::string const& prop, cmLocalGenerator* lg,
-  cmGeneratorExpressionContext* context, cmGeneratorTarget const* headTarget,
+  std::string const& prop, cm::GenEx::Evaluation* eval,
+  cmGeneratorTarget const* headTarget,
   cmGeneratorExpressionDAGChecker* dagChecker,
   cmGeneratorTarget const* currentTarget)
 {
-  cmGeneratorExpression ge(*lg->GetCMakeInstance(), context->Backtrace);
+  cmGeneratorExpression ge(*eval->Context.LG->GetCMakeInstance(),
+                           eval->Backtrace);
   std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
-  cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
-  cge->SetQuiet(context->Quiet);
+  cge->SetEvaluateForBuildsystem(eval->EvaluateForBuildsystem);
+  cge->SetQuiet(eval->Quiet);
   std::string result =
-    cge->Evaluate(lg, context->Config, headTarget, dagChecker, currentTarget,
-                  context->Language);
+    cge->Evaluate(eval->Context, dagChecker, headTarget, currentTarget);
   if (cge->GetHadContextSensitiveCondition()) {
-    context->HadContextSensitiveCondition = true;
+    eval->HadContextSensitiveCondition = true;
   }
   if (cge->GetHadHeadSensitiveCondition()) {
-    context->HadHeadSensitiveCondition = true;
+    eval->HadHeadSensitiveCondition = true;
   }
   if (cge->GetHadLinkLanguageSensitiveCondition()) {
-    context->HadLinkLanguageSensitiveCondition = true;
+    eval->HadLinkLanguageSensitiveCondition = true;
   }
   return result;
 }
@@ -86,7 +87,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& /*parameters*/,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -102,7 +103,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -139,7 +140,7 @@
   }
 
   std::string Evaluate(std::vector<std::string> const& parameters,
-                       cmGeneratorExpressionContext* context,
+                       cm::GenEx::Evaluation* eval,
                        GeneratorExpressionContent const* content,
                        cmGeneratorExpressionDAGChecker*) const override
   {
@@ -151,7 +152,7 @@
         std::ostringstream e;
         e << "Parameters to $<" << this->op;
         e << "> must resolve to either '0' or '1'.";
-        reportError(context, content->GetOriginalExpression(), e.str());
+        reportError(eval, content->GetOriginalExpression(), e.str());
         return std::string();
       }
     }
@@ -168,14 +169,13 @@
   NotNode() {} // NOLINT(modernize-use-equals-default)
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     if (parameters.front() != "0" && parameters.front() != "1") {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<NOT> parameter must resolve to exactly one '0' or '1' value.");
       return std::string();
     }
@@ -191,7 +191,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -213,12 +213,12 @@
   }
 
   std::string Evaluate(std::vector<std::string> const& parameters,
-                       cmGeneratorExpressionContext* context,
+                       cm::GenEx::Evaluation* eval,
                        GeneratorExpressionContent const* content,
                        cmGeneratorExpressionDAGChecker*) const override
   {
     if (parameters[0] != "1" && parameters[0] != "0") {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "First parameter to $<IF> must resolve to exactly one '0' "
                   "or '1' value.");
       return std::string();
@@ -235,7 +235,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -250,15 +250,14 @@
   int NumExpectedParameters() const override { return 2; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     long numbers[2];
     for (int i = 0; i < 2; ++i) {
       if (!ParameterToLong(parameters[i].c_str(), &numbers[i])) {
-        reportError(context, content->GetOriginalExpression(),
+        reportError(eval, content->GetOriginalExpression(),
                     "$<EQUAL> parameter " + parameters[i] +
                       " is not a valid integer.");
         return {};
@@ -303,15 +302,14 @@
   int NumExpectedParameters() const override { return 2; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     cmList values;
     cmList checkValues;
     bool check = false;
-    switch (context->LG->GetPolicyStatus(cmPolicies::CMP0085)) {
+    switch (eval->Context.LG->GetPolicyStatus(cmPolicies::CMP0085)) {
       case cmPolicies::WARN:
         if (parameters.front().empty()) {
           check = true;
@@ -325,8 +323,8 @@
           e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0085)
             << "\nSearch Item:\n  \"" << parameters.front()
             << "\"\nList:\n  \"" << parameters[1] << "\"\n";
-          context->LG->GetCMakeInstance()->IssueMessage(
-            MessageType ::AUTHOR_WARNING, e.str(), context->Backtrace);
+          eval->Context.LG->GetCMakeInstance()->IssueMessage(
+            MessageType ::AUTHOR_WARNING, e.str(), eval->Backtrace);
           return "0";
         }
         if (values.empty()) {
@@ -349,20 +347,19 @@
   int NumExpectedParameters() const override { return 3; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     if (parameters.size() != 3) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<FILTER:...> expression requires three parameters");
       return {};
     }
 
     if (parameters[1] != "INCLUDE" && parameters[1] != "EXCLUDE") {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<FILTER:...> second parameter must be either INCLUDE or EXCLUDE");
       return {};
     }
@@ -374,7 +371,7 @@
                                            : cmList::FilterMode::INCLUDE)
         .to_string();
     } catch (std::invalid_argument&) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<FILTER:...> failed to compile regex");
       return {};
     }
@@ -388,14 +385,13 @@
   int NumExpectedParameters() const override { return 1; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     if (parameters.size() != 1) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<REMOVE_DUPLICATES:...> expression requires one parameter");
     }
 
@@ -413,13 +409,12 @@
   int NumExpectedParameters() const override { return 1; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     if (parameters.size() != 1) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<TARGET_EXISTS:...> expression requires one parameter");
       return std::string();
     }
@@ -427,13 +422,14 @@
     std::string const& targetName = parameters.front();
     if (targetName.empty() ||
         !cmGeneratorExpression::IsValidTargetName(targetName)) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<TARGET_EXISTS:tgt> expression requires a non-empty "
                   "valid target name.");
       return std::string();
     }
 
-    return context->LG->GetMakefile()->FindTargetToUse(targetName) ? "1" : "0";
+    return eval->Context.LG->GetMakefile()->FindTargetToUse(targetName) ? "1"
+                                                                        : "0";
   }
 } targetExistsNode;
 
@@ -444,13 +440,12 @@
   int NumExpectedParameters() const override { return 1; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     if (parameters.size() != 1) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<TARGET_NAME_IF_EXISTS:...> expression requires one "
                   "parameter");
       return std::string();
@@ -459,13 +454,13 @@
     std::string const& targetName = parameters.front();
     if (targetName.empty() ||
         !cmGeneratorExpression::IsValidTargetName(targetName)) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<TARGET_NAME_IF_EXISTS:tgt> expression requires a "
                   "non-empty valid target name.");
       return std::string();
     }
 
-    return context->LG->GetMakefile()->FindTargetToUse(targetName)
+    return eval->Context.LG->GetMakefile()->FindTargetToUse(targetName)
       ? targetName
       : std::string();
   }
@@ -478,24 +473,19 @@
 protected:
   std::string EvaluateExpression(
     std::string const& genexOperator, std::string const& expression,
-    cmGeneratorExpressionContext* context,
-    GeneratorExpressionContent const* content,
+    cm::GenEx::Evaluation* eval, GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagCheckerParent) const
   {
-    if (context->HeadTarget) {
+    if (eval->HeadTarget) {
       cmGeneratorExpressionDAGChecker dagChecker{
-        context->HeadTarget,
-        genexOperator + ":" + expression,
-        content,
-        dagCheckerParent,
-        context->LG,
-        context->Config,
-        context->Backtrace,
+        eval->HeadTarget, genexOperator + ":" + expression,
+        content,          dagCheckerParent,
+        eval->Context,    eval->Backtrace,
       };
       switch (dagChecker.Check()) {
         case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
         case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: {
-          dagChecker.ReportError(context, content->GetOriginalExpression());
+          dagChecker.ReportError(eval, content->GetOriginalExpression());
           return std::string();
         }
         case cmGeneratorExpressionDAGChecker::ALREADY_SEEN:
@@ -504,13 +494,12 @@
       }
 
       return this->EvaluateDependentExpression(
-        expression, context->LG, context, context->HeadTarget, &dagChecker,
-        context->CurrentTarget);
+        expression, eval, eval->HeadTarget, &dagChecker, eval->CurrentTarget);
     }
 
     return this->EvaluateDependentExpression(
-      expression, context->LG, context, context->HeadTarget, dagCheckerParent,
-      context->CurrentTarget);
+      expression, eval, eval->HeadTarget, dagCheckerParent,
+      eval->CurrentTarget);
   }
 };
 
@@ -523,26 +512,26 @@
   bool AcceptsArbitraryContentParameter() const override { return true; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagCheckerParent) const override
   {
     std::string const& targetName = parameters.front();
     if (targetName.empty() ||
         !cmGeneratorExpression::IsValidTargetName(targetName)) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<TARGET_GENEX_EVAL:tgt, ...> expression requires a "
                   "non-empty valid target name.");
       return std::string();
     }
 
-    auto const* target = context->LG->FindGeneratorTargetToUse(targetName);
+    auto const* target =
+      eval->Context.LG->FindGeneratorTargetToUse(targetName);
     if (!target) {
       std::ostringstream e;
       e << "$<TARGET_GENEX_EVAL:tgt, ...> target \"" << targetName
         << "\" not found.";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return std::string();
     }
 
@@ -552,12 +541,12 @@
     }
 
     // Replace the surrounding context with the named target.
-    cmGeneratorExpressionContext targetContext(
-      context->LG, context->Config, context->Quiet, target, target,
-      context->EvaluateForBuildsystem, context->Backtrace, context->Language);
+    cm::GenEx::Evaluation targetEval(eval->Context, eval->Quiet, target,
+                                     target, eval->EvaluateForBuildsystem,
+                                     eval->Backtrace);
 
     return this->EvaluateExpression("TARGET_GENEX_EVAL", expression,
-                                    &targetContext, content, dagCheckerParent);
+                                    &targetEval, content, dagCheckerParent);
   }
 } targetGenexEvalNode;
 
@@ -570,8 +559,7 @@
   bool AcceptsArbitraryContentParameter() const override { return true; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagCheckerParent) const override
   {
@@ -580,7 +568,7 @@
       return expression;
     }
 
-    return this->EvaluateExpression("GENEX_EVAL", expression, context, content,
+    return this->EvaluateExpression("GENEX_EVAL", expression, eval, content,
                                     dagCheckerParent);
   }
 } genexEvalNode;
@@ -593,7 +581,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -609,7 +597,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -658,7 +646,7 @@
 
 using Arguments = Range<std::vector<std::string>>;
 
-bool CheckGenExParameters(cmGeneratorExpressionContext* ctx,
+bool CheckGenExParameters(cm::GenEx::Evaluation* eval,
                           GeneratorExpressionContent const* cnt,
                           cm::string_view genex, cm::string_view option,
                           std::size_t count, int required = 1,
@@ -683,7 +671,7 @@
       default:
         nbParameters = cmStrCat(required, " parameters");
     }
-    reportError(ctx, cnt->GetOriginalExpression(),
+    reportError(eval, cnt->GetOriginalExpression(),
                 cmStrCat("$<", genex, ':', option, "> expression requires ",
                          (exactly ? "exactly" : "at least"), ' ', nbParameters,
                          '.'));
@@ -692,20 +680,20 @@
   return true;
 };
 
-bool CheckPathParametersEx(cmGeneratorExpressionContext* ctx,
+bool CheckPathParametersEx(cm::GenEx::Evaluation* eval,
                            GeneratorExpressionContent const* cnt,
                            cm::string_view option, std::size_t count,
                            int required = 1, bool exactly = true)
 {
-  return CheckGenExParameters(ctx, cnt, "PATH"_s, option, count, required,
+  return CheckGenExParameters(eval, cnt, "PATH"_s, option, count, required,
                               exactly);
 }
-bool CheckPathParameters(cmGeneratorExpressionContext* ctx,
+bool CheckPathParameters(cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* cnt,
                          cm::string_view option, Arguments const& args,
                          int required = 1)
 {
-  return CheckPathParametersEx(ctx, cnt, option, args.size(), required);
+  return CheckPathParametersEx(eval, cnt, option, args.size(), required);
 };
 
 std::string ToString(bool isTrue)
@@ -723,8 +711,7 @@
   bool AcceptsArbitraryContentParameter() const override { return true; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -738,15 +725,14 @@
 
     static std::unordered_map<
       cm::string_view,
-      std::function<std::string(cmGeneratorExpressionContext*,
+      std::function<std::string(cm::GenEx::Evaluation*,
                                 GeneratorExpressionContent const*,
                                 Arguments&)>>
       pathCommands{
         { "GET_ROOT_NAME"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "GET_ROOT_NAME"_s, args) &&
+            if (CheckPathParameters(ev, cnt, "GET_ROOT_NAME"_s, args) &&
                 !args.front().empty()) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.GetRootName().String();
@@ -755,10 +741,9 @@
             return std::string{};
           } },
         { "GET_ROOT_DIRECTORY"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "GET_ROOT_DIRECTORY"_s, args) &&
+            if (CheckPathParameters(ev, cnt, "GET_ROOT_DIRECTORY"_s, args) &&
                 !args.front().empty()) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.GetRootDirectory().String();
@@ -767,10 +752,9 @@
             return std::string{};
           } },
         { "GET_ROOT_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "GET_ROOT_PATH"_s, args) &&
+            if (CheckPathParameters(ev, cnt, "GET_ROOT_PATH"_s, args) &&
                 !args.front().empty()) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.GetRootPath().String();
@@ -779,10 +763,9 @@
             return std::string{};
           } },
         { "GET_FILENAME"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "GET_FILENAME"_s, args) &&
+            if (CheckPathParameters(ev, cnt, "GET_FILENAME"_s, args) &&
                 !args.front().empty()) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.GetFileName().String();
@@ -791,14 +774,13 @@
             return std::string{};
           } },
         { "GET_EXTENSION"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool lastOnly = args.front() == "LAST_ONLY"_s;
             if (lastOnly) {
               args.advance(1);
             }
-            if (CheckPathParametersEx(ctx, cnt,
+            if (CheckPathParametersEx(ev, cnt,
                                       lastOnly ? "GET_EXTENSION,LAST_ONLY"_s
                                                : "GET_EXTENSION"_s,
                                       args.size())) {
@@ -817,15 +799,14 @@
             return std::string{};
           } },
         { "GET_STEM"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool lastOnly = args.front() == "LAST_ONLY"_s;
             if (lastOnly) {
               args.advance(1);
             }
             if (CheckPathParametersEx(
-                  ctx, cnt, lastOnly ? "GET_STEM,LAST_ONLY"_s : "GET_STEM"_s,
+                  ev, cnt, lastOnly ? "GET_STEM,LAST_ONLY"_s : "GET_STEM"_s,
                   args.size())) {
               if (args.front().empty()) {
                 return std::string{};
@@ -842,10 +823,9 @@
             return std::string{};
           } },
         { "GET_RELATIVE_PART"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "GET_RELATIVE_PART"_s, args) &&
+            if (CheckPathParameters(ev, cnt, "GET_RELATIVE_PART"_s, args) &&
                 !args.front().empty()) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.GetRelativePath().String();
@@ -854,10 +834,9 @@
             return std::string{};
           } },
         { "GET_PARENT_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "GET_PARENT_PATH"_s, args)) {
+            if (CheckPathParameters(ev, cnt, "GET_PARENT_PATH"_s, args)) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.GetParentPath().String();
               });
@@ -865,98 +844,86 @@
             return std::string{};
           } },
         { "HAS_ROOT_NAME"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_ROOT_NAME"_s, args)
+            return CheckPathParameters(ev, cnt, "HAS_ROOT_NAME"_s, args)
               ? ToString(cmCMakePath{ args.front() }.HasRootName())
               : std::string{ "0" };
           } },
         { "HAS_ROOT_DIRECTORY"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_ROOT_DIRECTORY"_s, args)
+            return CheckPathParameters(ev, cnt, "HAS_ROOT_DIRECTORY"_s, args)
               ? ToString(cmCMakePath{ args.front() }.HasRootDirectory())
               : std::string{ "0" };
           } },
         { "HAS_ROOT_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_ROOT_PATH"_s, args)
+            return CheckPathParameters(ev, cnt, "HAS_ROOT_PATH"_s, args)
               ? ToString(cmCMakePath{ args.front() }.HasRootPath())
               : std::string{ "0" };
           } },
         { "HAS_FILENAME"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_FILENAME"_s, args)
+            return CheckPathParameters(ev, cnt, "HAS_FILENAME"_s, args)
               ? ToString(cmCMakePath{ args.front() }.HasFileName())
               : std::string{ "0" };
           } },
         { "HAS_EXTENSION"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_EXTENSION"_s, args) &&
+            return CheckPathParameters(ev, cnt, "HAS_EXTENSION"_s, args) &&
                 !args.front().empty()
               ? ToString(cmCMakePath{ args.front() }.HasExtension())
               : std::string{ "0" };
           } },
         { "HAS_STEM"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_STEM"_s, args)
+            return CheckPathParameters(ev, cnt, "HAS_STEM"_s, args)
               ? ToString(cmCMakePath{ args.front() }.HasStem())
               : std::string{ "0" };
           } },
         { "HAS_RELATIVE_PART"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_RELATIVE_PART"_s, args)
+            return CheckPathParameters(ev, cnt, "HAS_RELATIVE_PART"_s, args)
               ? ToString(cmCMakePath{ args.front() }.HasRelativePath())
               : std::string{ "0" };
           } },
         { "HAS_PARENT_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "HAS_PARENT_PATH"_s, args)
+            return CheckPathParameters(ev, cnt, "HAS_PARENT_PATH"_s, args)
               ? ToString(cmCMakePath{ args.front() }.HasParentPath())
               : std::string{ "0" };
           } },
         { "IS_ABSOLUTE"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "IS_ABSOLUTE"_s, args)
+            return CheckPathParameters(ev, cnt, "IS_ABSOLUTE"_s, args)
               ? ToString(cmCMakePath{ args.front() }.IsAbsolute())
               : std::string{ "0" };
           } },
         { "IS_RELATIVE"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            return CheckPathParameters(ctx, cnt, "IS_RELATIVE"_s, args)
+            return CheckPathParameters(ev, cnt, "IS_RELATIVE"_s, args)
               ? ToString(cmCMakePath{ args.front() }.IsRelative())
               : std::string{ "0" };
           } },
         { "IS_PREFIX"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool normalize = args.front() == "NORMALIZE"_s;
             if (normalize) {
               args.advance(1);
             }
-            if (CheckPathParametersEx(ctx, cnt,
-                                      normalize ? "IS_PREFIX,NORMALIZE"_s
-                                                : "IS_PREFIX"_s,
-                                      args.size(), 2)) {
+            if (CheckPathParametersEx(
+                  ev, cnt, normalize ? "IS_PREFIX,NORMALIZE"_s : "IS_PREFIX"_s,
+                  args.size(), 2)) {
               if (normalize) {
                 return ToString(cmCMakePath{ args[0] }.Normal().IsPrefix(
                   cmCMakePath{ args[1] }.Normal()));
@@ -967,14 +934,13 @@
             return std::string{};
           } },
         { "CMAKE_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool normalize = args.front() == "NORMALIZE"_s;
             if (normalize) {
               args.advance(1);
             }
-            if (CheckPathParametersEx(ctx, cnt,
+            if (CheckPathParametersEx(ev, cnt,
                                       normalize ? "CMAKE_PATH,NORMALIZE"_s
                                                 : "CMAKE_PATH"_s,
                                       args.size(), 1)) {
@@ -988,14 +954,13 @@
             return std::string{};
           } },
         { "NATIVE_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool normalize = args.front() == "NORMALIZE"_s;
             if (normalize) {
               args.advance(1);
             }
-            if (CheckPathParametersEx(ctx, cnt,
+            if (CheckPathParametersEx(ev, cnt,
                                       normalize ? "NATIVE_PATH,NORMALIZE"_s
                                                 : "NATIVE_PATH"_s,
                                       args.size(), 1)) {
@@ -1009,10 +974,9 @@
             return std::string{};
           } },
         { "APPEND"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParametersEx(ctx, cnt, "APPEND"_s, args.size(), 1,
+            if (CheckPathParametersEx(ev, cnt, "APPEND"_s, args.size(), 1,
                                       false)) {
               auto const& list = args.front();
               args.advance(1);
@@ -1028,10 +992,9 @@
             return std::string{};
           } },
         { "REMOVE_FILENAME"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "REMOVE_FILENAME"_s, args) &&
+            if (CheckPathParameters(ev, cnt, "REMOVE_FILENAME"_s, args) &&
                 !args.front().empty()) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.RemoveFileName().String();
@@ -1040,10 +1003,9 @@
             return std::string{};
           } },
         { "REPLACE_FILENAME"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "REPLACE_FILENAME"_s, args, 2)) {
+            if (CheckPathParameters(ev, cnt, "REPLACE_FILENAME"_s, args, 2)) {
               return processList(args.front(), [&args](std::string& value) {
                 value = cmCMakePath{ value }
                           .ReplaceFileName(cmCMakePath{ args[1] })
@@ -1053,14 +1015,13 @@
             return std::string{};
           } },
         { "REMOVE_EXTENSION"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool lastOnly = args.front() == "LAST_ONLY"_s;
             if (lastOnly) {
               args.advance(1);
             }
-            if (CheckPathParametersEx(ctx, cnt,
+            if (CheckPathParametersEx(ev, cnt,
                                       lastOnly ? "REMOVE_EXTENSION,LAST_ONLY"_s
                                                : "REMOVE_EXTENSION"_s,
                                       args.size())) {
@@ -1079,14 +1040,13 @@
             return std::string{};
           } },
         { "REPLACE_EXTENSION"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool lastOnly = args.front() == "LAST_ONLY"_s;
             if (lastOnly) {
               args.advance(1);
             }
-            if (CheckPathParametersEx(ctx, cnt,
+            if (CheckPathParametersEx(ev, cnt,
                                       lastOnly
                                         ? "REPLACE_EXTENSION,LAST_ONLY"_s
                                         : "REPLACE_EXTENSION"_s,
@@ -1107,10 +1067,9 @@
             return std::string{};
           } },
         { "NORMAL_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "NORMAL_PATH"_s, args) &&
+            if (CheckPathParameters(ev, cnt, "NORMAL_PATH"_s, args) &&
                 !args.front().empty()) {
               return processList(args.front(), [](std::string& value) {
                 value = cmCMakePath{ value }.Normal().String();
@@ -1119,10 +1078,9 @@
             return std::string{};
           } },
         { "RELATIVE_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckPathParameters(ctx, cnt, "RELATIVE_PATH"_s, args, 2)) {
+            if (CheckPathParameters(ev, cnt, "RELATIVE_PATH"_s, args, 2)) {
               return processList(args.front(), [&args](std::string& value) {
                 value = cmCMakePath{ value }.Relative(args[1]).String();
               });
@@ -1130,14 +1088,13 @@
             return std::string{};
           } },
         { "ABSOLUTE_PATH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
             bool normalize = args.front() == "NORMALIZE"_s;
             if (normalize) {
               args.advance(1);
             }
-            if (CheckPathParametersEx(ctx, cnt,
+            if (CheckPathParametersEx(ev, cnt,
                                       normalize ? "ABSOLUTE_PATH,NORMALIZE"_s
                                                 : "ABSOLUTE_PATH"_s,
                                       args.size(), 2)) {
@@ -1153,10 +1110,10 @@
 
     if (cm::contains(pathCommands, parameters.front())) {
       auto args = Arguments{ parameters }.advance(1);
-      return pathCommands[parameters.front()](context, content, args);
+      return pathCommands[parameters.front()](eval, content, args);
     }
 
-    reportError(context, content->GetOriginalExpression(),
+    reportError(eval, content->GetOriginalExpression(),
                 cmStrCat(parameters.front(), ": invalid option."));
     return std::string{};
   }
@@ -1170,7 +1127,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -1180,20 +1137,20 @@
 } pathEqualNode;
 
 namespace {
-inline bool CheckListParametersEx(cmGeneratorExpressionContext* ctx,
+inline bool CheckListParametersEx(cm::GenEx::Evaluation* eval,
                                   GeneratorExpressionContent const* cnt,
                                   cm::string_view option, std::size_t count,
                                   int required = 1, bool exactly = true)
 {
-  return CheckGenExParameters(ctx, cnt, "LIST"_s, option, count, required,
+  return CheckGenExParameters(eval, cnt, "LIST"_s, option, count, required,
                               exactly);
 }
-inline bool CheckListParameters(cmGeneratorExpressionContext* ctx,
+inline bool CheckListParameters(cm::GenEx::Evaluation* eval,
                                 GeneratorExpressionContent const* cnt,
                                 cm::string_view option, Arguments const& args,
                                 int required = 1)
 {
-  return CheckListParametersEx(ctx, cnt, option, args.size(), required);
+  return CheckListParametersEx(eval, cnt, option, args.size(), required);
 };
 
 inline cmList GetList(std::string const& list)
@@ -1224,7 +1181,7 @@
 }
 
 bool GetNumericArguments(
-  cmGeneratorExpressionContext* ctx, GeneratorExpressionContent const* cnt,
+  cm::GenEx::Evaluation* eval, GeneratorExpressionContent const* cnt,
   Arguments const& args, std::vector<cmList::index_type>& indexes,
   cmList::ExpandElements expandElements = cmList::ExpandElements::No)
 {
@@ -1239,7 +1196,7 @@
   for (auto const& value : arguments) {
     cmList::index_type index;
     if (!GetNumericArgument(value, index)) {
-      reportError(ctx, cnt->GetOriginalExpression(),
+      reportError(eval, cnt->GetOriginalExpression(),
                   cmStrCat("index: \"", value, "\" is not a valid index"));
       return false;
     }
@@ -1258,41 +1215,38 @@
   bool AcceptsArbitraryContentParameter() const override { return true; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     static std::unordered_map<
       cm::string_view,
-      std::function<std::string(cmGeneratorExpressionContext*,
+      std::function<std::string(cm::GenEx::Evaluation*,
                                 GeneratorExpressionContent const*,
                                 Arguments&)>>
       listCommands{
         { "LENGTH"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "LENGTH"_s, args)) {
+            if (CheckListParameters(ev, cnt, "LENGTH"_s, args)) {
               return std::to_string(GetList(args.front()).size());
             }
             return std::string{};
           } },
         { "GET"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "GET"_s, args.size(), 2,
+            if (CheckListParametersEx(ev, cnt, "GET"_s, args.size(), 2,
                                       false)) {
               auto list = GetList(args.front());
               if (list.empty()) {
-                reportError(ctx, cnt->GetOriginalExpression(),
+                reportError(ev, cnt->GetOriginalExpression(),
                             "given empty list");
                 return std::string{};
               }
 
               std::vector<cmList::index_type> indexes;
-              if (!GetNumericArguments(ctx, cnt, args.advance(1), indexes,
+              if (!GetNumericArguments(ev, cnt, args.advance(1), indexes,
                                        cmList::ExpandElements::Yes)) {
                 return std::string{};
               }
@@ -1300,41 +1254,39 @@
                 return list.get_items(indexes.begin(), indexes.end())
                   .to_string();
               } catch (std::out_of_range& e) {
-                reportError(ctx, cnt->GetOriginalExpression(), e.what());
+                reportError(ev, cnt->GetOriginalExpression(), e.what());
                 return std::string{};
               }
             }
             return std::string{};
           } },
         { "JOIN"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "JOIN"_s, args, 2)) {
+            if (CheckListParameters(ev, cnt, "JOIN"_s, args, 2)) {
               return GetList(args.front()).join(args[1]);
             }
             return std::string{};
           } },
         { "SUBLIST"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "SUBLIST"_s, args, 3)) {
+            if (CheckListParameters(ev, cnt, "SUBLIST"_s, args, 3)) {
               auto list = GetList(args.front());
               if (!list.empty()) {
                 std::vector<cmList::index_type> indexes;
-                if (!GetNumericArguments(ctx, cnt, args.advance(1), indexes)) {
+                if (!GetNumericArguments(ev, cnt, args.advance(1), indexes)) {
                   return std::string{};
                 }
                 if (indexes[0] < 0) {
-                  reportError(ctx, cnt->GetOriginalExpression(),
+                  reportError(ev, cnt->GetOriginalExpression(),
                               cmStrCat("begin index: ", indexes[0],
                                        " is out of range 0 - ",
                                        list.size() - 1));
                   return std::string{};
                 }
                 if (indexes[1] < -1) {
-                  reportError(ctx, cnt->GetOriginalExpression(),
+                  reportError(ev, cnt->GetOriginalExpression(),
                               cmStrCat("length: ", indexes[1],
                                        " should be -1 or greater"));
                   return std::string{};
@@ -1345,7 +1297,7 @@
                              static_cast<cmList::size_type>(indexes[1]))
                     .to_string();
                 } catch (std::out_of_range& e) {
-                  reportError(ctx, cnt->GetOriginalExpression(), e.what());
+                  reportError(ev, cnt->GetOriginalExpression(), e.what());
                   return std::string{};
                 }
               }
@@ -1353,10 +1305,9 @@
             return std::string{};
           } },
         { "FIND"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "FIND"_s, args, 2)) {
+            if (CheckListParameters(ev, cnt, "FIND"_s, args, 2)) {
               auto list = GetList(args.front());
               auto index = list.find(args[1]);
               return index == cmList::npos ? "-1" : std::to_string(index);
@@ -1364,10 +1315,9 @@
             return std::string{};
           } },
         { "APPEND"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "APPEND"_s, args.size(), 2,
+            if (CheckListParametersEx(ev, cnt, "APPEND"_s, args.size(), 2,
                                       false)) {
               auto list = args.front();
               args.advance(1);
@@ -1376,10 +1326,9 @@
             return std::string{};
           } },
         { "PREPEND"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "PREPEND"_s, args.size(), 2,
+            if (CheckListParametersEx(ev, cnt, "PREPEND"_s, args.size(), 2,
                                       false)) {
               auto list = args.front();
               args.advance(1);
@@ -1388,15 +1337,14 @@
             return std::string{};
           } },
         { "INSERT"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "INSERT"_s, args.size(), 3,
+            if (CheckListParametersEx(ev, cnt, "INSERT"_s, args.size(), 3,
                                       false)) {
               cmList::index_type index;
               if (!GetNumericArgument(args[1], index)) {
                 reportError(
-                  ctx, cnt->GetOriginalExpression(),
+                  ev, cnt->GetOriginalExpression(),
                   cmStrCat("index: \"", args[1], "\" is not a valid index"));
                 return std::string{};
               }
@@ -1408,17 +1356,16 @@
                                   cmList::EmptyElements::Yes);
                 return list.to_string();
               } catch (std::out_of_range& e) {
-                reportError(ctx, cnt->GetOriginalExpression(), e.what());
+                reportError(ev, cnt->GetOriginalExpression(), e.what());
                 return std::string{};
               }
             }
             return std::string{};
           } },
         { "POP_BACK"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "POP_BACK"_s, args)) {
+            if (CheckListParameters(ev, cnt, "POP_BACK"_s, args)) {
               auto list = GetList(args.front());
               if (!list.empty()) {
                 list.pop_back();
@@ -1428,10 +1375,9 @@
             return std::string{};
           } },
         { "POP_FRONT"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "POP_FRONT"_s, args)) {
+            if (CheckListParameters(ev, cnt, "POP_FRONT"_s, args)) {
               auto list = GetList(args.front());
               if (!list.empty()) {
                 list.pop_front();
@@ -1441,20 +1387,18 @@
             return std::string{};
           } },
         { "REMOVE_DUPLICATES"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "REMOVE_DUPLICATES"_s, args)) {
+            if (CheckListParameters(ev, cnt, "REMOVE_DUPLICATES"_s, args)) {
               return GetList(args.front()).remove_duplicates().to_string();
             }
             return std::string{};
           } },
         { "REMOVE_ITEM"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "REMOVE_ITEM"_s, args.size(),
-                                      2, false)) {
+            if (CheckListParametersEx(ev, cnt, "REMOVE_ITEM"_s, args.size(), 2,
+                                      false)) {
               auto list = GetList(args.front());
               args.advance(1);
               cmList items{ args.begin(), args.end(),
@@ -1464,14 +1408,13 @@
             return std::string{};
           } },
         { "REMOVE_AT"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "REMOVE_AT"_s, args.size(), 2,
+            if (CheckListParametersEx(ev, cnt, "REMOVE_AT"_s, args.size(), 2,
                                       false)) {
               auto list = GetList(args.front());
               std::vector<cmList::index_type> indexes;
-              if (!GetNumericArguments(ctx, cnt, args.advance(1), indexes,
+              if (!GetNumericArguments(ev, cnt, args.advance(1), indexes,
                                        cmList::ExpandElements::Yes)) {
                 return std::string{};
               }
@@ -1479,21 +1422,20 @@
                 return list.remove_items(indexes.begin(), indexes.end())
                   .to_string();
               } catch (std::out_of_range& e) {
-                reportError(ctx, cnt->GetOriginalExpression(), e.what());
+                reportError(ev, cnt->GetOriginalExpression(), e.what());
                 return std::string{};
               }
             }
             return std::string{};
           } },
         { "FILTER"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "FILTER"_s, args, 3)) {
+            if (CheckListParameters(ev, cnt, "FILTER"_s, args, 3)) {
               auto const& op = args[1];
               if (op != "INCLUDE"_s && op != "EXCLUDE"_s) {
                 reportError(
-                  ctx, cnt->GetOriginalExpression(),
+                  ev, cnt->GetOriginalExpression(),
                   cmStrCat("sub-command FILTER does not recognize operator \"",
                            op, "\". It must be either INCLUDE or EXCLUDE."));
                 return std::string{};
@@ -1506,7 +1448,7 @@
                   .to_string();
               } catch (std::invalid_argument&) {
                 reportError(
-                  ctx, cnt->GetOriginalExpression(),
+                  ev, cnt->GetOriginalExpression(),
                   cmStrCat("sub-command FILTER, failed to compile regex \"",
                            args[2], "\"."));
                 return std::string{};
@@ -1515,10 +1457,9 @@
             return std::string{};
           } },
         { "TRANSFORM"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "TRANSFORM"_s, args.size(), 2,
+            if (CheckListParametersEx(ev, cnt, "TRANSFORM"_s, args.size(), 2,
                                       false)) {
               auto list = GetList(args.front());
               if (!list.empty()) {
@@ -1560,7 +1501,7 @@
 
                 auto descriptor = descriptors.find(args.advance(1).front());
                 if (descriptor == descriptors.end()) {
-                  reportError(ctx, cnt->GetOriginalExpression(),
+                  reportError(ev, cnt->GetOriginalExpression(),
                               cmStrCat(" sub-command TRANSFORM, ",
                                        args.front(), " invalid action."));
                   return std::string{};
@@ -1569,7 +1510,7 @@
                 // Action arguments
                 args.advance(1);
                 if (args.size() < descriptor->Arity) {
-                  reportError(ctx, cnt->GetOriginalExpression(),
+                  reportError(ev, cnt->GetOriginalExpression(),
                               cmStrCat("sub-command TRANSFORM, action ",
                                        descriptor->Name, " expects ",
                                        descriptor->Arity, " argument(s)."));
@@ -1593,7 +1534,7 @@
                     if ((args.front() == REGEX || args.front() == AT ||
                          args.front() == FOR) &&
                         selector) {
-                      reportError(ctx, cnt->GetOriginalExpression(),
+                      reportError(ev, cnt->GetOriginalExpression(),
                                   cmStrCat("sub-command TRANSFORM, selector "
                                            "already specified (",
                                            selector->GetTag(), ")."));
@@ -1605,7 +1546,7 @@
                     if (args.front() == REGEX) {
                       if (args.advance(1).empty()) {
                         reportError(
-                          ctx, cnt->GetOriginalExpression(),
+                          ev, cnt->GetOriginalExpression(),
                           "sub-command TRANSFORM, selector REGEX expects "
                           "'regular expression' argument.");
                         return std::string{};
@@ -1631,7 +1572,7 @@
                           if (!GetNumericArgument(index, value)) {
                             // this is not a number, stop processing
                             reportError(
-                              ctx, cnt->GetOriginalExpression(),
+                              ev, cnt->GetOriginalExpression(),
                               cmStrCat("sub-command TRANSFORM, selector AT: '",
                                        index, "': unexpected argument."));
                             return std::string{};
@@ -1642,7 +1583,7 @@
                       }
 
                       if (indexes.empty()) {
-                        reportError(ctx, cnt->GetOriginalExpression(),
+                        reportError(ev, cnt->GetOriginalExpression(),
                                     "sub-command TRANSFORM, selector AT "
                                     "expects at least one "
                                     "numeric value.");
@@ -1658,7 +1599,7 @@
                     // FOR selector
                     if (args.front() == FOR) {
                       if (args.advance(1).size() < 2) {
-                        reportError(ctx, cnt->GetOriginalExpression(),
+                        reportError(ev, cnt->GetOriginalExpression(),
                                     "sub-command TRANSFORM, selector FOR "
                                     "expects, at least,"
                                     " two arguments.");
@@ -1677,7 +1618,7 @@
 
                       if (!valid) {
                         reportError(
-                          ctx, cnt->GetOriginalExpression(),
+                          ev, cnt->GetOriginalExpression(),
                           "sub-command TRANSFORM, selector FOR expects, "
                           "at least, two numeric values.");
                         return std::string{};
@@ -1693,7 +1634,7 @@
 
                       if (step <= 0) {
                         reportError(
-                          ctx, cnt->GetOriginalExpression(),
+                          ev, cnt->GetOriginalExpression(),
                           "sub-command TRANSFORM, selector FOR expects "
                           "positive numeric value for <step>.");
                         return std::string{};
@@ -1704,19 +1645,24 @@
                       continue;
                     }
 
-                    reportError(ctx, cnt->GetOriginalExpression(),
+                    reportError(ev, cnt->GetOriginalExpression(),
                                 cmStrCat("sub-command TRANSFORM, '",
                                          cmJoin(args, ", "),
                                          "': unexpected argument(s)."));
                     return std::string{};
                   }
 
+                  if (!selector) {
+                    selector = cmList::TransformSelector::New();
+                  }
+                  selector->Makefile = ev->Context.LG->GetMakefile();
+
                   return list
                     .transform(descriptor->Action, arguments,
                                std::move(selector))
                     .to_string();
                 } catch (cmList::transform_error& e) {
-                  reportError(ctx, cnt->GetOriginalExpression(), e.what());
+                  reportError(ev, cnt->GetOriginalExpression(), e.what());
                   return std::string{};
                 }
               }
@@ -1724,19 +1670,17 @@
             return std::string{};
           } },
         { "REVERSE"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParameters(ctx, cnt, "REVERSE"_s, args)) {
+            if (CheckListParameters(ev, cnt, "REVERSE"_s, args)) {
               return GetList(args.front()).reverse().to_string();
             }
             return std::string{};
           } },
         { "SORT"_s,
-          [](cmGeneratorExpressionContext* ctx,
-             GeneratorExpressionContent const* cnt,
+          [](cm::GenEx::Evaluation* ev, GeneratorExpressionContent const* cnt,
              Arguments& args) -> std::string {
-            if (CheckListParametersEx(ctx, cnt, "SORT"_s, args.size(), 1,
+            if (CheckListParametersEx(ev, cnt, "SORT"_s, args.size(), 1,
                                       false)) {
               auto list = GetList(args.front());
               args.advance(1);
@@ -1749,7 +1693,7 @@
                 if (cmHasPrefix(arg, COMPARE)) {
                   if (sortConfig.Compare !=
                       SortConfig::CompareMethod::DEFAULT) {
-                    reportError(ctx, cnt->GetOriginalExpression(),
+                    reportError(ev, cnt->GetOriginalExpression(),
                                 "sub-command SORT, COMPARE option has been "
                                 "specified multiple times.");
                     return std::string{};
@@ -1770,7 +1714,7 @@
                     continue;
                   }
                   reportError(
-                    ctx, cnt->GetOriginalExpression(),
+                    ev, cnt->GetOriginalExpression(),
                     cmStrCat(
                       "sub-command SORT, an invalid COMPARE option has been "
                       "specified: \"",
@@ -1780,7 +1724,7 @@
                 if (cmHasPrefix(arg, CASE)) {
                   if (sortConfig.Case !=
                       SortConfig::CaseSensitivity::DEFAULT) {
-                    reportError(ctx, cnt->GetOriginalExpression(),
+                    reportError(ev, cnt->GetOriginalExpression(),
                                 "sub-command SORT, CASE option has been "
                                 "specified multiple times.");
                     return std::string{};
@@ -1795,7 +1739,7 @@
                     continue;
                   }
                   reportError(
-                    ctx, cnt->GetOriginalExpression(),
+                    ev, cnt->GetOriginalExpression(),
                     cmStrCat(
                       "sub-command SORT, an invalid CASE option has been "
                       "specified: \"",
@@ -1804,7 +1748,7 @@
                 }
                 if (cmHasPrefix(arg, ORDER)) {
                   if (sortConfig.Order != SortConfig::OrderMode::DEFAULT) {
-                    reportError(ctx, cnt->GetOriginalExpression(),
+                    reportError(ev, cnt->GetOriginalExpression(),
                                 "sub-command SORT, ORDER option has been "
                                 "specified multiple times.");
                     return std::string{};
@@ -1820,14 +1764,14 @@
                     continue;
                   }
                   reportError(
-                    ctx, cnt->GetOriginalExpression(),
+                    ev, cnt->GetOriginalExpression(),
                     cmStrCat(
                       "sub-command SORT, an invalid ORDER option has been "
                       "specified: \"",
                       option, "\"."));
                   return std::string{};
                 }
-                reportError(ctx, cnt->GetOriginalExpression(),
+                reportError(ev, cnt->GetOriginalExpression(),
                             cmStrCat("sub-command SORT, option \"", arg,
                                      "\" is invalid."));
                 return std::string{};
@@ -1841,10 +1785,10 @@
 
     if (cm::contains(listCommands, parameters.front())) {
       auto args = Arguments{ parameters }.advance(1);
-      return listCommands[parameters.front()](context, content, args);
+      return listCommands[parameters.front()](eval, content, args);
     }
 
-    reportError(context, content->GetOriginalExpression(),
+    reportError(eval, content->GetOriginalExpression(),
                 cmStrCat(parameters.front(), ": invalid option."));
     return std::string{};
   }
@@ -1858,7 +1802,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -1875,7 +1819,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& /*parameters*/,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -1897,32 +1841,31 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget) {
+    if (!eval->HeadTarget) {
       std::ostringstream e;
       e << "$<" << this->CompilerLanguage
         << "_COMPILER_ID> may only be used with binary targets.  It may "
            "not be used with add_custom_command or add_custom_target.";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return {};
     }
-    return this->EvaluateWithLanguage(parameters, context, content, dagChecker,
+    return this->EvaluateWithLanguage(parameters, eval, content, dagChecker,
                                       this->CompilerLanguage);
   }
 
   std::string EvaluateWithLanguage(std::vector<std::string> const& parameters,
-                                   cmGeneratorExpressionContext* context,
+                                   cm::GenEx::Evaluation* eval,
                                    GeneratorExpressionContent const* content,
                                    cmGeneratorExpressionDAGChecker* /*unused*/,
                                    std::string const& lang) const
   {
     std::string const& compilerId =
-      context->LG->GetMakefile()->GetSafeDefinition("CMAKE_" + lang +
-                                                    "_COMPILER_ID");
+      eval->Context.LG->GetMakefile()->GetSafeDefinition("CMAKE_" + lang +
+                                                         "_COMPILER_ID");
     if (parameters.empty()) {
       return compilerId;
     }
@@ -1933,7 +1876,7 @@
 
     for (auto const& param : parameters) {
       if (!compilerIdValidator.find(param)) {
-        reportError(context, content->GetOriginalExpression(),
+        reportError(eval, content->GetOriginalExpression(),
                     "Expression syntax not recognized.");
         return std::string();
       }
@@ -1963,39 +1906,38 @@
   int NumExpectedParameters() const override { return OneOrZeroParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget) {
+    if (!eval->HeadTarget) {
       std::ostringstream e;
       e << "$<" << this->CompilerLanguage
         << "_COMPILER_VERSION> may only be used with binary targets.  It "
            "may not be used with add_custom_command or add_custom_target.";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return {};
     }
-    return this->EvaluateWithLanguage(parameters, context, content, dagChecker,
+    return this->EvaluateWithLanguage(parameters, eval, content, dagChecker,
                                       this->CompilerLanguage);
   }
 
   std::string EvaluateWithLanguage(std::vector<std::string> const& parameters,
-                                   cmGeneratorExpressionContext* context,
+                                   cm::GenEx::Evaluation* eval,
                                    GeneratorExpressionContent const* content,
                                    cmGeneratorExpressionDAGChecker* /*unused*/,
                                    std::string const& lang) const
   {
     std::string const& compilerVersion =
-      context->LG->GetMakefile()->GetSafeDefinition("CMAKE_" + lang +
-                                                    "_COMPILER_VERSION");
+      eval->Context.LG->GetMakefile()->GetSafeDefinition("CMAKE_" + lang +
+                                                         "_COMPILER_VERSION");
     if (parameters.empty()) {
       return compilerVersion;
     }
 
     static cmsys::RegularExpression compilerIdValidator("^[0-9\\.]*$");
     if (!compilerIdValidator.find(parameters.front())) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "Expression syntax not recognized.");
       return {};
     }
@@ -2028,31 +1970,30 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget) {
+    if (!eval->HeadTarget) {
       std::ostringstream e;
       e << "$<" << this->CompilerLanguage
         << "_COMPILER_FRONTEND_VARIANT> may only be used with binary targets. "
            " It may not be used with add_custom_command or add_custom_target.";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return {};
     }
-    return this->EvaluateWithLanguage(parameters, context, content, dagChecker,
+    return this->EvaluateWithLanguage(parameters, eval, content, dagChecker,
                                       this->CompilerLanguage);
   }
 
   std::string EvaluateWithLanguage(std::vector<std::string> const& parameters,
-                                   cmGeneratorExpressionContext* context,
+                                   cm::GenEx::Evaluation* eval,
                                    GeneratorExpressionContent const* content,
                                    cmGeneratorExpressionDAGChecker* /*unused*/,
                                    std::string const& lang) const
   {
     std::string const& compilerFrontendVariant =
-      context->LG->GetMakefile()->GetSafeDefinition(
+      eval->Context.LG->GetMakefile()->GetSafeDefinition(
         "CMAKE_" + lang + "_COMPILER_FRONTEND_VARIANT");
     if (parameters.empty()) {
       return compilerFrontendVariant;
@@ -2065,7 +2006,7 @@
 
     for (auto const& param : parameters) {
       if (!compilerFrontendVariantValidator.find(param)) {
-        reportError(context, content->GetOriginalExpression(),
+        reportError(eval, content->GetOriginalExpression(),
                     "Expression syntax not recognized.");
         return {};
       }
@@ -2095,13 +2036,12 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     std::string const& platformId =
-      context->LG->GetMakefile()->GetSafeDefinition("CMAKE_SYSTEM_NAME");
+      eval->Context.LG->GetMakefile()->GetSafeDefinition("CMAKE_SYSTEM_NAME");
     if (parameters.empty()) {
       return platformId;
     }
@@ -2129,7 +2069,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -2150,13 +2090,12 @@
   CompileOnlyNode() {} // NOLINT(modernize-use-equals-default)
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     if (!dagChecker) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<COMPILE_ONLY:...> may only be used for linking");
       return std::string();
     }
@@ -2172,13 +2111,12 @@
   LinkOnlyNode() {} // NOLINT(modernize-use-equals-default)
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     if (!dagChecker) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<LINK_ONLY:...> may only be used for linking");
       return std::string();
     }
@@ -2197,12 +2135,11 @@
 
   std::string Evaluate(
     std::vector<std::string> const& /*parameters*/,
-    cmGeneratorExpressionContext* context,
-    GeneratorExpressionContent const* /*content*/,
+    cm::GenEx::Evaluation* eval, GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
-    context->HadContextSensitiveCondition = true;
-    return context->Config;
+    eval->HadContextSensitiveCondition = true;
+    return eval->Context.Config;
   }
 } configurationNode;
 
@@ -2213,24 +2150,23 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     if (parameters.empty()) {
-      return configurationNode.Evaluate(parameters, context, content, nullptr);
+      return configurationNode.Evaluate(parameters, eval, content, nullptr);
     }
     static cmsys::RegularExpression configValidator("^[A-Za-z0-9_]*$");
     if (!configValidator.find(parameters.front())) {
     }
 
-    context->HadContextSensitiveCondition = true;
+    eval->HadContextSensitiveCondition = true;
     bool firstParam = true;
     for (auto const& param : parameters) {
       if (!configValidator.find(param)) {
         if (firstParam) {
-          reportError(context, content->GetOriginalExpression(),
+          reportError(eval, content->GetOriginalExpression(),
                       "Expression syntax not recognized.");
           return std::string();
         }
@@ -2242,34 +2178,35 @@
           << "  " << content->GetOriginalExpression() << "\n"
           << "The config name of \"" << param << "\" is invalid";
         /* clang-format on */
-        context->LG->GetCMakeInstance()->IssueMessage(
-          MessageType::WARNING, e.str(), context->Backtrace);
+        eval->Context.LG->GetCMakeInstance()->IssueMessage(
+          MessageType::WARNING, e.str(), eval->Backtrace);
       }
 
       firstParam = false;
-      if (context->Config.empty()) {
+      if (eval->Context.Config.empty()) {
         if (param.empty()) {
           return "1";
         }
       } else if (cmsysString_strcasecmp(param.c_str(),
-                                        context->Config.c_str()) == 0) {
+                                        eval->Context.Config.c_str()) == 0) {
         return "1";
       }
     }
 
-    if (context->CurrentTarget && context->CurrentTarget->IsImported()) {
+    if (eval->CurrentTarget && eval->CurrentTarget->IsImported()) {
       cmValue loc = nullptr;
       cmValue imp = nullptr;
       std::string suffix;
-      if (context->CurrentTarget->Target->GetMappedConfig(context->Config, loc,
-                                                          imp, suffix)) {
+      if (eval->CurrentTarget->Target->GetMappedConfig(eval->Context.Config,
+                                                       loc, imp, suffix)) {
         // This imported target has an appropriate location
         // for this (possibly mapped) config.
         // Check if there is a proper config mapping for the tested config.
         cmList mappedConfigs;
-        std::string mapProp = cmStrCat(
-          "MAP_IMPORTED_CONFIG_", cmSystemTools::UpperCase(context->Config));
-        if (cmValue mapValue = context->CurrentTarget->GetProperty(mapProp)) {
+        std::string mapProp =
+          cmStrCat("MAP_IMPORTED_CONFIG_",
+                   cmSystemTools::UpperCase(eval->Context.Config));
+        if (cmValue mapValue = eval->CurrentTarget->GetProperty(mapProp)) {
           mappedConfigs.assign(cmSystemTools::UpperCase(*mapValue));
 
           for (auto const& param : parameters) {
@@ -2302,7 +2239,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -2317,22 +2254,21 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (context->Language.empty() &&
+    if (eval->Context.Language.empty() &&
         (!dagChecker || !dagChecker->EvaluatingCompileExpression())) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<COMPILE_LANGUAGE:...> may only be used to specify include "
         "directories, compile definitions, compile options, and to evaluate "
         "components of the file(GENERATE) command.");
       return std::string();
     }
 
-    cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+    cmGlobalGenerator const* gg = eval->Context.LG->GetGlobalGenerator();
     std::string genName = gg->GetName();
     if (genName.find("Makefiles") == std::string::npos &&
         genName.find("Ninja") == std::string::npos &&
@@ -2340,16 +2276,16 @@
         genName.find("Xcode") == std::string::npos &&
         genName.find("Watcom WMake") == std::string::npos &&
         genName.find("Green Hills MULTI") == std::string::npos) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<COMPILE_LANGUAGE:...> not supported for this generator.");
       return std::string();
     }
     if (parameters.empty()) {
-      return context->Language;
+      return eval->Context.Language;
     }
 
     for (auto const& param : parameters) {
-      if (context->Language == param) {
+      if (eval->Context.Language == param) {
         return "1";
       }
     }
@@ -2364,17 +2300,16 @@
   int NumExpectedParameters() const override { return TwoOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget ||
-        (context->Language.empty() &&
+    if (!eval->HeadTarget ||
+        (eval->Context.Language.empty() &&
          (!dagChecker || !dagChecker->EvaluatingCompileExpression()))) {
-      // reportError(context, content->GetOriginalExpression(), "");
+      // reportError(eval, content->GetOriginalExpression(), "");
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<COMPILE_LANG_AND_ID:lang,id> may only be used with binary "
         "targets "
         "to specify include directories, compile definitions, and compile "
@@ -2382,7 +2317,7 @@
         "add_custom_target, or file(GENERATE) commands.");
       return std::string();
     }
-    cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+    cmGlobalGenerator const* gg = eval->Context.LG->GetGlobalGenerator();
     std::string genName = gg->GetName();
     if (genName.find("Makefiles") == std::string::npos &&
         genName.find("Ninja") == std::string::npos &&
@@ -2391,17 +2326,17 @@
         genName.find("Watcom WMake") == std::string::npos &&
         genName.find("Green Hills MULTI") == std::string::npos) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<COMPILE_LANG_AND_ID:lang,id> not supported for this generator.");
       return std::string();
     }
 
-    std::string const& lang = context->Language;
+    std::string const& lang = eval->Context.Language;
     if (lang == parameters.front()) {
       std::vector<std::string> idParameter((parameters.cbegin() + 1),
                                            parameters.cend());
       return CompilerIdNode{ lang.c_str() }.EvaluateWithLanguage(
-        idParameter, context, content, dagChecker, lang);
+        idParameter, eval, content, dagChecker, lang);
     }
     return "0";
   }
@@ -2414,16 +2349,15 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget || !dagChecker ||
+    if (!eval->HeadTarget || !dagChecker ||
         !(dagChecker->EvaluatingLinkExpression() ||
           dagChecker->EvaluatingLinkLibraries() ||
           dagChecker->EvaluatingLinkerLauncher())) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<LINK_LANGUAGE:...> may only be used with binary targets "
                   "to specify link libraries, link directories, link options "
                   "and link depends.");
@@ -2431,12 +2365,12 @@
     }
     if (dagChecker->EvaluatingLinkLibraries() && parameters.empty()) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<LINK_LANGUAGE> is not supported in link libraries expression.");
       return std::string();
     }
 
-    cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+    cmGlobalGenerator const* gg = eval->Context.LG->GetGlobalGenerator();
     std::string genName = gg->GetName();
     if (genName.find("Makefiles") == std::string::npos &&
         genName.find("Ninja") == std::string::npos &&
@@ -2444,22 +2378,22 @@
         genName.find("Xcode") == std::string::npos &&
         genName.find("Watcom WMake") == std::string::npos &&
         genName.find("Green Hills MULTI") == std::string::npos) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<LINK_LANGUAGE:...> not supported for this generator.");
       return std::string();
     }
 
     if (dagChecker->EvaluatingLinkLibraries()) {
-      context->HadHeadSensitiveCondition = true;
-      context->HadLinkLanguageSensitiveCondition = true;
+      eval->HadHeadSensitiveCondition = true;
+      eval->HadLinkLanguageSensitiveCondition = true;
     }
 
     if (parameters.empty()) {
-      return context->Language;
+      return eval->Context.Language;
     }
 
     for (auto const& param : parameters) {
-      if (context->Language == param) {
+      if (eval->Context.Language == param) {
         return "1";
       }
     }
@@ -2471,13 +2405,13 @@
 struct LinkerId
 {
   static std::string Evaluate(std::vector<std::string> const& parameters,
-                              cmGeneratorExpressionContext* context,
+                              cm::GenEx::Evaluation* eval,
                               GeneratorExpressionContent const* content,
                               std::string const& lang)
   {
     std::string const& linkerId =
-      context->LG->GetMakefile()->GetSafeDefinition("CMAKE_" + lang +
-                                                    "_COMPILER_ID");
+      eval->Context.LG->GetMakefile()->GetSafeDefinition("CMAKE_" + lang +
+                                                         "_COMPILER_ID");
     if (parameters.empty()) {
       return linkerId;
     }
@@ -2488,7 +2422,7 @@
 
     for (auto const& param : parameters) {
       if (!linkerIdValidator.find(param)) {
-        reportError(context, content->GetOriginalExpression(),
+        reportError(eval, content->GetOriginalExpression(),
                     "Expression syntax not recognized.");
         return std::string();
       }
@@ -2509,17 +2443,16 @@
   int NumExpectedParameters() const override { return TwoOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget || !dagChecker ||
+    if (!eval->HeadTarget || !dagChecker ||
         !(dagChecker->EvaluatingLinkExpression() ||
           dagChecker->EvaluatingLinkLibraries() ||
           dagChecker->EvaluatingLinkerLauncher())) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets "
         "to specify link libraries, link directories, link options, and "
         "link "
@@ -2527,7 +2460,7 @@
       return std::string();
     }
 
-    cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+    cmGlobalGenerator const* gg = eval->Context.LG->GetGlobalGenerator();
     std::string genName = gg->GetName();
     if (genName.find("Makefiles") == std::string::npos &&
         genName.find("Ninja") == std::string::npos &&
@@ -2536,21 +2469,21 @@
         genName.find("Watcom WMake") == std::string::npos &&
         genName.find("Green Hills MULTI") == std::string::npos) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<LINK_LANG_AND_ID:lang,id> not supported for this generator.");
       return std::string();
     }
 
     if (dagChecker->EvaluatingLinkLibraries()) {
-      context->HadHeadSensitiveCondition = true;
-      context->HadLinkLanguageSensitiveCondition = true;
+      eval->HadHeadSensitiveCondition = true;
+      eval->HadLinkLanguageSensitiveCondition = true;
     }
 
-    std::string const& lang = context->Language;
+    std::string const& lang = eval->Context.Language;
     if (lang == parameters.front()) {
       std::vector<std::string> idParameter((parameters.cbegin() + 1),
                                            parameters.cend());
-      return LinkerId::Evaluate(idParameter, context, content, lang);
+      return LinkerId::Evaluate(idParameter, eval, content, lang);
     }
     return "0";
   }
@@ -2563,17 +2496,16 @@
   int NumExpectedParameters() const override { return OneOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     using ForGenex = cmGeneratorExpressionDAGChecker::ForGenex;
 
-    if (!context->HeadTarget || !dagChecker ||
+    if (!eval->HeadTarget || !dagChecker ||
         !dagChecker->EvaluatingLinkLibraries(nullptr,
                                              ForGenex::LINK_LIBRARY)) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<LINK_LIBRARY:...> may only be used with binary targets "
                   "to specify link libraries through 'LINK_LIBRARIES', "
                   "'INTERFACE_LINK_LIBRARIES', and "
@@ -2584,7 +2516,7 @@
     cmList list{ parameters.begin(), parameters.end() };
     if (list.empty()) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<LINK_LIBRARY:...> expects a feature name as first argument.");
       return std::string();
     }
@@ -2596,7 +2528,7 @@
     static cmsys::RegularExpression featureNameValidator("^[A-Za-z0-9_]+$");
     auto const& feature = list.front();
     if (!featureNameValidator.find(feature)) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   cmStrCat("The feature name '", feature,
                            "' contains invalid characters."));
       return std::string();
@@ -2618,7 +2550,7 @@
                    });
     if (it != list.cend()) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<LINK_LIBRARY:...> with different features cannot be nested.");
       return std::string();
     }
@@ -2628,7 +2560,7 @@
                         return cmHasPrefix(item, "<LINK_GROUP:"_s);
                       });
     if (it != list.cend()) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<LINK_GROUP:...> cannot be nested inside a "
                   "$<LINK_LIBRARY:...> expression.");
       return std::string();
@@ -2648,17 +2580,16 @@
   int NumExpectedParameters() const override { return OneOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     using ForGenex = cmGeneratorExpressionDAGChecker::ForGenex;
 
-    if (!context->HeadTarget || !dagChecker ||
+    if (!eval->HeadTarget || !dagChecker ||
         !dagChecker->EvaluatingLinkLibraries(nullptr, ForGenex::LINK_GROUP)) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<LINK_GROUP:...> may only be used with binary targets "
         "to specify group of link libraries through 'LINK_LIBRARIES', "
         "'INTERFACE_LINK_LIBRARIES', and "
@@ -2669,7 +2600,7 @@
     cmList list{ parameters.begin(), parameters.end() };
     if (list.empty()) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<LINK_GROUP:...> expects a feature name as first argument.");
       return std::string();
     }
@@ -2678,7 +2609,7 @@
                      [](std::string const& item) -> bool {
                        return cmHasPrefix(item, "<LINK_GROUP"_s);
                      }) != list.cend()) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<LINK_GROUP:...> cannot be nested.");
       return std::string();
     }
@@ -2690,7 +2621,7 @@
     static cmsys::RegularExpression featureNameValidator("^[A-Za-z0-9_]+$");
     auto const& feature = list.front();
     if (!featureNameValidator.find(feature)) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   cmStrCat("The feature name '", feature,
                            "' contains invalid characters."));
       return std::string();
@@ -2717,21 +2648,20 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget || !dagChecker ||
+    if (!eval->HeadTarget || !dagChecker ||
         !dagChecker->EvaluatingLinkOptionsExpression()) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<HOST_LINK:...> may only be used with binary targets "
                   "to specify link options.");
       return std::string();
     }
 
-    return context->HeadTarget->IsDeviceLink() ? std::string()
-                                               : cmList::to_string(parameters);
+    return eval->HeadTarget->IsDeviceLink() ? std::string()
+                                            : cmList::to_string(parameters);
   }
 } hostLinkNode;
 
@@ -2742,20 +2672,19 @@
   int NumExpectedParameters() const override { return ZeroOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    if (!context->HeadTarget || !dagChecker ||
+    if (!eval->HeadTarget || !dagChecker ||
         !dagChecker->EvaluatingLinkOptionsExpression()) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "$<DEVICE_LINK:...> may only be used with binary targets "
                   "to specify link options.");
       return std::string();
     }
 
-    if (context->HeadTarget->IsDeviceLink()) {
+    if (eval->HeadTarget->IsDeviceLink()) {
       cmList list{ parameters.begin(), parameters.end() };
       auto const DL_BEGIN = "<DEVICE_LINK>"_s;
       auto const DL_END = "</DEVICE_LINK>"_s;
@@ -2775,24 +2704,27 @@
 
 static std::string getLinkedTargetsContent(
   cmGeneratorTarget const* target, std::string const& prop,
-  cmGeneratorExpressionContext* context,
-  cmGeneratorExpressionDAGChecker* dagChecker, cmGeneratorTarget::UseTo usage)
+  cm::GenEx::Evaluation* eval, cmGeneratorExpressionDAGChecker* dagChecker,
+  cmGeneratorTarget::UseTo usage)
 {
   std::string result;
   if (cmLinkImplementationLibraries const* impl =
         target->GetLinkImplementationLibraries(
-          context->Config, cmGeneratorTarget::UseTo::Compile)) {
+          eval->Context.Config, cmGeneratorTarget::UseTo::Compile)) {
     for (cmLinkImplItem const& lib : impl->Libraries) {
       if (lib.Target) {
         // Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in our
         // caller's property and hand-evaluate it as if it were compiled.
         // Create a context as cmCompiledGeneratorExpression::Evaluate does.
-        cmGeneratorExpressionContext libContext(
-          target->GetLocalGenerator(), context->Config, context->Quiet, target,
-          target, context->EvaluateForBuildsystem, lib.Backtrace,
-          context->Language);
+        cm::GenEx::Context libContext(eval->Context);
+        // FIXME: Why have we long used the target's local generator
+        // instead of that of the evaluation context?
+        libContext.LG = target->GetLocalGenerator();
+        cm::GenEx::Evaluation libEval(
+          std::move(libContext), eval->Quiet, target, target,
+          eval->EvaluateForBuildsystem, lib.Backtrace);
         std::string libResult = lib.Target->EvaluateInterfaceProperty(
-          prop, &libContext, dagChecker, usage);
+          prop, &libEval, dagChecker, usage);
         if (!libResult.empty()) {
           if (result.empty()) {
             result = std::move(libResult);
@@ -2837,8 +2769,7 @@
   }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagCheckerParent) const override
   {
@@ -2853,53 +2784,53 @@
       propertyName = parameters[1];
 
       if (char const* e = GetErrorText(targetName, propertyName)) {
-        reportError(context, content->GetOriginalExpression(), e);
+        reportError(eval, content->GetOriginalExpression(), e);
         return std::string();
       }
       if (propertyName == "ALIASED_TARGET"_s) {
-        if (context->LG->GetMakefile()->IsAlias(targetName)) {
+        if (eval->Context.LG->GetMakefile()->IsAlias(targetName)) {
           if (cmGeneratorTarget* tgt =
-                context->LG->FindGeneratorTargetToUse(targetName)) {
+                eval->Context.LG->FindGeneratorTargetToUse(targetName)) {
             return tgt->GetName();
           }
         }
         return std::string();
       }
       if (propertyName == "ALIAS_GLOBAL"_s) {
-        if (context->LG->GetMakefile()->IsAlias(targetName)) {
-          return context->LG->GetGlobalGenerator()->IsAlias(targetName)
+        if (eval->Context.LG->GetMakefile()->IsAlias(targetName)) {
+          return eval->Context.LG->GetGlobalGenerator()->IsAlias(targetName)
             ? "TRUE"
             : "FALSE";
         }
         return std::string();
       }
-      cmLocalGenerator const* lg = context->CurrentTarget
-        ? context->CurrentTarget->GetLocalGenerator()
-        : context->LG;
+      cmLocalGenerator const* lg = eval->CurrentTarget
+        ? eval->CurrentTarget->GetLocalGenerator()
+        : eval->Context.LG;
       target = lg->FindGeneratorTargetToUse(targetName);
 
       if (!target) {
         std::ostringstream e;
         e << "Target \"" << targetName << "\" not found.";
-        reportError(context, content->GetOriginalExpression(), e.str());
+        reportError(eval, content->GetOriginalExpression(), e.str());
         return std::string();
       }
-      context->AllTargets.insert(target);
+      eval->AllTargets.insert(target);
 
     } else if (parameters.size() == 1) {
-      target = context->HeadTarget;
+      target = eval->HeadTarget;
       propertyName = parameters[0];
 
       // Keep track of the properties seen while processing.
       // The evaluation of the LINK_LIBRARIES generator expressions
       // will check this to ensure that properties have one consistent
       // value for all evaluations.
-      context->SeenTargetProperties.insert(propertyName);
+      eval->SeenTargetProperties.insert(propertyName);
 
-      context->HadHeadSensitiveCondition = true;
+      eval->HadHeadSensitiveCondition = true;
       if (!target) {
         reportError(
-          context, content->GetOriginalExpression(),
+          eval, content->GetOriginalExpression(),
           "$<TARGET_PROPERTY:prop>  may only be used with binary targets.  "
           "It may not be used with add_custom_command or add_custom_target. "
           " "
@@ -2910,25 +2841,25 @@
       }
     } else {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<TARGET_PROPERTY:...> expression requires one or two parameters");
       return std::string();
     }
 
     if (propertyName == "SOURCES") {
-      context->SourceSensitiveTargets.insert(target);
+      eval->SourceSensitiveTargets.insert(target);
     }
 
     if (propertyName.empty()) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<TARGET_PROPERTY:...> expression requires a non-empty property "
         "name.");
       return std::string();
     }
 
     if (!propertyNameValidator.find(propertyName)) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "Property name not supported.");
       return std::string();
     }
@@ -2940,12 +2871,12 @@
           (dagCheckerParent->EvaluatingLinkLibraries() ||
            dagCheckerParent->EvaluatingSources())) {
         reportError(
-          context, content->GetOriginalExpression(),
+          eval, content->GetOriginalExpression(),
           "LINKER_LANGUAGE target property can not be used while evaluating "
           "link libraries for a static library");
         return std::string();
       }
-      return target->GetLinkerLanguage(context->Config);
+      return target->GetLinkerLanguage(eval->Context.Config);
     }
 
     bool const evaluatingLinkLibraries =
@@ -2956,8 +2887,8 @@
     cmGeneratorTarget::UseTo usage = cmGeneratorTarget::UseTo::Compile;
 
     if (cm::optional<cmGeneratorTarget::TransitiveProperty> transitiveProp =
-          target->IsTransitiveProperty(propertyName, context->LG,
-                                       context->Config, dagCheckerParent)) {
+          target->IsTransitiveProperty(propertyName, eval->Context,
+                                       dagCheckerParent)) {
       interfacePropertyName = std::string(transitiveProp->InterfaceName);
       isInterfaceProperty = transitiveProp->InterfaceName == propertyName;
       usage = transitiveProp->Usage;
@@ -2972,9 +2903,10 @@
           dagCheckerParent->EvaluatingLinkerLauncher()) {
         // No check required.
       } else if (evaluatingLinkLibraries) {
-        if (!interfacePropertyName.empty()) {
+        if (!interfacePropertyName.empty() &&
+            interfacePropertyName != "INTERFACE_LINK_LIBRARIES"_s) {
           reportError(
-            context, content->GetOriginalExpression(),
+            eval, content->GetOriginalExpression(),
             "$<TARGET_PROPERTY:...> expression in link libraries "
             "evaluation depends on target property which is transitive "
             "over the link libraries, creating a recursion.");
@@ -2987,23 +2919,18 @@
 
     if (isInterfaceProperty) {
       return cmGeneratorExpression::StripEmptyListElements(
-        target->EvaluateInterfaceProperty(propertyName, context,
-                                          dagCheckerParent, usage));
+        target->EvaluateInterfaceProperty(propertyName, eval, dagCheckerParent,
+                                          usage));
     }
 
     cmGeneratorExpressionDAGChecker dagChecker{
-      target,
-      propertyName,
-      content,
-      dagCheckerParent,
-      context->LG,
-      context->Config,
-      context->Backtrace,
+      target,           propertyName,  content,
+      dagCheckerParent, eval->Context, eval->Backtrace,
     };
 
     switch (dagChecker.Check()) {
       case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
-        dagChecker.ReportError(context, content->GetOriginalExpression());
+        dagChecker.ReportError(eval, content->GetOriginalExpression());
         return std::string();
       case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE:
         // No error. We just skip cyclic references.
@@ -3039,37 +2966,37 @@
     // from this target and the transitive link closure to get the max or min.
     if (!haveProp && !target->IsImported()) {
       if (target->IsLinkInterfaceDependentBoolProperty(propertyName,
-                                                       context->Config)) {
-        context->HadContextSensitiveCondition = true;
-        return target->GetLinkInterfaceDependentBoolProperty(propertyName,
-                                                             context->Config)
+                                                       eval->Context.Config)) {
+        eval->HadContextSensitiveCondition = true;
+        return target->GetLinkInterfaceDependentBoolProperty(
+                 propertyName, eval->Context.Config)
           ? "1"
           : "0";
       }
-      if (target->IsLinkInterfaceDependentStringProperty(propertyName,
-                                                         context->Config)) {
-        context->HadContextSensitiveCondition = true;
+      if (target->IsLinkInterfaceDependentStringProperty(
+            propertyName, eval->Context.Config)) {
+        eval->HadContextSensitiveCondition = true;
         char const* propContent =
-          target->GetLinkInterfaceDependentStringProperty(propertyName,
-                                                          context->Config);
+          target->GetLinkInterfaceDependentStringProperty(
+            propertyName, eval->Context.Config);
         return propContent ? propContent : "";
       }
     }
     if (!evaluatingLinkLibraries && !target->IsImported()) {
-      if (target->IsLinkInterfaceDependentNumberMinProperty(propertyName,
-                                                            context->Config)) {
-        context->HadContextSensitiveCondition = true;
+      if (target->IsLinkInterfaceDependentNumberMinProperty(
+            propertyName, eval->Context.Config)) {
+        eval->HadContextSensitiveCondition = true;
         char const* propContent =
-          target->GetLinkInterfaceDependentNumberMinProperty(propertyName,
-                                                             context->Config);
+          target->GetLinkInterfaceDependentNumberMinProperty(
+            propertyName, eval->Context.Config);
         return propContent ? propContent : "";
       }
-      if (target->IsLinkInterfaceDependentNumberMaxProperty(propertyName,
-                                                            context->Config)) {
-        context->HadContextSensitiveCondition = true;
+      if (target->IsLinkInterfaceDependentNumberMaxProperty(
+            propertyName, eval->Context.Config)) {
+        eval->HadContextSensitiveCondition = true;
         char const* propContent =
-          target->GetLinkInterfaceDependentNumberMaxProperty(propertyName,
-                                                             context->Config);
+          target->GetLinkInterfaceDependentNumberMaxProperty(
+            propertyName, eval->Context.Config);
         return propContent ? propContent : "";
       }
     }
@@ -3078,10 +3005,10 @@
     // transitive link closure as an ordered list.
     if (!interfacePropertyName.empty()) {
       result = cmGeneratorExpression::StripEmptyListElements(
-        this->EvaluateDependentExpression(result, context->LG, context, target,
-                                          &dagChecker, target));
+        this->EvaluateDependentExpression(result, eval, target, &dagChecker,
+                                          target));
       std::string linkedTargetsContent = getLinkedTargetsContent(
-        target, interfacePropertyName, context, &dagChecker, usage);
+        target, interfacePropertyName, eval, &dagChecker, usage);
       if (!linkedTargetsContent.empty()) {
         result += (result.empty() ? "" : ";") + linkedTargetsContent;
       }
@@ -3101,7 +3028,7 @@
 
   std::string Evaluate(
     std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* /*context*/,
+    cm::GenEx::Evaluation* /*eval*/,
     GeneratorExpressionContent const* /*content*/,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
@@ -3117,18 +3044,18 @@
   TargetObjectsNode() {} // NOLINT(modernize-use-equals-default)
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     std::string const& tgtName = parameters.front();
-    cmGeneratorTarget* gt = context->LG->FindGeneratorTargetToUse(tgtName);
+    cmGeneratorTarget* gt =
+      eval->Context.LG->FindGeneratorTargetToUse(tgtName);
     if (!gt) {
       std::ostringstream e;
       e << "Objects of target \"" << tgtName
         << "\" referenced but no such target exists.";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return std::string();
     }
     cmStateEnums::TargetType type = gt->GetType();
@@ -3141,13 +3068,13 @@
       e << "Objects of target \"" << tgtName
         << "\" referenced but is not one of the allowed target types "
         << "(EXECUTABLE, STATIC, SHARED, MODULE, OBJECT).";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return std::string();
     }
-    cmGlobalGenerator* gg = context->LG->GetGlobalGenerator();
+    cmGlobalGenerator const* gg = eval->Context.LG->GetGlobalGenerator();
     {
       std::string reason;
-      if (!context->EvaluateForBuildsystem &&
+      if (!eval->EvaluateForBuildsystem &&
           !gt->Target->HasKnownObjectFileLocation(&reason)) {
         std::ostringstream e;
         e << "The evaluation of the TARGET_OBJECTS generator expression "
@@ -3155,7 +3082,7 @@
           << reason
           << ").  "
              "It is not suitable for writing out elsewhere.";
-        reportError(context, content->GetOriginalExpression(), e.str());
+        reportError(eval, content->GetOriginalExpression(), e.str());
         return std::string();
       }
     }
@@ -3166,23 +3093,23 @@
       cmValue loc = nullptr;
       cmValue imp = nullptr;
       std::string suffix;
-      if (gt->Target->GetMappedConfig(context->Config, loc, imp, suffix)) {
+      if (gt->Target->GetMappedConfig(eval->Context.Config, loc, imp,
+                                      suffix)) {
         objects.assign(*loc);
       }
-      context->HadContextSensitiveCondition = true;
+      eval->HadContextSensitiveCondition = true;
     } else {
-      gt->GetTargetObjectNames(context->Config, objects);
+      gt->GetTargetObjectNames(eval->Context.Config, objects);
 
       std::string obj_dir;
-      if (context->EvaluateForBuildsystem && !gg->SupportsCrossConfigs()) {
+      if (eval->EvaluateForBuildsystem && !gg->SupportsCrossConfigs()) {
         // Use object file directory with buildsystem placeholder.
         obj_dir = gt->ObjectDirectory;
-        context->HadContextSensitiveCondition =
-          gt->HasContextDependentSources();
+        eval->HadContextSensitiveCondition = gt->HasContextDependentSources();
       } else {
         // Use object file directory with per-config location.
-        obj_dir = gt->GetObjectDirectory(context->Config);
-        context->HadContextSensitiveCondition = true;
+        obj_dir = gt->GetObjectDirectory(eval->Context.Config);
+        eval->HadContextSensitiveCondition = true;
       }
 
       for (auto& o : objects) {
@@ -3191,7 +3118,7 @@
     }
 
     // Create the cmSourceFile instances in the referencing directory.
-    cmMakefile* mf = context->LG->GetMakefile();
+    cmMakefile* mf = eval->Context.LG->GetMakefile();
     for (std::string const& o : objects) {
       mf->AddTargetObject(tgtName, o);
     }
@@ -3203,17 +3130,17 @@
 struct TargetRuntimeDllsBaseNode : public cmGeneratorExpressionNode
 {
   std::vector<std::string> CollectDlls(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content) const
   {
     std::string const& tgtName = parameters.front();
-    cmGeneratorTarget* gt = context->LG->FindGeneratorTargetToUse(tgtName);
+    cmGeneratorTarget* gt =
+      eval->Context.LG->FindGeneratorTargetToUse(tgtName);
     if (!gt) {
       std::ostringstream e;
       e << "Objects of target \"" << tgtName
         << "\" referenced but no such target exists.";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return std::vector<std::string>();
     }
     cmStateEnums::TargetType type = gt->GetType();
@@ -3224,16 +3151,16 @@
       e << "Objects of target \"" << tgtName
         << "\" referenced but is not one of the allowed target types "
         << "(EXECUTABLE, SHARED, MODULE).";
-      reportError(context, content->GetOriginalExpression(), e.str());
+      reportError(eval, content->GetOriginalExpression(), e.str());
       return std::vector<std::string>();
     }
 
-    if (auto* cli = gt->GetLinkInformation(context->Config)) {
+    if (auto* cli = gt->GetLinkInformation(eval->Context.Config)) {
       std::vector<std::string> dllPaths;
       auto const& dlls = cli->GetRuntimeDLLs();
 
       for (auto const& dll : dlls) {
-        if (auto loc = dll->MaybeGetLocation(context->Config)) {
+        if (auto loc = dll->MaybeGetLocation(eval->Context.Config)) {
           dllPaths.emplace_back(*loc);
         }
       }
@@ -3250,12 +3177,11 @@
   TargetRuntimeDllsNode() {} // NOLINT(modernize-use-equals-default)
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
-    std::vector<std::string> dlls = CollectDlls(parameters, context, content);
+    std::vector<std::string> dlls = CollectDlls(parameters, eval, content);
     return cmList::to_string(dlls);
   }
 } targetRuntimeDllsNode;
@@ -3265,12 +3191,11 @@
   TargetRuntimeDllDirsNode() {} // NOLINT(modernize-use-equals-default)
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
-    std::vector<std::string> dlls = CollectDlls(parameters, context, content);
+    std::vector<std::string> dlls = CollectDlls(parameters, eval, content);
     std::vector<std::string> dllDirs;
     for (std::string const& dll : dlls) {
       std::string directory = cmSystemTools::GetFilenamePath(dll);
@@ -3290,32 +3215,31 @@
   int NumExpectedParameters() const override { return OneOrMoreParameters; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    cmGeneratorTarget const* target = context->HeadTarget;
+    cmGeneratorTarget const* target = eval->HeadTarget;
     if (!target) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<COMPILE_FEATURE> may only be used with binary targets.  It may "
         "not be used with add_custom_command or add_custom_target.");
       return std::string();
     }
-    context->HadHeadSensitiveCondition = true;
+    eval->HadHeadSensitiveCondition = true;
 
     using LangMap = std::map<std::string, cmList>;
     static LangMap availableFeatures;
 
     LangMap testedFeatures;
-    cmStandardLevelResolver standardResolver(context->LG->GetMakefile());
+    cmStandardLevelResolver standardResolver(eval->Context.LG->GetMakefile());
     for (std::string const& p : parameters) {
       std::string error;
       std::string lang;
       if (!standardResolver.CompileFeatureKnown(
-            context->HeadTarget->Target->GetName(), p, lang, &error)) {
-        reportError(context, content->GetOriginalExpression(), error);
+            eval->HeadTarget->Target->GetName(), p, lang, &error)) {
+        reportError(eval, content->GetOriginalExpression(), error);
         return std::string();
       }
       testedFeatures[lang].push_back(p);
@@ -3324,7 +3248,7 @@
         cmValue featuresKnown =
           standardResolver.CompileFeaturesAvailable(lang, &error);
         if (!featuresKnown) {
-          reportError(context, content->GetOriginalExpression(), error);
+          reportError(eval, content->GetOriginalExpression(), error);
           return std::string();
         }
         availableFeatures[lang].assign(featuresKnown);
@@ -3336,7 +3260,7 @@
     for (auto const& lit : testedFeatures) {
       std::vector<std::string> const& langAvailable =
         availableFeatures[lit.first];
-      cmValue standardDefault = context->LG->GetMakefile()->GetDefinition(
+      cmValue standardDefault = eval->Context.LG->GetMakefile()->GetDefinition(
         "CMAKE_" + lit.first + "_STANDARD_DEFAULT");
       for (std::string const& it : lit.second) {
         if (!cm::contains(langAvailable, it)) {
@@ -3347,16 +3271,16 @@
           // All features known for the language are always available.
           continue;
         }
-        if (!standardResolver.HaveStandardAvailable(target, lit.first,
-                                                    context->Config, it)) {
+        if (!standardResolver.HaveStandardAvailable(
+              target, lit.first, eval->Context.Config, it)) {
           if (evalLL) {
             cmValue l =
-              target->GetLanguageStandard(lit.first, context->Config);
+              target->GetLanguageStandard(lit.first, eval->Context.Config);
             if (!l) {
               l = standardDefault;
             }
             assert(l);
-            context->MaxLanguageStandard[target][lit.first] = *l;
+            eval->MaxLanguageStandard[target][lit.first] = *l;
           } else {
             return "0";
           }
@@ -3414,27 +3338,26 @@
   int NumExpectedParameters() const override { return 1; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
-    if (!context->HeadTarget) {
+    if (!eval->HeadTarget) {
       reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "$<TARGET_POLICY:prop> may only be used with binary targets.  It "
         "may not be used with add_custom_command or add_custom_target.");
       return std::string();
     }
 
-    context->HadContextSensitiveCondition = true;
-    context->HadHeadSensitiveCondition = true;
+    eval->HadContextSensitiveCondition = true;
+    eval->HadHeadSensitiveCondition = true;
 
     for (size_t i = 1; i < cm::size(targetPolicyWhitelist); ++i) {
       char const* policy = targetPolicyWhitelist[i];
       if (parameters.front() == policy) {
-        cmLocalGenerator* lg = context->HeadTarget->GetLocalGenerator();
-        switch (statusForTarget(context->HeadTarget, policy)) {
+        cmLocalGenerator* lg = eval->HeadTarget->GetLocalGenerator();
+        switch (statusForTarget(eval->HeadTarget, policy)) {
           case cmPolicies::WARN:
             lg->IssueMessage(
               MessageType::AUTHOR_WARNING,
@@ -3448,7 +3371,7 @@
       }
     }
     reportError(
-      context, content->GetOriginalExpression(),
+      eval, content->GetOriginalExpression(),
       "$<TARGET_POLICY:prop> may only be used with a limited number of "
       "policies.  Currently it may be used with the following policies:\n"
 
@@ -3475,11 +3398,10 @@
 
   std::string Evaluate(
     std::vector<std::string> const& /*parameters*/,
-    cmGeneratorExpressionContext* context,
-    GeneratorExpressionContent const* content,
+    cm::GenEx::Evaluation* eval, GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
-    reportError(context, content->GetOriginalExpression(),
+    reportError(eval, content->GetOriginalExpression(),
                 "INSTALL_PREFIX is a marker for install(EXPORT) only.  It "
                 "should never be evaluated.");
     return std::string();
@@ -3505,20 +3427,20 @@
 struct TargetFilesystemArtifactDependency
 {
   static void AddDependency(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context)
+                            cm::GenEx::Evaluation* eval)
   {
-    context->DependTargets.insert(target);
-    context->AllTargets.insert(target);
+    eval->DependTargets.insert(target);
+    eval->AllTargets.insert(target);
   }
 };
 
 struct TargetFilesystemArtifactDependencyCMP0112
 {
   static void AddDependency(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context)
+                            cm::GenEx::Evaluation* eval)
   {
-    context->AllTargets.insert(target);
-    cmLocalGenerator* lg = context->LG;
+    eval->AllTargets.insert(target);
+    cmLocalGenerator const* lg = eval->Context.LG;
     switch (target->GetPolicyStatusCMP0112()) {
       case cmPolicies::WARN:
         if (lg->GetMakefile()->PolicyOptionalWarningEnabled(
@@ -3528,11 +3450,11 @@
                      "\nDependency being added to target:\n  \"",
                      target->GetName(), "\"\n");
           lg->GetCMakeInstance()->IssueMessage(MessageType ::AUTHOR_WARNING,
-                                               err, context->Backtrace);
+                                               err, eval->Backtrace);
         }
         CM_FALLTHROUGH;
       case cmPolicies::OLD:
-        context->DependTargets.insert(target);
+        eval->DependTargets.insert(target);
         break;
       case cmPolicies::NEW:
         break;
@@ -3573,7 +3495,7 @@
 struct TargetFilesystemArtifactResultCreator
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content);
 };
 
@@ -3581,30 +3503,31 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactSonameTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     // The target soname file (.so.1).
     if (target->IsDLLPlatform()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_SONAME_FILE is not allowed "
                     "for DLL target platforms.");
       return std::string();
     }
     if (target->GetType() != cmStateEnums::SHARED_LIBRARY) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_SONAME_FILE is allowed only for "
                     "SHARED libraries.");
       return std::string();
     }
     if (target->IsArchivedAIXSharedLibrary()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_SONAME_FILE is not allowed for "
                     "AIX_SHARED_LIBRARY_ARCHIVE libraries.");
       return std::string();
     }
-    std::string result = cmStrCat(target->GetDirectory(context->Config), '/',
-                                  target->GetSOName(context->Config));
+    std::string result =
+      cmStrCat(target->GetDirectory(eval->Context.Config), '/',
+               target->GetSOName(eval->Context.Config));
     return result;
   }
 };
@@ -3613,35 +3536,36 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactSonameImportTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     // The target soname file (.so.1).
     if (target->IsDLLPlatform()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_SONAME_IMPORT_FILE is not allowed "
                     "for DLL target platforms.");
       return std::string();
     }
     if (target->GetType() != cmStateEnums::SHARED_LIBRARY) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_SONAME_IMPORT_FILE is allowed only for "
                     "SHARED libraries.");
       return std::string();
     }
     if (target->IsArchivedAIXSharedLibrary()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_SONAME_IMPORT_FILE is not allowed for "
                     "AIX_SHARED_LIBRARY_ARCHIVE libraries.");
       return std::string();
     }
 
-    if (target->HasImportLibrary(context->Config)) {
-      return cmStrCat(target->GetDirectory(
-                        context->Config, cmStateEnums::ImportLibraryArtifact),
-                      '/',
-                      target->GetSOName(context->Config,
-                                        cmStateEnums::ImportLibraryArtifact));
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return cmStrCat(
+        target->GetDirectory(eval->Context.Config,
+                             cmStateEnums::ImportLibraryArtifact),
+        '/',
+        target->GetSOName(eval->Context.Config,
+                          cmStateEnums::ImportLibraryArtifact));
     }
     return std::string{};
   }
@@ -3651,21 +3575,21 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactPdbTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     if (target->IsImported()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_PDB_FILE not allowed for IMPORTED targets.");
       return std::string();
     }
 
-    std::string language = target->GetLinkerLanguage(context->Config);
+    std::string language = target->GetLinkerLanguage(eval->Context.Config);
 
     std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
 
-    if (!context->LG->GetMakefile()->IsOn(pdbSupportVar)) {
-      ::reportError(context, content->GetOriginalExpression(),
+    if (!eval->Context.LG->GetMakefile()->IsOn(pdbSupportVar)) {
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_PDB_FILE is not supported by the target linker.");
       return std::string();
     }
@@ -3675,14 +3599,15 @@
     if (targetType != cmStateEnums::SHARED_LIBRARY &&
         targetType != cmStateEnums::MODULE_LIBRARY &&
         targetType != cmStateEnums::EXECUTABLE) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_PDB_FILE is allowed only for "
                     "targets with linker created artifacts.");
       return std::string();
     }
 
-    std::string result = cmStrCat(target->GetPDBDirectory(context->Config),
-                                  '/', target->GetPDBName(context->Config));
+    std::string result =
+      cmStrCat(target->GetPDBDirectory(eval->Context.Config), '/',
+               target->GetPDBName(eval->Context.Config));
     return result;
   }
 };
@@ -3691,22 +3616,22 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactLinkerTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     // The file used to link to the target (.so, .lib, .a) or import file
     // (.lib,  .tbd).
     if (!target->IsLinkable()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_LINKER_FILE is allowed only for libraries and "
                     "executables with ENABLE_EXPORTS.");
       return std::string();
     }
     cmStateEnums::ArtifactType artifact =
-      target->HasImportLibrary(context->Config)
+      target->HasImportLibrary(eval->Context.Config)
       ? cmStateEnums::ImportLibraryArtifact
       : cmStateEnums::RuntimeBinaryArtifact;
-    return target->GetFullPath(context->Config, artifact);
+    return target->GetFullPath(eval->Context.Config, artifact);
   }
 };
 
@@ -3714,13 +3639,13 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactLinkerLibraryTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     // The file used to link to the target (.dylib, .so, .a).
     if (!target->IsLinkable() ||
         target->GetType() == cmStateEnums::EXECUTABLE) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_LINKER_LIBRARY_FILE is allowed only for libraries "
                     "with ENABLE_EXPORTS.");
       return std::string();
@@ -3728,7 +3653,7 @@
 
     if (!target->IsDLLPlatform() ||
         target->GetType() == cmStateEnums::STATIC_LIBRARY) {
-      return target->GetFullPath(context->Config,
+      return target->GetFullPath(eval->Context.Config,
                                  cmStateEnums::RuntimeBinaryArtifact);
     }
     return std::string{};
@@ -3739,20 +3664,20 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactLinkerImportTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     // The file used to link to the target (.lib, .tbd).
     if (!target->IsLinkable()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_LINKER_IMPORT_FILE is allowed only for libraries and "
         "executables with ENABLE_EXPORTS.");
       return std::string();
     }
 
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetFullPath(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetFullPath(eval->Context.Config,
                                  cmStateEnums::ImportLibraryArtifact);
     }
     return std::string{};
@@ -3763,22 +3688,22 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactBundleDirTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     if (target->IsImported()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_BUNDLE_DIR not allowed for IMPORTED targets.");
       return std::string();
     }
     if (!target->IsBundleOnApple()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_BUNDLE_DIR is allowed only for Bundle targets.");
       return std::string();
     }
 
-    std::string outpath = target->GetDirectory(context->Config) + '/';
-    return target->BuildBundleDirectory(outpath, context->Config,
+    std::string outpath = target->GetDirectory(eval->Context.Config) + '/';
+    return target->BuildBundleDirectory(outpath, eval->Context.Config,
                                         cmGeneratorTarget::BundleDirLevel);
   }
 };
@@ -3787,24 +3712,24 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactBundleDirNameTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     if (target->IsImported()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_BUNDLE_DIR_NAME not allowed for IMPORTED targets.");
       return std::string();
     }
     if (!target->IsBundleOnApple()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_BUNDLE_DIR_NAME is allowed only for Bundle targets.");
       return std::string();
     }
 
     auto level = cmGeneratorTarget::BundleDirLevel;
-    auto config = context->Config;
+    auto config = eval->Context.Config;
     if (target->IsAppBundleOnApple()) {
       return target->GetAppBundleDirectory(config, level);
     }
@@ -3822,24 +3747,24 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactBundleContentDirTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* content)
   {
     if (target->IsImported()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_BUNDLE_CONTENT_DIR not allowed for IMPORTED targets.");
       return std::string();
     }
     if (!target->IsBundleOnApple()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_BUNDLE_CONTENT_DIR is allowed only for Bundle targets.");
       return std::string();
     }
 
-    std::string outpath = target->GetDirectory(context->Config) + '/';
-    return target->BuildBundleDirectory(outpath, context->Config,
+    std::string outpath = target->GetDirectory(eval->Context.Config) + '/';
+    return target->BuildBundleDirectory(outpath, eval->Context.Config,
                                         cmGeneratorTarget::ContentLevel);
   }
 };
@@ -3848,10 +3773,10 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactNameTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* /*unused*/)
   {
-    return target->GetFullPath(context->Config,
+    return target->GetFullPath(eval->Context.Config,
                                cmStateEnums::RuntimeBinaryArtifact, true);
   }
 };
@@ -3860,11 +3785,11 @@
 struct TargetFilesystemArtifactResultCreator<ArtifactImportTag>
 {
   static std::string Create(cmGeneratorTarget* target,
-                            cmGeneratorExpressionContext* context,
+                            cm::GenEx::Evaluation* eval,
                             GeneratorExpressionContent const* /*unused*/)
   {
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetFullPath(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetFullPath(eval->Context.Config,
                                  cmStateEnums::ImportLibraryArtifact, true);
     }
     return std::string{};
@@ -3907,8 +3832,7 @@
 
 protected:
   cmGeneratorTarget* GetTarget(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const
   {
@@ -3916,19 +3840,20 @@
     std::string const& name = parameters.front();
 
     if (!cmGeneratorExpression::IsValidTargetName(name)) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "Expression syntax not recognized.");
       return nullptr;
     }
-    cmGeneratorTarget* target = context->LG->FindGeneratorTargetToUse(name);
+    cmGeneratorTarget* target =
+      eval->Context.LG->FindGeneratorTargetToUse(name);
     if (!target) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "No target \"" + name + "\"");
       return nullptr;
     }
     if (target->GetType() >= cmStateEnums::OBJECT_LIBRARY &&
         target->GetType() != cmStateEnums::UNKNOWN_LIBRARY) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "Target \"" + name +
                       "\" is not an executable or library.");
       return nullptr;
@@ -3937,7 +3862,7 @@
         (dagChecker->EvaluatingLinkLibraries(target) ||
          (dagChecker->EvaluatingSources() &&
           target == dagChecker->TopTarget()))) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "Expressions which require the linker language may not "
                     "be used while evaluating link libraries");
       return nullptr;
@@ -3955,13 +3880,12 @@
   int NumExpectedParameters() const override { return 1; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     cmGeneratorTarget* target =
-      this->GetTarget(parameters, context, content, dagChecker);
+      this->GetTarget(parameters, eval, content, dagChecker);
     if (!target) {
       return std::string();
     }
@@ -3969,12 +3893,12 @@
     // ArtifactNameTag, ArtifactBundleDirTag, ArtifactBundleDirNameTag,
     // and ArtifactBundleContentDirTag
     TargetFilesystemArtifactDependency<ArtifactT, ComponentT>::AddDependency(
-      target, context);
+      target, eval);
 
     std::string result =
-      TargetFilesystemArtifactResultCreator<ArtifactT>::Create(target, context,
+      TargetFilesystemArtifactResultCreator<ArtifactT>::Create(target, eval,
                                                                content);
-    if (context->HadError) {
+    if (eval->HadError) {
       return std::string();
     }
     return TargetFilesystemArtifactResultGetter<ComponentT>::Get(result);
@@ -4034,7 +3958,7 @@
 struct TargetOutputNameArtifactResultGetter
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content);
 };
 
@@ -4042,12 +3966,12 @@
 struct TargetOutputNameArtifactResultGetter<ArtifactNameTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* /*unused*/)
   {
-    return target->GetOutputName(context->Config,
+    return target->GetOutputName(eval->Context.Config,
                                  cmStateEnums::RuntimeBinaryArtifact) +
-      target->GetFilePostfix(context->Config);
+      target->GetFilePostfix(eval->Context.Config);
   }
 };
 
@@ -4055,13 +3979,13 @@
 struct TargetOutputNameArtifactResultGetter<ArtifactImportTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* /*unused*/)
   {
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetOutputName(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetOutputName(eval->Context.Config,
                                    cmStateEnums::ImportLibraryArtifact) +
-        target->GetFilePostfix(context->Config);
+        target->GetFilePostfix(eval->Context.Config);
     }
     return std::string{};
   }
@@ -4071,23 +3995,23 @@
 struct TargetOutputNameArtifactResultGetter<ArtifactLinkerTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     // The library file used to link to the target (.so, .lib, .a) or import
     // file (.lin,  .tbd).
     if (!target->IsLinkable()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_LINKER_FILE_BASE_NAME is allowed only for "
                     "libraries and executables with ENABLE_EXPORTS.");
       return std::string();
     }
     cmStateEnums::ArtifactType artifact =
-      target->HasImportLibrary(context->Config)
+      target->HasImportLibrary(eval->Context.Config)
       ? cmStateEnums::ImportLibraryArtifact
       : cmStateEnums::RuntimeBinaryArtifact;
-    return target->GetOutputName(context->Config, artifact) +
-      target->GetFilePostfix(context->Config);
+    return target->GetOutputName(eval->Context.Config, artifact) +
+      target->GetFilePostfix(eval->Context.Config);
   }
 };
 
@@ -4095,13 +4019,13 @@
 struct TargetOutputNameArtifactResultGetter<ArtifactLinkerLibraryTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     // The library file used to link to the target (.so, .lib, .a).
     if (!target->IsLinkable() ||
         target->GetType() == cmStateEnums::EXECUTABLE) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_LINKER_LIBRARY_FILE_BASE_NAME is allowed only for "
                     "libraries with ENABLE_EXPORTS.");
       return std::string();
@@ -4109,9 +4033,9 @@
 
     if (!target->IsDLLPlatform() ||
         target->GetType() == cmStateEnums::STATIC_LIBRARY) {
-      return target->GetOutputName(context->Config,
+      return target->GetOutputName(eval->Context.Config,
                                    cmStateEnums::ImportLibraryArtifact) +
-        target->GetFilePostfix(context->Config);
+        target->GetFilePostfix(eval->Context.Config);
     }
     return std::string{};
   }
@@ -4121,21 +4045,21 @@
 struct TargetOutputNameArtifactResultGetter<ArtifactLinkerImportTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     // The import file used to link to the target (.lib, .tbd).
     if (!target->IsLinkable()) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_LINKER_IMPORT_FILE_BASE_NAME is allowed only for "
                     "libraries and executables with ENABLE_EXPORTS.");
       return std::string();
     }
 
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetOutputName(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetOutputName(eval->Context.Config,
                                    cmStateEnums::ImportLibraryArtifact) +
-        target->GetFilePostfix(context->Config);
+        target->GetFilePostfix(eval->Context.Config);
     }
     return std::string{};
   }
@@ -4145,23 +4069,23 @@
 struct TargetOutputNameArtifactResultGetter<ArtifactPdbTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     if (target->IsImported()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_PDB_FILE_BASE_NAME not allowed for IMPORTED targets.");
       return std::string();
     }
 
-    std::string language = target->GetLinkerLanguage(context->Config);
+    std::string language = target->GetLinkerLanguage(eval->Context.Config);
 
     std::string pdbSupportVar = "CMAKE_" + language + "_LINKER_SUPPORTS_PDB";
 
-    if (!context->LG->GetMakefile()->IsOn(pdbSupportVar)) {
+    if (!eval->Context.LG->GetMakefile()->IsOn(pdbSupportVar)) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_PDB_FILE_BASE_NAME is not supported by the target linker.");
       return std::string();
     }
@@ -4171,14 +4095,13 @@
     if (targetType != cmStateEnums::SHARED_LIBRARY &&
         targetType != cmStateEnums::MODULE_LIBRARY &&
         targetType != cmStateEnums::EXECUTABLE) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_PDB_FILE_BASE_NAME is allowed only for "
                     "targets with linker created artifacts.");
       return std::string();
     }
 
-    return target->GetPDBOutputName(context->Config) +
-      target->GetFilePostfix(context->Config);
+    return target->GetPDBOutputName(eval->Context.Config);
   }
 };
 
@@ -4190,20 +4113,19 @@
   int NumExpectedParameters() const override { return 1; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     cmGeneratorTarget* target =
-      this->GetTarget(parameters, context, content, dagChecker);
+      this->GetTarget(parameters, eval, content, dagChecker);
     if (!target) {
       return std::string();
     }
 
     std::string result = TargetOutputNameArtifactResultGetter<ArtifactT>::Get(
-      target, context, content);
-    if (context->HadError) {
+      target, eval, content);
+    if (eval->HadError) {
       return std::string();
     }
     return result;
@@ -4238,7 +4160,7 @@
 struct TargetFileArtifactResultGetter
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content);
 };
 
@@ -4246,21 +4168,21 @@
 struct TargetFileArtifactResultGetter<ArtifactFilePrefixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const*)
   {
-    return target->GetFilePrefix(context->Config);
+    return target->GetFilePrefix(eval->Context.Config);
   }
 };
 template <>
 struct TargetFileArtifactResultGetter<ArtifactImportFilePrefixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const*)
   {
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetFilePrefix(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetFilePrefix(eval->Context.Config,
                                    cmStateEnums::ImportLibraryArtifact);
     }
     return std::string{};
@@ -4270,36 +4192,36 @@
 struct TargetFileArtifactResultGetter<ArtifactLinkerFilePrefixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     if (!target->IsLinkable()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_LINKER_FILE_PREFIX is allowed only for libraries and "
         "executables with ENABLE_EXPORTS.");
       return std::string();
     }
 
     cmStateEnums::ArtifactType artifact =
-      target->HasImportLibrary(context->Config)
+      target->HasImportLibrary(eval->Context.Config)
       ? cmStateEnums::ImportLibraryArtifact
       : cmStateEnums::RuntimeBinaryArtifact;
 
-    return target->GetFilePrefix(context->Config, artifact);
+    return target->GetFilePrefix(eval->Context.Config, artifact);
   }
 };
 template <>
 struct TargetFileArtifactResultGetter<ArtifactLinkerLibraryFilePrefixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     if (!target->IsLinkable() ||
         target->GetType() == cmStateEnums::EXECUTABLE) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_LINKER_LIBRARY_FILE_PREFIX is allowed only for libraries "
         "with ENABLE_EXPORTS.");
       return std::string();
@@ -4307,7 +4229,7 @@
 
     if (!target->IsDLLPlatform() ||
         target->GetType() == cmStateEnums::STATIC_LIBRARY) {
-      return target->GetFilePrefix(context->Config,
+      return target->GetFilePrefix(eval->Context.Config,
                                    cmStateEnums::RuntimeBinaryArtifact);
     }
     return std::string{};
@@ -4317,19 +4239,19 @@
 struct TargetFileArtifactResultGetter<ArtifactLinkerImportFilePrefixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     if (!target->IsLinkable()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_LINKER_IMPORT_FILE_PREFIX is allowed only for libraries and "
         "executables with ENABLE_EXPORTS.");
       return std::string();
     }
 
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetFilePrefix(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetFilePrefix(eval->Context.Config,
                                    cmStateEnums::ImportLibraryArtifact);
     }
     return std::string{};
@@ -4339,21 +4261,21 @@
 struct TargetFileArtifactResultGetter<ArtifactFileSuffixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const*)
   {
-    return target->GetFileSuffix(context->Config);
+    return target->GetFileSuffix(eval->Context.Config);
   }
 };
 template <>
 struct TargetFileArtifactResultGetter<ArtifactImportFileSuffixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const*)
   {
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetFileSuffix(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetFileSuffix(eval->Context.Config,
                                    cmStateEnums::ImportLibraryArtifact);
     }
     return std::string{};
@@ -4363,35 +4285,35 @@
 struct TargetFileArtifactResultGetter<ArtifactLinkerFileSuffixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     if (!target->IsLinkable()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_LINKER_FILE_SUFFIX is allowed only for libraries and "
         "executables with ENABLE_EXPORTS.");
       return std::string();
     }
 
     cmStateEnums::ArtifactType artifact =
-      target->HasImportLibrary(context->Config)
+      target->HasImportLibrary(eval->Context.Config)
       ? cmStateEnums::ImportLibraryArtifact
       : cmStateEnums::RuntimeBinaryArtifact;
 
-    return target->GetFileSuffix(context->Config, artifact);
+    return target->GetFileSuffix(eval->Context.Config, artifact);
   }
 };
 template <>
 struct TargetFileArtifactResultGetter<ArtifactLinkerLibraryFileSuffixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     if (!target->IsLinkable() ||
         target->GetType() == cmStateEnums::STATIC_LIBRARY) {
-      ::reportError(context, content->GetOriginalExpression(),
+      ::reportError(eval, content->GetOriginalExpression(),
                     "TARGET_LINKER_LIBRARY_FILE_SUFFIX is allowed only for "
                     "libraries with ENABLE_EXPORTS.");
       return std::string();
@@ -4399,7 +4321,7 @@
 
     if (!target->IsDLLPlatform() ||
         target->GetType() == cmStateEnums::STATIC_LIBRARY) {
-      return target->GetFileSuffix(context->Config,
+      return target->GetFileSuffix(eval->Context.Config,
                                    cmStateEnums::RuntimeBinaryArtifact);
     }
     return std::string{};
@@ -4409,19 +4331,19 @@
 struct TargetFileArtifactResultGetter<ArtifactLinkerImportFileSuffixTag>
 {
   static std::string Get(cmGeneratorTarget* target,
-                         cmGeneratorExpressionContext* context,
+                         cm::GenEx::Evaluation* eval,
                          GeneratorExpressionContent const* content)
   {
     if (!target->IsLinkable()) {
       ::reportError(
-        context, content->GetOriginalExpression(),
+        eval, content->GetOriginalExpression(),
         "TARGET_LINKER_IMPORT_FILE_SUFFIX is allowed only for libraries and "
         "executables with ENABLE_EXPORTS.");
       return std::string();
     }
 
-    if (target->HasImportLibrary(context->Config)) {
-      return target->GetFileSuffix(context->Config,
+    if (target->HasImportLibrary(eval->Context.Config)) {
+      return target->GetFileSuffix(eval->Context.Config,
                                    cmStateEnums::ImportLibraryArtifact);
     }
     return std::string{};
@@ -4436,20 +4358,19 @@
   int NumExpectedParameters() const override { return 1; }
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     cmGeneratorTarget* target =
-      this->GetTarget(parameters, context, content, dagChecker);
+      this->GetTarget(parameters, eval, content, dagChecker);
     if (!target) {
       return std::string();
     }
 
     std::string result =
-      TargetFileArtifactResultGetter<ArtifactT>::Get(target, context, content);
-    if (context->HadError) {
+      TargetFileArtifactResultGetter<ArtifactT>::Get(target, eval, content);
+    if (eval->HadError) {
       return std::string();
     }
     return result;
@@ -4480,25 +4401,24 @@
   ShellPathNode() {} // NOLINT(modernize-use-equals-default)
 
   std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
   {
     cmList list_in{ parameters.front() };
     if (list_in.empty()) {
-      reportError(context, content->GetOriginalExpression(),
+      reportError(eval, content->GetOriginalExpression(),
                   "\"\" is not an absolute path.");
       return std::string();
     }
-    cmStateSnapshot snapshot = context->LG->GetStateSnapshot();
+    cmStateSnapshot snapshot = eval->Context.LG->GetStateSnapshot();
     cmOutputConverter converter(snapshot);
     char const* separator = snapshot.GetState()->UseWindowsShell() ? ";" : ":";
     std::vector<std::string> list_out;
     list_out.reserve(list_in.size());
     for (auto const& in : list_in) {
       if (!cmSystemTools::FileIsFullPath(in)) {
-        reportError(context, content->GetOriginalExpression(),
+        reportError(eval, content->GetOriginalExpression(),
                     "\"" + in + "\" is not an absolute path.");
         return std::string();
       }
@@ -4653,11 +4573,11 @@
   return nullptr;
 }
 
-void reportError(cmGeneratorExpressionContext* context,
-                 std::string const& expr, std::string const& result)
+void reportError(cm::GenEx::Evaluation* eval, std::string const& expr,
+                 std::string const& result)
 {
-  context->HadError = true;
-  if (context->Quiet) {
+  eval->HadError = true;
+  if (eval->Quiet) {
     return;
   }
 
@@ -4667,6 +4587,6 @@
     << "  " << expr << "\n"
     << result;
   /* clang-format on */
-  context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
-                                                e.str(), context->Backtrace);
+  eval->Context.LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+                                                     e.str(), eval->Backtrace);
 }
diff --git a/Source/cmGeneratorExpressionNode.h b/Source/cmGeneratorExpressionNode.h
index 865f71c..5fe3e26 100644
--- a/Source/cmGeneratorExpressionNode.h
+++ b/Source/cmGeneratorExpressionNode.h
@@ -7,10 +7,14 @@
 #include <string>
 #include <vector>
 
+namespace cm {
+namespace GenEx {
+struct Evaluation;
+}
+}
+
 class cmGeneratorTarget;
-class cmLocalGenerator;
 struct GeneratorExpressionContent;
-struct cmGeneratorExpressionContext;
 struct cmGeneratorExpressionDAGChecker;
 
 struct cmGeneratorExpressionNode
@@ -40,14 +44,13 @@
   }
 
   virtual std::string Evaluate(
-    std::vector<std::string> const& parameters,
-    cmGeneratorExpressionContext* context,
+    std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
     GeneratorExpressionContent const* content,
     cmGeneratorExpressionDAGChecker* dagChecker) const = 0;
 
   static std::string EvaluateDependentExpression(
-    std::string const& prop, cmLocalGenerator* lg,
-    cmGeneratorExpressionContext* context, cmGeneratorTarget const* headTarget,
+    std::string const& prop, cm::GenEx::Evaluation* eval,
+    cmGeneratorTarget const* headTarget,
     cmGeneratorExpressionDAGChecker* dagChecker,
     cmGeneratorTarget const* currentTarget);
 
@@ -55,5 +58,5 @@
     std::string const& identifier);
 };
 
-void reportError(cmGeneratorExpressionContext* context,
-                 std::string const& expr, std::string const& result);
+void reportError(cm::GenEx::Evaluation* eval, std::string const& expr,
+                 std::string const& result);
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 99ee0ec..7a3f1dc 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -27,6 +27,7 @@
 #include "cmExperimental.h"
 #include "cmFileSet.h"
 #include "cmFileTimes.h"
+#include "cmGenExContext.h"
 #include "cmGeneratedFileStream.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorExpressionDAGChecker.h"
@@ -461,7 +462,7 @@
   if (!targetPrefix) {
     char const* prefixVar = this->Target->GetPrefixVariableInternal(artifact);
     if (!language.empty() && cmNonempty(prefixVar)) {
-      std::string langPrefix = cmStrCat(prefixVar, "_", language);
+      std::string langPrefix = cmStrCat(prefixVar, '_', language);
       targetPrefix = this->Makefile->GetDefinition(langPrefix);
     }
 
@@ -512,7 +513,7 @@
   if (!targetSuffix) {
     char const* suffixVar = this->Target->GetSuffixVariableInternal(artifact);
     if (!language.empty() && cmNonempty(suffixVar)) {
-      std::string langSuffix = cmStrCat(suffixVar, "_", language);
+      std::string langSuffix = cmStrCat(suffixVar, '_', language);
       targetSuffix = this->Makefile->GetDefinition(langSuffix);
     }
 
@@ -605,7 +606,7 @@
       cmSystemTools::ReplaceString(inc_with_config, "$<CONFIG>", config);
       config_upper = cmSystemTools::UpperCase(config);
     }
-    auto const& key = cmStrCat(config_upper, "/", lang);
+    auto const& key = cmStrCat(config_upper, '/', lang);
     this->Target->AddSystemIncludeDirectories({ inc_with_config });
     if (this->SystemIncludesCache.find(key) ==
         this->SystemIncludesCache.end()) {
@@ -630,7 +631,7 @@
 }
 
 namespace {
-void handleSystemIncludesDep(cmLocalGenerator* lg,
+void handleSystemIncludesDep(cmLocalGenerator const* lg,
                              cmGeneratorTarget const* depTgt,
                              std::string const& config,
                              cmGeneratorTarget const* headTarget,
@@ -737,12 +738,13 @@
   std::string propName{ "LINKER_TYPE" };
   auto linkerType = this->GetProperty(propName);
   if (!linkerType.IsEmpty()) {
+    cm::GenEx::Context context(this->LocalGenerator, config, lang);
     cmGeneratorExpressionDAGChecker dagChecker{
-      this, propName, nullptr, nullptr, this->LocalGenerator, config,
+      this, propName, nullptr, nullptr, context,
     };
-    auto ltype =
-      cmGeneratorExpression::Evaluate(*linkerType, this->GetLocalGenerator(),
-                                      config, this, &dagChecker, this, lang);
+    auto ltype = cmGeneratorExpression::Evaluate(
+      *linkerType, context.LG, context.Config, this, &dagChecker, this,
+      context.Language);
     if (this->IsDeviceLink()) {
       cmList list{ ltype };
       auto const DL_BEGIN = "<DEVICE_LINK>"_s;
@@ -1199,24 +1201,25 @@
   std::string const& key, std::string const& config,
   std::string const& language) const
 {
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
   cmGeneratorExpressionDAGChecker dagChecker{
-    this,    "SYSTEM_INCLUDE_DIRECTORIES", nullptr,
-    nullptr, this->LocalGenerator,         config,
+    this, "SYSTEM_INCLUDE_DIRECTORIES", nullptr, nullptr, context,
   };
 
   bool excludeImported = this->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED");
 
   cmList result;
   for (std::string const& it : this->Target->GetSystemIncludeDirectories()) {
-    result.append(cmGeneratorExpression::Evaluate(
-      it, this->LocalGenerator, config, this, &dagChecker, nullptr, language));
+    result.append(
+      cmGeneratorExpression::Evaluate(it, context.LG, context.Config, this,
+                                      &dagChecker, nullptr, context.Language));
   }
 
   std::vector<cmGeneratorTarget const*> const& deps =
     this->GetLinkImplementationClosure(config, UseTo::Compile);
   for (cmGeneratorTarget const* dep : deps) {
-    handleSystemIncludesDep(this->LocalGenerator, dep, config, this,
-                            &dagChecker, result, excludeImported, language);
+    handleSystemIncludesDep(context.LG, dep, context.Config, this, &dagChecker,
+                            result, excludeImported, context.Language);
   }
 
   cmLinkImplementation const* impl =
@@ -1226,9 +1229,9 @@
     if (runtimeEntries != impl->LanguageRuntimeLibraries.end()) {
       for (auto const& lib : runtimeEntries->second) {
         if (lib.Target) {
-          handleSystemIncludesDep(this->LocalGenerator, lib.Target, config,
-                                  this, &dagChecker, result, excludeImported,
-                                  language);
+          handleSystemIncludesDep(context.LG, lib.Target, context.Config, this,
+                                  &dagChecker, result, excludeImported,
+                                  context.Language);
         }
       }
     }
@@ -1274,16 +1277,20 @@
   std::string configProp = cmStrCat("COMPILE_PDB_NAME_", configUpper);
   cmValue config_name = this->GetProperty(configProp);
   if (cmNonempty(config_name)) {
+    std::string pdbName = cmGeneratorExpression::Evaluate(
+      *config_name, this->LocalGenerator, config, this);
     NameComponents const& components = GetFullNameInternalComponents(
       config, cmStateEnums::RuntimeBinaryArtifact);
-    return components.prefix + *config_name + ".pdb";
+    return components.prefix + pdbName + ".pdb";
   }
 
   cmValue name = this->GetProperty("COMPILE_PDB_NAME");
   if (cmNonempty(name)) {
+    std::string pdbName = cmGeneratorExpression::Evaluate(
+      *name, this->LocalGenerator, config, this);
     NameComponents const& components = GetFullNameInternalComponents(
       config, cmStateEnums::RuntimeBinaryArtifact);
-    return components.prefix + *name + ".pdb";
+    return components.prefix + pdbName + ".pdb";
   }
 
   return "";
@@ -1971,11 +1978,12 @@
     return;
   }
 
+  cm::GenEx::Context context(this->LocalGenerator, config);
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "AUTOUIC_OPTIONS", nullptr, nullptr, this->LocalGenerator, config,
+    this, "AUTOUIC_OPTIONS", nullptr, nullptr, context,
   };
-  cmExpandList(cmGeneratorExpression::Evaluate(prop, this->LocalGenerator,
-                                               config, this, &dagChecker),
+  cmExpandList(cmGeneratorExpression::Evaluate(
+                 prop, context.LG, context.Config, this, &dagChecker),
                result);
 }
 
@@ -2847,14 +2855,14 @@
       { "OBJCXX", ".objcxx.hxx" }
     };
 
-    filename = generatorTarget->GetSupportDirectory();
+    filename = generatorTarget->GetCMFSupportDirectory();
 
     if (this->GetGlobalGenerator()->IsMultiConfig()) {
-      filename = cmStrCat(filename, "/", config);
+      filename = cmStrCat(filename, '/', config);
     }
 
     filename =
-      cmStrCat(filename, "/cmake_pch", arch.empty() ? "" : cmStrCat("_", arch),
+      cmStrCat(filename, "/cmake_pch", arch.empty() ? "" : cmStrCat('_', arch),
                languageToExtension.at(language));
 
     std::string const filename_tmp = cmStrCat(filename, ".tmp");
@@ -2940,7 +2948,8 @@
         this->GetGlobalGenerator()->FindGeneratorTarget(*pchReuseFrom);
     }
 
-    filename = cmStrCat(generatorTarget->GetSupportDirectory(), "/cmake_pch");
+    filename =
+      cmStrCat(generatorTarget->GetCMFSupportDirectory(), "/cmake_pch");
 
     // For GCC the source extension will be transformed into .h[xx].gch
     if (!this->Makefile->IsOn("CMAKE_LINK_PCH")) {
@@ -2951,14 +2960,14 @@
         { "OBJCXX", ".objcxx.hxx.mm" }
       };
 
-      filename = cmStrCat(filename, arch.empty() ? "" : cmStrCat("_", arch),
+      filename = cmStrCat(filename, arch.empty() ? "" : cmStrCat('_', arch),
                           languageToExtension.at(language));
     } else {
       std::map<std::string, std::string> const languageToExtension = {
         { "C", ".c" }, { "CXX", ".cxx" }, { "OBJC", ".m" }, { "OBJCXX", ".mm" }
       };
 
-      filename = cmStrCat(filename, arch.empty() ? "" : cmStrCat("_", arch),
+      filename = cmStrCat(filename, arch.empty() ? "" : cmStrCat('_', arch),
                           languageToExtension.at(language));
     }
 
@@ -3069,7 +3078,7 @@
       std::string instantiateOption =
         this->Makefile->GetSafeDefinition(varName);
       if (!instantiateOption.empty()) {
-        createOptionList = cmStrCat(createOptionList, ";", instantiateOption);
+        createOptionList = cmStrCat(createOptionList, ';', instantiateOption);
       }
     }
 
@@ -3077,7 +3086,7 @@
       cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_CREATE_PCH");
 
     createOptionList = cmStrCat(
-      createOptionList, ";", this->Makefile->GetSafeDefinition(createOptVar));
+      createOptionList, ';', this->Makefile->GetSafeDefinition(createOptVar));
 
     std::string const pchHeader = this->GetPchHeader(config, language, arch);
     std::string const pchFile = this->GetPchFile(config, language, arch);
@@ -3109,7 +3118,7 @@
       this->GetSafeProperty(useOptVar);
 
     useOptionList = cmStrCat(
-      useOptionList, ";",
+      useOptionList, ';',
       useOptionListProperty.empty()
         ? this->Makefile->GetSafeDefinition(cmStrCat("CMAKE_", useOptVar))
         : useOptionListProperty);
@@ -3771,26 +3780,50 @@
 std::string cmGeneratorTarget::GetPDBOutputName(
   std::string const& config) const
 {
-  std::string base =
-    this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact);
+  // Lookup/compute/cache the pdb output name for this configuration.
+  auto i = this->PdbOutputNameMap.find(config);
+  if (i == this->PdbOutputNameMap.end()) {
+    // Add empty name in map to detect potential recursion.
+    PdbOutputNameMapType::value_type entry(config, "");
+    i = this->PdbOutputNameMap.insert(entry).first;
 
-  std::vector<std::string> props;
-  std::string configUpper = cmSystemTools::UpperCase(config);
-  if (!configUpper.empty()) {
-    // PDB_NAME_<CONFIG>
-    props.push_back("PDB_NAME_" + configUpper);
-  }
-
-  // PDB_NAME
-  props.emplace_back("PDB_NAME");
-
-  for (std::string const& p : props) {
-    if (cmValue outName = this->GetProperty(p)) {
-      base = *outName;
-      break;
+    // Compute output name.
+    std::vector<std::string> props;
+    std::string configUpper = cmSystemTools::UpperCase(config);
+    if (!configUpper.empty()) {
+      // PDB_NAME_<CONFIG>
+      props.push_back("PDB_NAME_" + configUpper);
     }
+
+    // PDB_NAME
+    props.emplace_back("PDB_NAME");
+
+    std::string outName;
+    for (std::string const& p : props) {
+      if (cmValue outNameProp = this->GetProperty(p)) {
+        outName = *outNameProp;
+        break;
+      }
+    }
+
+    // Now evaluate genex and update the previously-prepared map entry.
+    if (outName.empty()) {
+      i->second =
+        this->GetOutputName(config, cmStateEnums::RuntimeBinaryArtifact) +
+        this->GetFilePostfix(config);
+    } else {
+      i->second =
+        cmGeneratorExpression::Evaluate(outName, this->LocalGenerator, config);
+    }
+  } else if (i->second.empty()) {
+    // An empty map entry indicates we have been called recursively
+    // from the above block.
+    this->LocalGenerator->GetCMakeInstance()->IssueMessage(
+      MessageType::FATAL_ERROR,
+      "Target '" + this->GetName() + "' PDB_NAME depends on itself.",
+      this->GetBacktrace());
   }
-  return base;
+  return i->second;
 }
 
 std::string cmGeneratorTarget::GetPDBName(std::string const& config) const
@@ -3798,22 +3831,9 @@
   NameComponents const& parts = this->GetFullNameInternalComponents(
     config, cmStateEnums::RuntimeBinaryArtifact);
 
-  std::vector<std::string> props;
-  std::string configUpper = cmSystemTools::UpperCase(config);
-  if (!configUpper.empty()) {
-    // PDB_NAME_<CONFIG>
-    props.push_back("PDB_NAME_" + configUpper);
-  }
+  std::string base = this->GetPDBOutputName(config);
 
-  // PDB_NAME
-  props.emplace_back("PDB_NAME");
-
-  for (std::string const& p : props) {
-    if (cmValue outName = this->GetProperty(p)) {
-      return parts.prefix + *outName + ".pdb";
-    }
-  }
-  return parts.prefix + parts.base + ".pdb";
+  return parts.prefix + base + ".pdb";
 }
 
 std::string cmGeneratorTarget::GetObjectDirectory(
@@ -5202,14 +5222,20 @@
 
 std::string cmGeneratorTarget::GetSupportDirectory() const
 {
-  std::string dir = cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(),
-                             "/CMakeFiles/", this->GetName());
-#if defined(__VMS)
-  dir += "_dir";
-#else
-  dir += ".dir";
-#endif
-  return dir;
+  cmLocalGenerator* lg = this->GetLocalGenerator();
+  return cmStrCat(lg->GetObjectOutputRoot(), '/',
+                  lg->GetTargetDirectory(this));
+}
+
+std::string cmGeneratorTarget::GetCMFSupportDirectory() const
+{
+  cmLocalGenerator* lg = this->GetLocalGenerator();
+  if (!lg->AlwaysUsesCMFPaths()) {
+    return cmStrCat(lg->GetCurrentBinaryDirectory(), "/CMakeFiles/",
+                    lg->GetTargetDirectory(this));
+  }
+  return cmStrCat(lg->GetObjectOutputRoot(), '/',
+                  lg->GetTargetDirectory(this));
 }
 
 bool cmGeneratorTarget::IsLinkable() const
@@ -5417,17 +5443,17 @@
     bool first = true;
     for (auto const& config : this->Makefile->GetGeneratorConfigs(
            cmMakefile::GeneratorConfigQuery::IncludeEmptyConfig)) {
+      cm::GenEx::Context context(this->LocalGenerator, config);
       if (first || dirCgesContextSensitive) {
-        dirs = fileSet->EvaluateDirectoryEntries(dirCges, this->LocalGenerator,
-                                                 config, this);
+        dirs = fileSet->EvaluateDirectoryEntries(dirCges, context, this);
         dirCgesContextSensitive =
           std::any_of(dirCges.begin(), dirCges.end(), contextSensitive);
       }
       if (first || fileCgesContextSensitive) {
         filesPerDir.clear();
         for (auto const& fileCge : fileCges) {
-          fileSet->EvaluateFileEntry(dirs, filesPerDir, fileCge,
-                                     this->LocalGenerator, config, this);
+          fileSet->EvaluateFileEntry(dirs, filesPerDir, fileCge, context,
+                                     this);
           if (fileCge->GetHadContextSensitiveCondition()) {
             fileCgesContextSensitive = true;
           }
@@ -5474,7 +5500,7 @@
           }
 
           if (fileCgesContextSensitive) {
-            filename = cmStrCat("$<$<CONFIG:", config, ">:", filename, ">");
+            filename = cmStrCat("$<$<CONFIG:", config, ">:", filename, '>');
           }
           verifyTarget->AddSource(filename);
         }
@@ -5755,7 +5781,8 @@
       cmStrCat("The target named \"", this->GetName(),
                "\" has C++ sources that may use modules, but modules are not "
                "supported by this generator:\n  ",
-               this->GetGlobalGenerator()->GetName(), '\n',
+               this->GetGlobalGenerator()->GetName(),
+               "\n"
                "Modules are supported only by Ninja, Ninja Multi-Config, "
                "and Visual Studio generators for VS 17.4 and newer.  "
                "See the cmake-cxxmodules(7) manual for details.  "
@@ -5957,15 +5984,16 @@
       continue;
     }
 
+    cm::GenEx::Context context(this->LocalGenerator, config);
+
     auto fileEntries = file_set->CompileFileEntries();
     auto directoryEntries = file_set->CompileDirectoryEntries();
-    auto directories = file_set->EvaluateDirectoryEntries(
-      directoryEntries, this->LocalGenerator, config, this);
+    auto directories =
+      file_set->EvaluateDirectoryEntries(directoryEntries, context, this);
 
     std::map<std::string, std::vector<std::string>> files;
     for (auto const& entry : fileEntries) {
-      file_set->EvaluateFileEntry(directories, files, entry,
-                                  this->LocalGenerator, config, this);
+      file_set->EvaluateFileEntry(directories, files, entry, context, this);
     }
 
     for (auto const& it : files) {
@@ -5986,8 +6014,15 @@
 
 std::string cmGeneratorTarget::GetSwiftModuleFileName() const
 {
-  return this->GetPropertyOrDefault(
+  std::string moduleFilename = this->GetPropertyOrDefault(
     "Swift_MODULE", this->GetSwiftModuleName() + ".swiftmodule");
+  if (this->GetPolicyStatusCMP0195() == cmPolicies::NEW) {
+    if (cmValue moduleTriple =
+          this->Makefile->GetDefinition("CMAKE_Swift_MODULE_TRIPLE")) {
+      moduleFilename += "/" + *moduleTriple + ".swiftmodule";
+    }
+  }
+  return moduleFilename;
 }
 
 std::string cmGeneratorTarget::GetSwiftModuleDirectory(
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 083de54..6fd29de 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -25,6 +25,13 @@
 #include "cmStateTypes.h"
 #include "cmValue.h"
 
+namespace cm {
+namespace GenEx {
+struct Context;
+struct Evaluation;
+}
+}
+
 class cmake;
 enum class cmBuildStep;
 class cmCompiledGeneratorExpression;
@@ -38,7 +45,6 @@
 struct cmSyntheticTargetCache;
 class cmTarget;
 
-struct cmGeneratorExpressionContext;
 struct cmGeneratorExpressionDAGChecker;
 
 class cmGeneratorTarget
@@ -935,6 +941,7 @@
 
   /** Get a build-tree directory in which to place target support files.  */
   std::string GetSupportDirectory() const;
+  std::string GetCMFSupportDirectory() const;
 
   /** Return whether this target may be used to link another target.  */
   bool IsLinkable() const;
@@ -953,7 +960,7 @@
   /** Return whether this target is an executable Bundle on Apple.  */
   bool IsAppBundleOnApple() const;
 
-  /** Return whether this target is a XCTest on Apple.  */
+  /** Return whether this target is an XCTest on Apple.  */
   bool IsXCTestOnApple() const;
 
   /** Return whether this target is a CFBundle (plugin) on Apple.  */
@@ -985,7 +992,7 @@
   class TargetPropertyEntry;
 
   std::string EvaluateInterfaceProperty(
-    std::string const& prop, cmGeneratorExpressionContext* context,
+    std::string const& prop, cm::GenEx::Evaluation* eval,
     cmGeneratorExpressionDAGChecker* dagCheckerParent, UseTo usage) const;
 
   struct TransitiveProperty
@@ -1005,8 +1012,7 @@
     BuiltinTransitiveProperties;
 
   cm::optional<TransitiveProperty> IsTransitiveProperty(
-    cm::string_view prop, cmLocalGenerator const* lg,
-    std::string const& config,
+    cm::string_view prop, cm::GenEx::Context const& context,
     cmGeneratorExpressionDAGChecker const* dagChecker) const;
 
   bool HaveInstallTreeRPATH(std::string const& config) const;
@@ -1295,7 +1301,7 @@
 
   mutable std::unordered_map<std::string, bool> MaybeInterfacePropertyExists;
   bool MaybeHaveInterfaceProperty(std::string const& prop,
-                                  cmGeneratorExpressionContext* context,
+                                  cm::GenEx::Evaluation* eval,
                                   UseTo usage) const;
 
   using TargetPropertyEntryVector =
@@ -1372,6 +1378,9 @@
   using OutputInfoMapType = std::map<std::string, OutputInfo>;
   mutable OutputInfoMapType OutputInfoMap;
 
+  using PdbOutputNameMapType = std::map<std::string, std::string>;
+  mutable PdbOutputNameMapType PdbOutputNameMap;
+
   using ModuleDefinitionInfoMapType =
     std::map<std::string, ModuleDefinitionInfo>;
   mutable ModuleDefinitionInfoMapType ModuleDefinitionInfoMap;
@@ -1534,10 +1543,8 @@
     cmFileSet const* fileSet, cmLinkImplItem const& item = NoLinkImplItem);
 
   virtual std::string const& Evaluate(
-    cmLocalGenerator* lg, std::string const& config,
-    cmGeneratorTarget const* headTarget,
-    cmGeneratorExpressionDAGChecker* dagChecker,
-    std::string const& language) const = 0;
+    cm::GenEx::Context const& context, cmGeneratorTarget const* headTarget,
+    cmGeneratorExpressionDAGChecker* dagChecker) const = 0;
 
   virtual cmListFileBacktrace GetBacktrace() const = 0;
   virtual std::string const& GetInput() const = 0;
diff --git a/Source/cmGeneratorTarget_IncludeDirectories.cxx b/Source/cmGeneratorTarget_IncludeDirectories.cxx
index 9f4c09a..fb6b0c1 100644
--- a/Source/cmGeneratorTarget_IncludeDirectories.cxx
+++ b/Source/cmGeneratorTarget_IncludeDirectories.cxx
@@ -17,6 +17,7 @@
 #include <cmext/algorithm>
 
 #include "cmEvaluatedTargetProperty.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGlobalGenerator.h"
 #include "cmLinkItem.h"
@@ -44,16 +45,12 @@
   cmGeneratorTarget const* root, cmGeneratorTarget const* target,
   std::string const& lang, std::string const& config,
   std::string const& propertyName, IncludeDirectoryFallBack mode,
-  cmGeneratorExpressionDAGChecker* context)
+  cmGeneratorExpressionDAGChecker* dagCheckerParent)
 {
+  cm::GenEx::Context context(target->LocalGenerator, config);
   cmGeneratorExpressionDAGChecker dagChecker{
-    target,
-    propertyName,
-    nullptr,
-    context,
-    target->GetLocalGenerator(),
-    config,
-    target->GetBacktrace(),
+    target,           propertyName, nullptr,
+    dagCheckerParent, context,      target->GetBacktrace(),
   };
   switch (dagChecker.Check()) {
     case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
@@ -81,8 +78,7 @@
             if (mode == IncludeDirectoryFallBack::BINARY) {
               value = lg->GetCurrentBinaryDirectory();
             } else if (mode == IncludeDirectoryFallBack::OBJECT) {
-              value = cmStrCat(lg->GetCurrentBinaryDirectory(), '/',
-                               lg->GetTargetDirectory(dependency));
+              value = dependency->GetSupportDirectory();
             }
           }
 
@@ -104,14 +100,9 @@
 {
   if (auto const* libraries =
         target->GetLinkImplementationLibraries(config, UseTo::Compile)) {
+    cm::GenEx::Context context(target->LocalGenerator, config, lang);
     cmGeneratorExpressionDAGChecker dagChecker{
-      target,
-      propertyName,
-      nullptr,
-      nullptr,
-      target->GetLocalGenerator(),
-      config,
-      target->GetBacktrace(),
+      target, propertyName, nullptr, nullptr, context, target->GetBacktrace(),
     };
 
     for (cmLinkImplItem const& library : libraries->Libraries) {
@@ -138,8 +129,8 @@
           }
 
           cmExpandList(AddLangSpecificInterfaceIncludeDirectories(
-                         target, dependency, lang, config, propertyName, mode,
-                         &dagChecker),
+                         target, dependency, context.Language, context.Config,
+                         propertyName, mode, &dagChecker),
                        entry.Values);
           entries.Entries.emplace_back(std::move(entry));
         }
@@ -232,9 +223,10 @@
   std::vector<BT<std::string>> includes;
   std::unordered_set<std::string> uniqueIncludes;
 
+  cm::GenEx::Context context(this->LocalGenerator, config, lang);
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this,    "INCLUDE_DIRECTORIES", nullptr,
-    nullptr, this->LocalGenerator,  config,
+    this, "INCLUDE_DIRECTORIES", nullptr, nullptr, context,
   };
 
   cmList debugProperties{ this->Makefile->GetDefinition(
@@ -245,7 +237,7 @@
   this->DebugIncludesDone = true;
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, lang, &dagChecker, this->IncludeDirectoriesEntries);
+    this, context, &dagChecker, this->IncludeDirectoriesEntries);
 
   if (lang == "Swift") {
     AddLangSpecificImplicitIncludeDirectories(
@@ -272,7 +264,7 @@
       entries);
   }
 
-  AddInterfaceEntries(this, config, "INTERFACE_INCLUDE_DIRECTORIES", lang,
+  AddInterfaceEntries(this, "INTERFACE_INCLUDE_DIRECTORIES", context,
                       &dagChecker, entries, IncludeRuntimeInterface::Yes);
 
   processIncludeDirectories(this, entries, includes, uniqueIncludes,
diff --git a/Source/cmGeneratorTarget_Link.cxx b/Source/cmGeneratorTarget_Link.cxx
index f0e527c..4e43e6d 100644
--- a/Source/cmGeneratorTarget_Link.cxx
+++ b/Source/cmGeneratorTarget_Link.cxx
@@ -25,6 +25,7 @@
 
 #include "cmAlgorithms.h"
 #include "cmComputeLinkInformation.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGlobalGenerator.h"
@@ -450,9 +451,8 @@
     e = cmStrCat(e, "The link interface of target \"", this->GetName(),
                  "\" contains");
   }
-  e =
-    cmStrCat(e, ":\n  ", item.AsStr(), "\n", "but the target was not found.  ",
-             missingTargetPossibleReasons);
+  e = cmStrCat(e, ":\n  ", item.AsStr(), "\nbut the target was not found.  ",
+               missingTargetPossibleReasons);
   cmListFileBacktrace backtrace = item.Backtrace;
   if (backtrace.Empty()) {
     backtrace = this->GetBacktrace();
@@ -542,13 +542,14 @@
     return;
   }
   // Keep this logic in sync with ComputeLinkImplementationLibraries.
+  cm::GenEx::Context context(this->LocalGenerator, config,
+                             headTarget->LinkerLanguage);
   cmGeneratorExpressionDAGChecker dagChecker{
     this,
     prop,
     nullptr,
     nullptr,
-    this->LocalGenerator,
-    config,
+    context,
     cmListFileBacktrace(),
     cmGeneratorExpressionDAGChecker::ComputingLinkLibraries::Yes,
   };
@@ -566,9 +567,7 @@
                              entry.Backtrace);
     std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(entry.Value);
     cge->SetEvaluateForBuildsystem(true);
-    cmList libs{ cge->Evaluate(this->LocalGenerator, config, headTarget,
-                               &dagChecker, this,
-                               headTarget->LinkerLanguage) };
+    cmList libs{ cge->Evaluate(context, &dagChecker, headTarget, this) };
 
     auto linkFeature = cmLinkItem::DEFAULT;
     for (auto const& lib : libs) {
@@ -1134,6 +1133,8 @@
   std::string const& config, cmOptionalLinkImplementation& impl,
   UseTo usage) const
 {
+  cm::GenEx::Context context(this->LocalGenerator, config,
+                             this->LinkerLanguage);
   cmLocalGenerator const* lg = this->LocalGenerator;
   cmMakefile const* mf = lg->GetMakefile();
   cmBTStringRange entryRange = this->Target->GetLinkImplementationEntries();
@@ -1146,8 +1147,7 @@
       "LINK_LIBRARIES",
       nullptr,
       nullptr,
-      this->LocalGenerator,
-      config,
+      context,
       cmListFileBacktrace(),
       cmGeneratorExpressionDAGChecker::ComputingLinkLibraries::Yes,
     };
@@ -1169,9 +1169,7 @@
     std::unique_ptr<cmCompiledGeneratorExpression> const cge =
       ge.Parse(entry.Value);
     cge->SetEvaluateForBuildsystem(true);
-    std::string const& evaluated =
-      cge->Evaluate(this->LocalGenerator, config, this, &dagChecker, nullptr,
-                    this->LinkerLanguage);
+    std::string const& evaluated = cge->Evaluate(context, &dagChecker, this);
     cmList llibs(evaluated);
     if (cge->GetHadHeadSensitiveCondition()) {
       impl.HadHeadSensitiveCondition = true;
diff --git a/Source/cmGeneratorTarget_LinkDirectories.cxx b/Source/cmGeneratorTarget_LinkDirectories.cxx
index 4846d6f..7b34b8f 100644
--- a/Source/cmGeneratorTarget_LinkDirectories.cxx
+++ b/Source/cmGeneratorTarget_LinkDirectories.cxx
@@ -14,6 +14,7 @@
 #include <cmext/algorithm>
 
 #include "cmEvaluatedTargetProperty.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmLinkItem.h"
 #include "cmList.h"
@@ -122,8 +123,9 @@
   std::vector<BT<std::string>> result;
   std::unordered_set<std::string> uniqueDirectories;
 
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "LINK_DIRECTORIES", nullptr, nullptr, this->LocalGenerator, config,
+    this, "LINK_DIRECTORIES", nullptr, nullptr, context,
   };
 
   cmList debugProperties{ this->Makefile->GetDefinition(
@@ -134,10 +136,10 @@
   this->DebugLinkDirectoriesDone = true;
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, language, &dagChecker, this->LinkDirectoriesEntries);
+    this, context, &dagChecker, this->LinkDirectoriesEntries);
 
-  AddInterfaceEntries(this, config, "INTERFACE_LINK_DIRECTORIES", language,
-                      &dagChecker, entries, IncludeRuntimeInterface::Yes,
+  AddInterfaceEntries(this, "INTERFACE_LINK_DIRECTORIES", context, &dagChecker,
+                      entries, IncludeRuntimeInterface::Yes,
                       this->GetPolicyStatusCMP0099() == cmPolicies::NEW
                         ? UseTo::Link
                         : UseTo::Compile);
diff --git a/Source/cmGeneratorTarget_Options.cxx b/Source/cmGeneratorTarget_Options.cxx
index 63baa1d..012e645 100644
--- a/Source/cmGeneratorTarget_Options.cxx
+++ b/Source/cmGeneratorTarget_Options.cxx
@@ -18,6 +18,7 @@
 #include <cmext/string_view>
 
 #include "cmEvaluatedTargetProperty.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmList.h"
 #include "cmListFileCache.h"
@@ -230,8 +231,10 @@
   std::vector<BT<std::string>> result;
   std::unordered_set<std::string> uniqueOptions;
 
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "COMPILE_OPTIONS", nullptr, nullptr, this->LocalGenerator, config,
+    this, "COMPILE_OPTIONS", nullptr, nullptr, context,
   };
 
   cmList debugProperties{ this->Makefile->GetDefinition(
@@ -242,10 +245,10 @@
   this->DebugCompileOptionsDone = true;
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, language, &dagChecker, this->CompileOptionsEntries);
+    this, context, &dagChecker, this->CompileOptionsEntries);
 
-  AddInterfaceEntries(this, config, "INTERFACE_COMPILE_OPTIONS", language,
-                      &dagChecker, entries, IncludeRuntimeInterface::Yes);
+  AddInterfaceEntries(this, "INTERFACE_COMPILE_OPTIONS", context, &dagChecker,
+                      entries, IncludeRuntimeInterface::Yes);
 
   processOptions(this, entries, result, uniqueOptions, debugOptions,
                  "compile options", OptionsParse::Shell);
@@ -270,8 +273,11 @@
   std::vector<BT<std::string>> result;
   std::unordered_set<std::string> uniqueFeatures;
 
+  cm::GenEx::Context context(this->LocalGenerator, config,
+                             /*language=*/std::string());
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "COMPILE_FEATURES", nullptr, nullptr, this->LocalGenerator, config,
+    this, "COMPILE_FEATURES", nullptr, nullptr, context,
   };
 
   cmList debugProperties{ this->Makefile->GetDefinition(
@@ -282,11 +288,10 @@
   this->DebugCompileFeaturesDone = true;
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, std::string(), &dagChecker, this->CompileFeaturesEntries);
+    this, context, &dagChecker, this->CompileFeaturesEntries);
 
-  AddInterfaceEntries(this, config, "INTERFACE_COMPILE_FEATURES",
-                      std::string(), &dagChecker, entries,
-                      IncludeRuntimeInterface::Yes);
+  AddInterfaceEntries(this, "INTERFACE_COMPILE_FEATURES", context, &dagChecker,
+                      entries, IncludeRuntimeInterface::Yes);
 
   processOptions(this, entries, result, uniqueFeatures, debugFeatures,
                  "compile features", OptionsParse::None);
@@ -319,9 +324,10 @@
   std::vector<BT<std::string>> list;
   std::unordered_set<std::string> uniqueOptions;
 
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this,    "COMPILE_DEFINITIONS", nullptr,
-    nullptr, this->LocalGenerator,  config,
+    this, "COMPILE_DEFINITIONS", nullptr, nullptr, context,
   };
 
   cmList debugProperties{ this->Makefile->GetDefinition(
@@ -332,9 +338,9 @@
   this->DebugCompileDefinitionsDone = true;
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, language, &dagChecker, this->CompileDefinitionsEntries);
+    this, context, &dagChecker, this->CompileDefinitionsEntries);
 
-  AddInterfaceEntries(this, config, "INTERFACE_COMPILE_DEFINITIONS", language,
+  AddInterfaceEntries(this, "INTERFACE_COMPILE_DEFINITIONS", context,
                       &dagChecker, entries, IncludeRuntimeInterface::Yes);
 
   processOptions(this, entries, list, uniqueOptions, debugDefines,
@@ -356,8 +362,10 @@
   }
   std::unordered_set<std::string> uniqueOptions;
 
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "PRECOMPILE_HEADERS", nullptr, nullptr, this->LocalGenerator, config,
+    this, "PRECOMPILE_HEADERS", nullptr, nullptr, context,
   };
 
   cmList debugProperties{ this->Makefile->GetDefinition(
@@ -369,9 +377,9 @@
   this->DebugPrecompileHeadersDone = true;
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, language, &dagChecker, this->PrecompileHeadersEntries);
+    this, context, &dagChecker, this->PrecompileHeadersEntries);
 
-  AddInterfaceEntries(this, config, "INTERFACE_PRECOMPILE_HEADERS", language,
+  AddInterfaceEntries(this, "INTERFACE_PRECOMPILE_HEADERS", context,
                       &dagChecker, entries, IncludeRuntimeInterface::Yes);
 
   std::vector<BT<std::string>> list;
@@ -413,8 +421,10 @@
   std::vector<BT<std::string>> result;
   std::unordered_set<std::string> uniqueOptions;
 
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "LINK_OPTIONS", nullptr, nullptr, this->LocalGenerator, config,
+    this, "LINK_OPTIONS", nullptr, nullptr, context,
   };
 
   cmList debugProperties{ this->Makefile->GetDefinition(
@@ -425,10 +435,10 @@
   this->DebugLinkOptionsDone = true;
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, language, &dagChecker, this->LinkOptionsEntries);
+    this, context, &dagChecker, this->LinkOptionsEntries);
 
-  AddInterfaceEntries(this, config, "INTERFACE_LINK_OPTIONS", language,
-                      &dagChecker, entries, IncludeRuntimeInterface::Yes,
+  AddInterfaceEntries(this, "INTERFACE_LINK_OPTIONS", context, &dagChecker,
+                      entries, IncludeRuntimeInterface::Yes,
                       this->GetPolicyStatusCMP0099() == cmPolicies::NEW
                         ? UseTo::Link
                         : UseTo::Compile);
@@ -595,17 +605,18 @@
   std::vector<BT<std::string>> result;
   std::unordered_set<std::string> uniqueOptions;
 
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this,    "STATIC_LIBRARY_OPTIONS", nullptr,
-    nullptr, this->LocalGenerator,     config,
+    this, "STATIC_LIBRARY_OPTIONS", nullptr, nullptr, context,
   };
 
   EvaluatedTargetPropertyEntries entries;
   if (cmValue linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) {
     std::unique_ptr<TargetPropertyEntry> entry = TargetPropertyEntry::Create(
       *this->LocalGenerator->GetCMakeInstance(), *linkOptions);
-    entries.Entries.emplace_back(EvaluateTargetPropertyEntry(
-      this, config, language, &dagChecker, *entry));
+    entries.Entries.emplace_back(
+      EvaluateTargetPropertyEntry(this, context, &dagChecker, *entry));
   }
   processOptions(this, entries, result, uniqueOptions, false,
                  "static library link options", OptionsParse::Shell);
@@ -640,8 +651,9 @@
 {
   std::vector<BT<std::string>> result;
   std::unordered_set<std::string> uniqueOptions;
+  cm::GenEx::Context context(this->LocalGenerator, config, language);
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "LINK_DEPENDS", nullptr, nullptr, this->LocalGenerator, config,
+    this, "LINK_DEPENDS", nullptr, nullptr, context,
   };
 
   EvaluatedTargetPropertyEntries entries;
@@ -650,12 +662,12 @@
     for (auto const& depend : depends) {
       std::unique_ptr<TargetPropertyEntry> entry = TargetPropertyEntry::Create(
         *this->LocalGenerator->GetCMakeInstance(), depend);
-      entries.Entries.emplace_back(EvaluateTargetPropertyEntry(
-        this, config, language, &dagChecker, *entry));
+      entries.Entries.emplace_back(
+        EvaluateTargetPropertyEntry(this, context, &dagChecker, *entry));
     }
   }
-  AddInterfaceEntries(this, config, "INTERFACE_LINK_DEPENDS", language,
-                      &dagChecker, entries, IncludeRuntimeInterface::Yes,
+  AddInterfaceEntries(this, "INTERFACE_LINK_DEPENDS", context, &dagChecker,
+                      entries, IncludeRuntimeInterface::Yes,
                       this->GetPolicyStatusCMP0099() == cmPolicies::NEW
                         ? UseTo::Link
                         : UseTo::Compile);
diff --git a/Source/cmGeneratorTarget_Sources.cxx b/Source/cmGeneratorTarget_Sources.cxx
index fa27998..3c58c81 100644
--- a/Source/cmGeneratorTarget_Sources.cxx
+++ b/Source/cmGeneratorTarget_Sources.cxx
@@ -24,6 +24,7 @@
 #include "cmAlgorithms.h"
 #include "cmEvaluatedTargetProperty.h"
 #include "cmFileSet.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGlobalGenerator.h"
@@ -46,12 +47,13 @@
 using UseTo = cmGeneratorTarget::UseTo;
 
 void AddObjectEntries(cmGeneratorTarget const* headTarget,
-                      std::string const& config,
+                      cm::GenEx::Context const& context,
                       cmGeneratorExpressionDAGChecker* dagChecker,
                       EvaluatedTargetPropertyEntries& entries)
 {
   if (cmLinkImplementationLibraries const* impl =
-        headTarget->GetLinkImplementationLibraries(config, UseTo::Link)) {
+        headTarget->GetLinkImplementationLibraries(context.Config,
+                                                   UseTo::Link)) {
     entries.HadContextSensitiveCondition = impl->HadContextSensitiveCondition;
     for (cmLinkImplItem const& lib : impl->Libraries) {
       if (lib.Target &&
@@ -66,8 +68,7 @@
         cge->SetEvaluateForBuildsystem(true);
 
         EvaluatedTargetPropertyEntry ee(lib, lib.Backtrace);
-        cmExpandList(cge->Evaluate(headTarget->GetLocalGenerator(), config,
-                                   headTarget, dagChecker),
+        cmExpandList(cge->Evaluate(context, dagChecker, headTarget),
                      ee.Values);
         if (cge->GetHadContextSensitiveCondition()) {
           ee.ContextDependent = true;
@@ -79,14 +80,14 @@
 }
 
 void addFileSetEntry(cmGeneratorTarget const* headTarget,
-                     std::string const& config,
+                     cm::GenEx::Context const& context,
                      cmGeneratorExpressionDAGChecker* dagChecker,
                      cmFileSet const* fileSet,
                      EvaluatedTargetPropertyEntries& entries)
 {
   auto dirCges = fileSet->CompileDirectoryEntries();
-  auto dirs = fileSet->EvaluateDirectoryEntries(
-    dirCges, headTarget->GetLocalGenerator(), config, headTarget, dagChecker);
+  auto dirs = fileSet->EvaluateDirectoryEntries(dirCges, context, headTarget,
+                                                dagChecker);
   bool contextSensitiveDirs = false;
   for (auto const& dirCge : dirCges) {
     if (dirCge->GetHadContextSensitiveCondition()) {
@@ -99,7 +100,7 @@
     auto tpe = cmGeneratorTarget::TargetPropertyEntry::CreateFileSet(
       dirs, contextSensitiveDirs, std::move(entryCge), fileSet);
     entries.Entries.emplace_back(
-      EvaluateTargetPropertyEntry(headTarget, config, "", dagChecker, *tpe));
+      EvaluateTargetPropertyEntry(headTarget, context, dagChecker, *tpe));
     EvaluatedTargetPropertyEntry const& entry = entries.Entries.back();
     for (auto const& file : entry.Values) {
       auto* sf = headTarget->Makefile->GetOrCreateSource(file);
@@ -139,20 +140,20 @@
 }
 
 void AddFileSetEntries(cmGeneratorTarget const* headTarget,
-                       std::string const& config,
+                       cm::GenEx::Context const& context,
                        cmGeneratorExpressionDAGChecker* dagChecker,
                        EvaluatedTargetPropertyEntries& entries)
 {
   for (auto const& entry : headTarget->Target->GetHeaderSetsEntries()) {
     for (auto const& name : cmList{ entry.Value }) {
       auto const* headerSet = headTarget->Target->GetFileSet(name);
-      addFileSetEntry(headTarget, config, dagChecker, headerSet, entries);
+      addFileSetEntry(headTarget, context, dagChecker, headerSet, entries);
     }
   }
   for (auto const& entry : headTarget->Target->GetCxxModuleSetsEntries()) {
     for (auto const& name : cmList{ entry.Value }) {
       auto const* cxxModuleSet = headTarget->Target->GetFileSet(name);
-      addFileSetEntry(headTarget, config, dagChecker, cxxModuleSet, entries);
+      addFileSetEntry(headTarget, context, dagChecker, cxxModuleSet, entries);
     }
   }
 }
@@ -240,12 +241,15 @@
 
   this->DebugSourcesDone = true;
 
+  cm::GenEx::Context context(this->LocalGenerator, config,
+                             /*language=*/std::string());
+
   cmGeneratorExpressionDAGChecker dagChecker{
-    this, "SOURCES", nullptr, nullptr, this->LocalGenerator, config,
+    this, "SOURCES", nullptr, nullptr, context,
   };
 
   EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
-    this, config, std::string(), &dagChecker, this->SourceEntries);
+    this, context, &dagChecker, this->SourceEntries);
 
   std::unordered_set<std::string> uniqueSrcs;
   bool contextDependentDirectSources =
@@ -253,9 +257,9 @@
 
   // Collect INTERFACE_SOURCES of all direct link-dependencies.
   EvaluatedTargetPropertyEntries linkInterfaceSourcesEntries;
-  AddInterfaceEntries(this, config, "INTERFACE_SOURCES", std::string(),
-                      &dagChecker, linkInterfaceSourcesEntries,
-                      IncludeRuntimeInterface::No, UseTo::Compile);
+  AddInterfaceEntries(this, "INTERFACE_SOURCES", context, &dagChecker,
+                      linkInterfaceSourcesEntries, IncludeRuntimeInterface::No,
+                      UseTo::Compile);
   bool contextDependentInterfaceSources = processSources(
     this, linkInterfaceSourcesEntries, files, uniqueSrcs, debugSources);
 
@@ -263,7 +267,7 @@
   bool contextDependentObjects = false;
   if (this->GetType() != cmStateEnums::OBJECT_LIBRARY) {
     EvaluatedTargetPropertyEntries linkObjectsEntries;
-    AddObjectEntries(this, config, &dagChecker, linkObjectsEntries);
+    AddObjectEntries(this, context, &dagChecker, linkObjectsEntries);
     contextDependentObjects = processSources(this, linkObjectsEntries, files,
                                              uniqueSrcs, debugSources);
     // Note that for imported targets or multi-config generators supporting
@@ -274,7 +278,7 @@
 
   // Collect this target's file sets.
   EvaluatedTargetPropertyEntries fileSetEntries;
-  AddFileSetEntries(this, config, &dagChecker, fileSetEntries);
+  AddFileSetEntries(this, context, &dagChecker, fileSetEntries);
   bool contextDependentFileSets =
     processSources(this, fileSetEntries, files, uniqueSrcs, debugSources);
 
diff --git a/Source/cmGeneratorTarget_TargetPropertyEntry.cxx b/Source/cmGeneratorTarget_TargetPropertyEntry.cxx
index 90a3ca8..d90fa37 100644
--- a/Source/cmGeneratorTarget_TargetPropertyEntry.cxx
+++ b/Source/cmGeneratorTarget_TargetPropertyEntry.cxx
@@ -17,7 +17,12 @@
 #include "cmList.h"
 #include "cmListFileCache.h"
 
-class cmLocalGenerator;
+namespace cm {
+namespace GenEx {
+struct Context;
+}
+}
+
 class cmake;
 struct cmGeneratorExpressionDAGChecker;
 
@@ -33,10 +38,9 @@
   {
   }
 
-  std::string const& Evaluate(cmLocalGenerator*, std::string const&,
+  std::string const& Evaluate(cm::GenEx::Context const&,
                               cmGeneratorTarget const*,
-                              cmGeneratorExpressionDAGChecker*,
-                              std::string const&) const override
+                              cmGeneratorExpressionDAGChecker*) const override
   {
     return this->PropertyValue.Value;
   }
@@ -64,13 +68,11 @@
   {
   }
 
-  std::string const& Evaluate(cmLocalGenerator* lg, std::string const& config,
-                              cmGeneratorTarget const* headTarget,
-                              cmGeneratorExpressionDAGChecker* dagChecker,
-                              std::string const& language) const override
+  std::string const& Evaluate(
+    cm::GenEx::Context const& context, cmGeneratorTarget const* headTarget,
+    cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
-    return this->ge->Evaluate(lg, config, headTarget, dagChecker, nullptr,
-                              language);
+    return this->ge->Evaluate(context, dagChecker, headTarget);
   }
 
   cmListFileBacktrace GetBacktrace() const override
@@ -105,14 +107,13 @@
   {
   }
 
-  std::string const& Evaluate(cmLocalGenerator* lg, std::string const& config,
-                              cmGeneratorTarget const* headTarget,
-                              cmGeneratorExpressionDAGChecker* dagChecker,
-                              std::string const& /*lang*/) const override
+  std::string const& Evaluate(
+    cm::GenEx::Context const& context, cmGeneratorTarget const* headTarget,
+    cmGeneratorExpressionDAGChecker* dagChecker) const override
   {
     std::map<std::string, std::vector<std::string>> filesPerDir;
     this->FileSet->EvaluateFileEntry(this->BaseDirs, filesPerDir,
-                                     this->EntryCge, lg, config, headTarget,
+                                     this->EntryCge, context, headTarget,
                                      dagChecker);
 
     std::vector<std::string> files;
diff --git a/Source/cmGeneratorTarget_TransitiveProperty.cxx b/Source/cmGeneratorTarget_TransitiveProperty.cxx
index 3cc2fe4..4f3c478 100644
--- a/Source/cmGeneratorTarget_TransitiveProperty.cxx
+++ b/Source/cmGeneratorTarget_TransitiveProperty.cxx
@@ -15,8 +15,9 @@
 #include <cm/string_view>
 #include <cmext/string_view>
 
+#include "cmGenExContext.h"
+#include "cmGenExEvaluation.h"
 #include "cmGeneratorExpression.h"
-#include "cmGeneratorExpressionContext.h"
 #include "cmGeneratorExpressionDAGChecker.h"
 #include "cmGeneratorExpressionNode.h"
 #include "cmLinkItem.h"
@@ -29,6 +30,11 @@
 namespace {
 using UseTo = cmGeneratorTarget::UseTo;
 using TransitiveProperty = cmGeneratorTarget::TransitiveProperty;
+
+bool ComputingLinkLibraries(cmGeneratorExpressionDAGChecker const* dagChecker)
+{
+  return dagChecker && dagChecker->IsComputingLinkLibraries();
+}
 }
 
 std::map<cm::string_view, TransitiveProperty> const
@@ -45,6 +51,7 @@
       { "INTERFACE_INCLUDE_DIRECTORIES"_s, UseTo::Compile } },
     { "LINK_DEPENDS"_s, { "INTERFACE_LINK_DEPENDS"_s, UseTo::Link } },
     { "LINK_DIRECTORIES"_s, { "INTERFACE_LINK_DIRECTORIES"_s, UseTo::Link } },
+    { "LINK_LIBRARIES"_s, { "INTERFACE_LINK_LIBRARIES"_s, UseTo::Link } },
     { "LINK_OPTIONS"_s, { "INTERFACE_LINK_OPTIONS"_s, UseTo::Link } },
     { "PRECOMPILE_HEADERS"_s,
       { "INTERFACE_PRECOMPILE_HEADERS"_s, UseTo::Compile } },
@@ -53,11 +60,11 @@
       { "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES"_s, UseTo::Compile } },
   };
 
-bool cmGeneratorTarget::MaybeHaveInterfaceProperty(
-  std::string const& prop, cmGeneratorExpressionContext* context,
-  UseTo usage) const
+bool cmGeneratorTarget::MaybeHaveInterfaceProperty(std::string const& prop,
+                                                   cm::GenEx::Evaluation* eval,
+                                                   UseTo usage) const
 {
-  std::string const key = prop + '@' + context->Config;
+  std::string const key = prop + '@' + eval->Context.Config;
   auto i = this->MaybeInterfacePropertyExists.find(key);
   if (i == this->MaybeInterfacePropertyExists.end()) {
     // Insert an entry now in case there is a cycle.
@@ -70,9 +77,9 @@
     // Otherwise, recurse to interface dependencies.
     if (!maybeInterfaceProp) {
       cmGeneratorTarget const* headTarget =
-        context->HeadTarget ? context->HeadTarget : this;
+        eval->HeadTarget ? eval->HeadTarget : this;
       if (cmLinkInterfaceLibraries const* iface =
-            this->GetLinkInterfaceLibraries(context->Config, headTarget,
+            this->GetLinkInterfaceLibraries(eval->Context.Config, headTarget,
                                             usage)) {
         if (iface->HadHeadSensitiveCondition) {
           // With a different head target we may get to a library with
@@ -83,7 +90,7 @@
           // head target, so we can follow them.
           for (cmLinkItem const& lib : iface->Libraries) {
             if (lib.Target &&
-                lib.Target->MaybeHaveInterfaceProperty(prop, context, usage)) {
+                lib.Target->MaybeHaveInterfaceProperty(prop, eval, usage)) {
               maybeInterfaceProp = true;
               break;
             }
@@ -96,13 +103,13 @@
 }
 
 std::string cmGeneratorTarget::EvaluateInterfaceProperty(
-  std::string const& prop, cmGeneratorExpressionContext* context,
+  std::string const& prop, cm::GenEx::Evaluation* eval,
   cmGeneratorExpressionDAGChecker* dagCheckerParent, UseTo usage) const
 {
   std::string result;
 
   // If the property does not appear transitively at all, we are done.
-  if (!this->MaybeHaveInterfaceProperty(prop, context, usage)) {
+  if (!this->MaybeHaveInterfaceProperty(prop, eval, usage)) {
     return result;
   }
 
@@ -110,18 +117,12 @@
   // a subset of TargetPropertyNode::Evaluate without stringify/parse steps
   // but sufficient for transitive interface properties.
   cmGeneratorExpressionDAGChecker dagChecker{
-    this,
-    prop,
-    nullptr,
-    dagCheckerParent,
-    context->LG,
-    context->Config,
-    context->Backtrace,
+    this, prop, nullptr, dagCheckerParent, eval->Context, eval->Backtrace,
   };
   switch (dagChecker.Check()) {
     case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
       dagChecker.ReportError(
-        context, "$<TARGET_PROPERTY:" + this->GetName() + "," + prop + ">");
+        eval, "$<TARGET_PROPERTY:" + this->GetName() + "," + prop + ">");
       return result;
     case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE:
       // No error. We just skip cyclic references.
@@ -133,17 +134,16 @@
   }
 
   cmGeneratorTarget const* headTarget =
-    context->HeadTarget ? context->HeadTarget : this;
+    eval->HeadTarget ? eval->HeadTarget : this;
 
   if (cmValue p = this->GetProperty(prop)) {
     result = cmGeneratorExpressionNode::EvaluateDependentExpression(
-      *p, context->LG, context, headTarget, &dagChecker, this);
+      *p, eval, headTarget, &dagChecker, this);
   }
 
-  if (cmLinkInterfaceLibraries const* iface =
-        this->GetLinkInterfaceLibraries(context->Config, headTarget, usage)) {
-    context->HadContextSensitiveCondition =
-      context->HadContextSensitiveCondition ||
+  if (cmLinkInterfaceLibraries const* iface = this->GetLinkInterfaceLibraries(
+        eval->Context.Config, headTarget, usage)) {
+    eval->HadContextSensitiveCondition = eval->HadContextSensitiveCondition ||
       iface->HadContextSensitiveCondition;
     for (cmLinkItem const& lib : iface->Libraries) {
       // Broken code can have a target in its own link interface.
@@ -153,12 +153,11 @@
         // Pretend $<TARGET_PROPERTY:lib.Target,prop> appeared in the
         // above property and hand-evaluate it as if it were compiled.
         // Create a context as cmCompiledGeneratorExpression::Evaluate does.
-        cmGeneratorExpressionContext libContext(
-          context->LG, context->Config, context->Quiet, headTarget, this,
-          context->EvaluateForBuildsystem, context->Backtrace,
-          context->Language);
+        cm::GenEx::Evaluation libEval(eval->Context, eval->Quiet, headTarget,
+                                      this, eval->EvaluateForBuildsystem,
+                                      eval->Backtrace);
         std::string libResult = cmGeneratorExpression::StripEmptyListElements(
-          lib.Target->EvaluateInterfaceProperty(prop, &libContext, &dagChecker,
+          lib.Target->EvaluateInterfaceProperty(prop, &libEval, &dagChecker,
                                                 usage));
         if (!libResult.empty()) {
           if (result.empty()) {
@@ -169,12 +168,11 @@
             result += libResult;
           }
         }
-        context->HadContextSensitiveCondition =
-          context->HadContextSensitiveCondition ||
-          libContext.HadContextSensitiveCondition;
-        context->HadHeadSensitiveCondition =
-          context->HadHeadSensitiveCondition ||
-          libContext.HadHeadSensitiveCondition;
+        eval->HadContextSensitiveCondition =
+          eval->HadContextSensitiveCondition ||
+          libEval.HadContextSensitiveCondition;
+        eval->HadHeadSensitiveCondition =
+          eval->HadHeadSensitiveCondition || libEval.HadHeadSensitiveCondition;
       }
     }
   }
@@ -184,7 +182,7 @@
 
 cm::optional<cmGeneratorTarget::TransitiveProperty>
 cmGeneratorTarget::IsTransitiveProperty(
-  cm::string_view prop, cmLocalGenerator const* lg, std::string const& config,
+  cm::string_view prop, cm::GenEx::Context const& context,
   cmGeneratorExpressionDAGChecker const* dagChecker) const
 {
   cm::optional<TransitiveProperty> result;
@@ -196,22 +194,28 @@
     prop = prop.substr(kINTERFACE_.length());
   }
   auto i = BuiltinTransitiveProperties.find(prop);
+  if (i != BuiltinTransitiveProperties.end() &&
+      // Look up CMP0189 in the context where evaluation occurs,
+      // not where the target was created.
+      context.GetCMP0189() != cmPolicies::NEW && prop == "LINK_LIBRARIES"_s) {
+    i = BuiltinTransitiveProperties.end();
+  }
   if (i != BuiltinTransitiveProperties.end()) {
     result = i->second;
     if (result->Usage != cmGeneratorTarget::UseTo::Compile) {
       cmPolicies::PolicyStatus cmp0166 =
-        lg->GetPolicyStatus(cmPolicies::CMP0166);
+        context.LG->GetPolicyStatus(cmPolicies::CMP0166);
       if ((cmp0166 == cmPolicies::WARN || cmp0166 == cmPolicies::OLD) &&
           (prop == "LINK_DIRECTORIES"_s || prop == "LINK_DEPENDS"_s ||
            prop == "LINK_OPTIONS"_s)) {
         result->Usage = cmGeneratorTarget::UseTo::Compile;
       }
     }
-  } else if (!dagChecker || !dagChecker->IsComputingLinkLibraries()) {
+  } else if (!ComputingLinkLibraries(dagChecker)) {
     // Honor TRANSITIVE_COMPILE_PROPERTIES and TRANSITIVE_LINK_PROPERTIES
     // from the link closure when we are not evaluating the closure itself.
     CustomTransitiveProperties const& ctp =
-      this->GetCustomTransitiveProperties(config, propertyFor);
+      this->GetCustomTransitiveProperties(context.Config, propertyFor);
     auto ci = ctp.find(std::string(prop));
     if (ci != ctp.end()) {
       result = ci->second;
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 2557cf7..3fa494f 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -132,9 +132,8 @@
 
   // Open the target file in copy-if-different mode.
   std::string fproj =
-    cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
-             this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
-             '/', this->Name, cmGlobalGhsMultiGenerator::FILE_EXTENSION);
+    cmStrCat(this->GeneratorTarget->GetSupportDirectory(), '/', this->Name,
+             cmGlobalGhsMultiGenerator::FILE_EXTENSION);
 
   // Tell the global generator the name of the project file
   this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME", fproj);
@@ -179,9 +178,7 @@
    */
   if (this->TagType != GhsMultiGpj::SUBPROJECT) {
     // set target binary file destination
-    std::string binpath = cmStrCat(
-      this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
-      this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget));
+    std::string binpath = this->GeneratorTarget->GetSupportDirectory();
     outpath = cmSystemTools::RelativePath(
       binpath, this->GeneratorTarget->GetDirectory(config));
     /* clang-format off */
@@ -386,10 +383,8 @@
   for (cmCustomCommand const& cc : ccv) {
     cmCustomCommandGenerator ccg(cc, this->ConfigName, this->LocalGenerator);
     // Open the filestream for this custom command
-    std::string fname =
-      cmStrCat(this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
-               this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
-               '/', this->Name, '_', name, cmdcount++, fext);
+    std::string fname = cmStrCat(this->GeneratorTarget->GetSupportDirectory(),
+                                 '/', this->Name, '_', name, cmdcount++, fext);
 
     cmGeneratedFileStream f(fname);
     f.SetCopyIfDifferent(true);
@@ -604,10 +599,8 @@
       cmsys::SystemTools::ReplaceString(gname, "\\", "_");
       std::string lpath =
         cmStrCat(gname, cmGlobalGhsMultiGenerator::FILE_EXTENSION);
-      std::string fpath = cmStrCat(
-        this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
-        this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget), '/',
-        lpath);
+      std::string fpath =
+        cmStrCat(this->GeneratorTarget->GetSupportDirectory(), '/', lpath);
       cmGeneratedFileStream* f = new cmGeneratedFileStream(fpath);
       f->SetCopyIfDifferent(true);
       gfiles.push_back(f);
@@ -700,10 +693,8 @@
 
           // Open the filestream for this custom command
           std::string fname = cmStrCat(
-            this->LocalGenerator->GetCurrentBinaryDirectory(), '/',
-            this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget),
-            '/', this->Name, "_cc", cmdcount++, '_',
-            (sf->GetLocation()).GetName(), fext);
+            this->GeneratorTarget->GetSupportDirectory(), '/', this->Name,
+            "_cc", cmdcount++, '_', (sf->GetLocation()).GetName(), fext);
 
           cmGeneratedFileStream f(fname);
           f.SetCopyIfDifferent(true);
@@ -756,7 +747,7 @@
   std::string ret;
   cmValue rawLangProp = sourceFile->GetProperty("LANGUAGE");
   if (rawLangProp) {
-    ret = cmStrCat(" [", *rawLangProp, "]");
+    ret = cmStrCat(" [", *rawLangProp, ']');
   }
 
   return ret;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index c020bdb..bf15585 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2003,6 +2003,7 @@
   this->GeneratedFiles.clear();
   this->RuntimeDependencySets.clear();
   this->RuntimeDependencySetsByName.clear();
+  this->WarnedExperimental.clear();
 }
 
 void cmGlobalGenerator::ComputeTargetObjectDirectory(
@@ -2407,8 +2408,8 @@
   return false;
 }
 
-bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
-                                   cmLocalGenerator* gen) const
+bool cmGlobalGenerator::IsExcluded(cmLocalGenerator const* root,
+                                   cmLocalGenerator const* gen) const
 {
   assert(gen);
 
@@ -2418,7 +2419,7 @@
   return this->IsExcluded(rootSnp, snp);
 }
 
-bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
+bool cmGlobalGenerator::IsExcluded(cmLocalGenerator const* root,
                                    cmGeneratorTarget const* target) const
 {
   if (!target->IsInBuildSystem()) {
@@ -3635,7 +3636,7 @@
         continue;
       }
       this->WriteSummary(tgt.get());
-      fout << tgt->GetSupportDirectory() << '\n';
+      fout << tgt->GetCMFSupportDirectory() << '\n';
     }
   }
 }
@@ -3643,7 +3644,7 @@
 void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
 {
   // Place the labels file in a per-target support directory.
-  std::string dir = target->GetSupportDirectory();
+  std::string dir = target->GetCMFSupportDirectory();
   std::string file = cmStrCat(dir, "/Labels.txt");
   std::string json_file = cmStrCat(dir, "/Labels.json");
 
@@ -3914,3 +3915,11 @@
                this->InstallScripts.end());
   files.insert(files.end(), this->TestFiles.begin(), this->TestFiles.end());
 }
+
+bool cmGlobalGenerator::ShouldWarnExperimental(cm::string_view featureName,
+                                               cm::string_view featureUuid)
+{
+  return this->WarnedExperimental
+    .emplace(cmStrCat(featureName, '-', featureUuid))
+    .second;
+}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 13526cc..e7b2528 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -16,6 +16,7 @@
 #include <vector>
 
 #include <cm/optional>
+#include <cm/string_view>
 #include <cmext/algorithm>
 #include <cmext/string_view>
 
@@ -681,6 +682,9 @@
     return configs;
   }
 
+  bool ShouldWarnExperimental(cm::string_view featureName,
+                              cm::string_view featureUuid);
+
 protected:
   // for a project collect all its targets by following depend
   // information, and also collect all the targets
@@ -725,8 +729,9 @@
   void CheckTargetProperties();
   bool IsExcluded(cmStateSnapshot const& root,
                   cmStateSnapshot const& snp) const;
-  bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
-  bool IsExcluded(cmLocalGenerator* root,
+  bool IsExcluded(cmLocalGenerator const* root,
+                  cmLocalGenerator const* gen) const;
+  bool IsExcluded(cmLocalGenerator const* root,
                   cmGeneratorTarget const* target) const;
   virtual void InitializeProgressMarks() {}
 
@@ -907,6 +912,8 @@
   // track targets to issue CMP0068 warning for.
   std::set<std::string> CMP0068WarnTargets;
 
+  std::unordered_set<std::string> WarnedExperimental;
+
   mutable std::map<cmSourceFile*, std::set<cmGeneratorTarget const*>>
     FilenameTargetDepends;
 
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 1b52a11..e918268 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -69,9 +69,7 @@
   cmGeneratorTarget* gt) const
 {
   // Compute full path to object file directory for this target.
-  std::string dir =
-    cmStrCat(gt->LocalGenerator->GetCurrentBinaryDirectory(), '/',
-             gt->LocalGenerator->GetTargetDirectory(gt), '/');
+  std::string dir = cmStrCat(gt->GetSupportDirectory(), '/');
   gt->ObjectDirectory = dir;
 }
 
@@ -101,11 +99,14 @@
 
   /* check if the toolset changed from last generate */
   if (cmNonempty(prevTool) && !cmSystemTools::ComparePath(gbuild, *prevTool)) {
-    std::string const& e = cmStrCat(
-      "toolset build tool: ", gbuild, '\n',
-      "Does not match the previously used build tool: ", *prevTool, '\n',
-      "Either remove the CMakeCache.txt file and CMakeFiles "
-      "directory or choose a different binary directory.");
+    std::string const& e =
+      cmStrCat("toolset build tool: ", gbuild,
+               "\n"
+               "Does not match the previously used build tool: ",
+               *prevTool,
+               "\n"
+               "Either remove the CMakeCache.txt file and CMakeFiles "
+               "directory or choose a different binary directory.");
     mf->IssueMessage(MessageType::FATAL_ERROR, e);
     return false;
   }
@@ -377,7 +378,7 @@
 
     // create target build file
     std::string name = cmStrCat(target->GetName(), ".tgt", FILE_EXTENSION);
-    std::string fname = cmStrCat(rootBinaryDir, "/", name);
+    std::string fname = cmStrCat(rootBinaryDir, '/', name);
     cmGeneratedFileStream fbld(fname);
     fbld.SetCopyIfDifferent(true);
     this->WriteFileHeader(fbld);
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 2b37abe..b443d26 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -381,7 +381,6 @@
       std::string cmd = command; // NOLINT(*)
 #ifdef _WIN32
       if (cmd.empty())
-        // TODO Shouldn't an empty command be handled by ninja?
         cmd = "cmd.exe /c";
 #endif
       vars["COMMAND"] = std::move(cmd);
@@ -414,20 +413,30 @@
 
 void cmGlobalNinjaGenerator::AddMacOSXContentRule()
 {
-  cmNinjaRule rule("COPY_OSX_CONTENT");
-  rule.Command = cmStrCat(this->CMakeCmd(), " -E copy $in $out");
-  rule.Description = "Copying OS X Content $out";
-  rule.Comment = "Rule for copying OS X bundle content file.";
-  this->AddRule(rule);
+  {
+    cmNinjaRule rule("COPY_OSX_CONTENT_FILE");
+    rule.Command = cmStrCat(this->CMakeCmd(), " -E copy $in $out");
+    rule.Description = "Copying OS X Content $out";
+    rule.Comment = "Rule for copying OS X bundle content file, with style.";
+    this->AddRule(rule);
+  }
+  {
+    cmNinjaRule rule("COPY_OSX_CONTENT_DIR");
+    rule.Command = cmStrCat(this->CMakeCmd(), " -E copy_directory $in $out");
+    rule.Description = "Copying OS X Content $out";
+    rule.Comment = "Rule for copying OS X bundle content dir, with style.";
+    this->AddRule(rule);
+  }
 }
-
 void cmGlobalNinjaGenerator::WriteMacOSXContentBuild(std::string input,
                                                      std::string output,
                                                      std::string const& config)
 {
   this->AddMacOSXContentRule();
   {
-    cmNinjaBuild build("COPY_OSX_CONTENT");
+    cmNinjaBuild build(cmSystemTools::FileIsDirectory(input)
+                         ? "COPY_OSX_CONTENT_DIR"
+                         : "COPY_OSX_CONTENT_FILE");
     build.Outputs.push_back(std::move(output));
     build.ExplicitDeps.push_back(std::move(input));
     this->WriteBuild(*this->GetImplFileStream(config), build);
@@ -512,6 +521,13 @@
   if (variablesShouldNotBeTrimmed.find(name) ==
       variablesShouldNotBeTrimmed.end()) {
     val = cmTrimWhitespace(value);
+    // If the value ends with `\n` and a `$` was left at the end of the trimmed
+    // value, put the newline back. Otherwise the next stanza is hidden by the
+    // trailing `$` escaping the newline.
+    if (cmSystemTools::StringEndsWith(value, "\n") &&
+        cmSystemTools::StringEndsWith(val, "$")) {
+      val += '\n';
+    }
   } else {
     val = value;
   }
@@ -1044,9 +1060,8 @@
   cmGeneratorTarget* gt) const
 {
   // Compute full path to object file directory for this target.
-  std::string dir = cmStrCat(gt->LocalGenerator->GetCurrentBinaryDirectory(),
-                             '/', gt->LocalGenerator->GetTargetDirectory(gt),
-                             '/', this->GetCMakeCFGIntDir(), '/');
+  std::string dir =
+    cmStrCat(gt->GetSupportDirectory(), '/', this->GetCMakeCFGIntDir(), '/');
   gt->ObjectDirectory = dir;
 }
 
@@ -1218,11 +1233,8 @@
     *this->CompileCommandsStream << ",\n";
   }
 
-  std::string sourceFileName = sourceFile;
-  if (!cmSystemTools::FileIsFullPath(sourceFileName)) {
-    sourceFileName = cmSystemTools::CollapseFullPath(
-      sourceFileName, this->GetCMakeInstance()->GetHomeOutputDirectory());
-  }
+  std::string sourceFileName =
+    cmSystemTools::CollapseFullPath(sourceFile, buildFileDir);
 
   /* clang-format off */
   *this->CompileCommandsStream << "{\n"
@@ -1233,7 +1245,9 @@
      << R"(  "file": ")"
      << cmGlobalGenerator::EscapeJSON(sourceFileName) << "\",\n"
      << R"(  "output": ")"
-     << cmGlobalGenerator::EscapeJSON(objPath) << "\"\n"
+     << cmGlobalGenerator::EscapeJSON(
+           cmSystemTools::CollapseFullPath(objPath, buildFileDir))
+           << "\"\n"
      << "}";
   /* clang-format on */
 }
@@ -1241,7 +1255,7 @@
 void cmGlobalNinjaGenerator::CloseCompileCommandsStream()
 {
   if (this->CompileCommandsStream) {
-    *this->CompileCommandsStream << "\n]";
+    *this->CompileCommandsStream << "\n]\n";
     this->CompileCommandsStream.reset();
   }
 }
@@ -1792,7 +1806,7 @@
     build.Outputs.emplace_back(this->GetInstallParallelTargetName());
     for (auto const& mf : this->Makefiles) {
       build.ExplicitDeps.emplace_back(
-        this->ConvertToNinjaPath(cmStrCat(mf->GetCurrentBinaryDirectory(), "/",
+        this->ConvertToNinjaPath(cmStrCat(mf->GetCurrentBinaryDirectory(), '/',
                                           this->GetInstallLocalTargetName())));
     }
     WriteBuild(os, build);
@@ -2091,7 +2105,7 @@
         build.Variables["TARGETS"] = cmStrCat(
           this->BuildAlias(
             this->NinjaOutputPath(GetByproductsForCleanTargetName()), config),
-          " ", this->NinjaOutputPath(GetByproductsForCleanTargetName()));
+          ' ', this->NinjaOutputPath(GetByproductsForCleanTargetName()));
       }
       build.ExplicitDeps.clear();
       if (additionalFiles) {
@@ -2210,8 +2224,8 @@
   {
     cmNinjaRule rule("START_INSTRUMENT");
     rule.Command = cmStrCat(
-      "\"", cmSystemTools::GetCTestCommand(), "\" --start-instrumentation \"",
-      this->GetCMakeInstance()->GetHomeOutputDirectory(), "\"");
+      '"', cmSystemTools::GetCTestCommand(), "\" --start-instrumentation \"",
+      this->GetCMakeInstance()->GetHomeOutputDirectory(), '"');
     /*
      * On Unix systems, Ninja will prefix the command with `/bin/sh -c`.
      * Use exec so that Ninja is the parent process of the command.
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index db23fa6..6ec64a4 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -81,9 +81,7 @@
   cmGeneratorTarget* gt) const
 {
   // Compute full path to object file directory for this target.
-  std::string dir =
-    cmStrCat(gt->LocalGenerator->GetCurrentBinaryDirectory(), '/',
-             gt->LocalGenerator->GetTargetDirectory(gt), '/');
+  std::string dir = cmStrCat(gt->GetSupportDirectory(), '/');
   gt->ObjectDirectory = dir;
 }
 
@@ -801,19 +799,15 @@
   // Loop over all targets in all local generators.
   for (auto const& lg : this->LocalGenerators) {
     for (auto const& gt : lg->GetGeneratorTargets()) {
-      cmLocalGenerator* tlg = gt->GetLocalGenerator();
-
       if (!gt->IsInBuildSystem() || this->IsExcluded(lg.get(), gt.get())) {
         continue;
       }
 
       cmStateSnapshot csnp = lg->GetStateSnapshot();
-      cmStateSnapshot tsnp = tlg->GetStateSnapshot();
 
-      // Consider the directory containing the target and all its
-      // parents until something excludes the target.
-      for (; csnp.IsValid() && !this->IsExcluded(csnp, tsnp);
-           csnp = csnp.GetBuildsystemDirectoryParent()) {
+      // Consider the directory containing the target and all its parents.
+      // An excluded directory may contains non-excluded targets.
+      for (; csnp.IsValid(); csnp = csnp.GetBuildsystemDirectoryParent()) {
         // This local generator includes the target.
         std::set<cmGeneratorTarget const*>& targetSet =
           this->DirectoryTargetsMap[csnp];
@@ -854,7 +848,9 @@
   std::set<cmGeneratorTarget const*> emitted;
   for (cmGeneratorTarget const* target :
        this->DirectoryTargetsMap[lg.GetStateSnapshot()]) {
-    count += this->CountProgressMarksInTarget(target, emitted);
+    if (!this->IsExcluded(&lg, target)) {
+      count += this->CountProgressMarksInTarget(target, emitted);
+    }
   }
   return count;
 }
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 688fbd7..1a21b06 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -297,8 +297,10 @@
                    this->GetPlatformToolsetString(),
                    ",version=", this->GeneratorToolsetVersion,
                    "\n"
-                   "has multiple matches installed at\n",
-                   "  ", auxProps, "\n",
+                   "has multiple matches installed at\n"
+                   "  ",
+                   auxProps,
+                   "\n"
                    "The toolset and version specification must resolve \n"
                    "to a single installed toolset"));
 
@@ -476,9 +478,7 @@
     if (!this->InitializeWindowsStore(mf)) {
       return false;
     }
-  } else if (this->SystemName == "WindowsKernelModeDriver"_s &&
-             cmExperimental::HasSupportEnabled(
-               *mf, cmExperimental::Feature::WindowsKernelModeDriver)) {
+  } else if (this->SystemName == "WindowsKernelModeDriver"_s) {
     this->SystemIsWindowsKernelModeDriver = true;
     if (!this->InitializeWindowsKernelModeDriver(mf)) {
       return false;
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index b1c7a24..03d4577 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -619,13 +619,18 @@
     "\t<Configurations>\n"
     ;
   /* clang-format on */
+  std::string intDirPrefix =
+    target->GetLocalGenerator()->MaybeRelativeToCurBinDir(
+      cmStrCat(target->GetSupportDirectory(), '\\'));
   for (std::string const& i : configs) {
+    std::string intDir = cmStrCat(intDirPrefix, i);
+
     /* clang-format off */
     fout <<
       "\t\t<Configuration\n"
       "\t\t\tName=\"" << i << "|Win32\"\n"
       "\t\t\tOutputDirectory=\"" << i << "\"\n"
-      "\t\t\tIntermediateDirectory=\"" << pname << ".dir\\" << i << "\"\n"
+      "\t\t\tIntermediateDirectory=\"" << intDir << "\"\n"
       "\t\t\tConfigurationType=\"10\"\n"
       "\t\t\tUseOfMFC=\"0\"\n"
       "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"FALSE\"\n"
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index c66c03a..c905a4e 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -226,17 +226,7 @@
   cmGeneratorTarget* gt) const
 {
   std::string dir =
-    cmStrCat(gt->LocalGenerator->GetCurrentBinaryDirectory(), '/');
-  std::string tgtDir = gt->LocalGenerator->GetTargetDirectory(gt);
-  if (!tgtDir.empty()) {
-    dir += tgtDir;
-    dir += '/';
-  }
-  char const* cd = this->GetCMakeCFGIntDir();
-  if (cd && *cd) {
-    dir += cd;
-    dir += '/';
-  }
+    cmStrCat(gt->GetSupportDirectory(), '/', this->GetCMakeCFGIntDir(), '/');
   gt->ObjectDirectory = dir;
 }
 
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 2e0dcca..314349a 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -14,6 +14,7 @@
 
 #include <cm/memory>
 #include <cm/optional>
+#include <cm/string_view>
 #include <cmext/algorithm>
 #include <cmext/string_view>
 
@@ -294,6 +295,40 @@
   return true;
 }
 
+std::string cmGlobalXCodeGenerator::GetAppleSpecificPlatformName()
+{
+  std::string sdkRoot =
+    this->GetCMakeInstance()->GetState()->GetCacheEntryValue(
+      "CMAKE_OSX_SYSROOT");
+  sdkRoot = cmSystemTools::LowerCase(sdkRoot);
+
+  struct SdkDatabaseEntry
+  {
+    cm::string_view Name;
+    cm::string_view AppleName;
+  };
+
+  std::array<SdkDatabaseEntry, 6> const sdkDatabase{ {
+    { "appletvos"_s, "tvOS"_s },
+    { "appletvsimulator"_s, "tvOS Simulator"_s },
+    { "iphoneos"_s, "iOS"_s },
+    { "iphonesimulator"_s, "iOS Simulator"_s },
+    { "watchos"_s, "watchOS"_s },
+    { "watchsimulator"_s, "watchOS Simulator"_s },
+  } };
+
+  cm::string_view platformName = "MacOS"_s;
+  for (SdkDatabaseEntry const& entry : sdkDatabase) {
+    if (cmHasPrefix(sdkRoot, entry.Name) ||
+        sdkRoot.find(cmStrCat('/', entry.Name)) != std::string::npos) {
+      platformName = entry.AppleName;
+      break;
+    }
+  }
+
+  return std::string(platformName);
+}
+
 std::string const& cmGlobalXCodeGenerator::GetXcodeBuildCommand()
 {
   if (!this->XcodeBuildCommandInitialized) {
@@ -473,10 +508,15 @@
   bool ret = false;
 
 #ifdef HAVE_APPLICATION_SERVICES
-  std::string url = cmStrCat(bindir, '/', projectName, ".xcodeproj");
+  // If an external tool created a workspace then open it instead.
+  std::string url = cmStrCat(bindir, '/', projectName, ".xcworkspace");
+  bool const isWorkspace = cmSystemTools::FileIsDirectory(url);
+  if (!isWorkspace) {
+    url = cmStrCat(bindir, '/', projectName, ".xcodeproj");
+  }
 
   if (dryRun) {
-    return cmSystemTools::FileExists(url, false);
+    return cmSystemTools::FileIsDirectory(url);
   }
 
   CFStringRef cfStr = CFStringCreateWithCString(
@@ -508,48 +548,101 @@
   int jobs, bool /*verbose*/, cmBuildOptions const& /*buildOptions*/,
   std::vector<std::string> const& makeOptions)
 {
-  GeneratedMakeCommand makeCommand;
-  // now build the test
-  makeCommand.Add(
-    this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
+  std::string const xcodebuild =
+    this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand());
 
-  if (!projectName.empty()) {
-    makeCommand.Add("-project");
-    std::string projectArg = cmStrCat(projectName, ".xcodeproj");
-    makeCommand.Add(projectArg);
+  // Note that projectName can be empty, such as from a command like this one:
+  //   ctest --build-and-test . build --build-generator Xcode
+  // If projectName is empty, then isWorkspace set further below will always
+  // be false because workspacePath will never point to a valid workspace file.
+  // And if projectName is empty, we don't add any -workspace or -project
+  // option to the xcodebuild command line because we don't know what to put
+  // after either option. For that scenario, we rely on xcodebuild finding
+  // exactly one .xcodeproj file in the working directory.
+
+  std::string const workspacePath = cmStrCat(projectName, ".xcworkspace");
+  std::string const projectPath = cmStrCat(projectName, ".xcodeproj");
+
+  // If an external tool created a workspace then build it instead.
+  bool const isWorkspace = cmSystemTools::FileIsDirectory(workspacePath);
+
+  std::string const targetFlag = isWorkspace ? "-scheme" : "-target";
+
+  std::vector<std::string> requiredArgs;
+
+  if (isWorkspace) {
+    requiredArgs.insert(requiredArgs.end(), { "-workspace", workspacePath });
+  } else if (!projectName.empty()) {
+    requiredArgs.insert(requiredArgs.end(), { "-project", projectPath });
   }
-  if (cm::contains(targetNames, "clean")) {
-    makeCommand.Add("clean");
-    makeCommand.Add("-target", "ALL_BUILD");
+
+  bool const isCleanBuild = cm::contains(targetNames, "clean");
+  bool const isTargetEmpty = targetNames.empty() ||
+    ((targetNames.size() == 1) && targetNames.front().empty());
+
+  if (isCleanBuild) {
+    requiredArgs.push_back("clean");
   } else {
-    makeCommand.Add("build");
-    if (targetNames.empty() ||
-        ((targetNames.size() == 1) && targetNames.front().empty())) {
-      makeCommand.Add("-target", "ALL_BUILD");
-    } else {
-      for (auto const& tname : targetNames) {
-        if (!tname.empty()) {
-          makeCommand.Add("-target", tname);
-        }
-      }
-    }
+    requiredArgs.push_back("build");
+  }
+
+  requiredArgs.insert(requiredArgs.end(),
+                      { "-configuration", config.empty() ? "Debug" : config });
+
+  if (isWorkspace) {
+    requiredArgs.insert(
+      requiredArgs.end(),
+      { "-destination",
+        cmStrCat("generic/platform=", this->GetAppleSpecificPlatformName()) });
   }
 
   if ((this->XcodeBuildSystem >= BuildSystem::Twelve) ||
       (jobs != cmake::NO_BUILD_PARALLEL_LEVEL)) {
-    makeCommand.Add("-parallelizeTargets");
+    requiredArgs.push_back("-parallelizeTargets");
   }
-  makeCommand.Add("-configuration", (config.empty() ? "Debug" : config));
 
   if ((jobs != cmake::NO_BUILD_PARALLEL_LEVEL) &&
       (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL)) {
-    makeCommand.Add("-jobs", std::to_string(jobs));
+    requiredArgs.insert(requiredArgs.end(), { "-jobs", std::to_string(jobs) });
   }
 
   if (this->XcodeVersion >= 70) {
-    makeCommand.Add("-hideShellScriptEnvironment");
+    requiredArgs.push_back("-hideShellScriptEnvironment");
   }
-  makeCommand.Add(makeOptions.begin(), makeOptions.end());
+
+  requiredArgs.insert(requiredArgs.end(), makeOptions.begin(),
+                      makeOptions.end());
+
+  if (isWorkspace && !isCleanBuild && targetNames.size() > 1) {
+    // For workspaces we need a separate command for each target,
+    // because xcodebuild can pass only one -scheme arg
+    std::vector<GeneratedMakeCommand> makeCommands;
+    for (auto const& target : targetNames) {
+      if (target.empty()) {
+        continue;
+      }
+      GeneratedMakeCommand makeCommand;
+      makeCommand.Add(xcodebuild);
+      makeCommand.Add(requiredArgs.cbegin(), requiredArgs.cend());
+      makeCommand.Add(targetFlag, target);
+      makeCommands.emplace_back(std::move(makeCommand));
+    }
+    return makeCommands;
+  }
+
+  if (isTargetEmpty || isCleanBuild) {
+    requiredArgs.insert(requiredArgs.end(), { targetFlag, "ALL_BUILD" });
+  } else {
+    for (auto const& target : targetNames) {
+      if (target.empty()) {
+        continue;
+      }
+      requiredArgs.insert(requiredArgs.end(), { targetFlag, target });
+    }
+  }
+  GeneratedMakeCommand makeCommand;
+  makeCommand.Add(xcodebuild);
+  makeCommand.Add(requiredArgs.cbegin(), requiredArgs.cend());
   return { std::move(makeCommand) };
 }
 
@@ -850,7 +943,7 @@
   return ptr;
 }
 
-cmXCodeObject* cmGlobalXCodeGenerator::CreateString(std::string const& s)
+cmXCodeObject* cmGlobalXCodeGenerator::CreateString(cm::string_view s)
 {
   cmXCodeObject* obj = this->CreateObject(cmXCodeObject::STRING);
   obj->SetString(s);
@@ -1700,12 +1793,10 @@
   }
 
   // Allow empty source file list for iOS Sticker packs
-  if (char const* productType = GetTargetProductType(gtgt)) {
-    if (strcmp(productType,
-               "com.apple.product-type.app-extension.messages-sticker-pack") ==
-        0) {
-      return;
-    }
+  cm::string_view productType = this->GetTargetProductType(gtgt);
+  if (productType ==
+      "com.apple.product-type.app-extension.messages-sticker-pack"_s) {
+    return;
   }
 
   // Add an empty source file to the target that compiles with the
@@ -1817,9 +1908,37 @@
     // create prelink phase
     preLinkPhase =
       this->CreateRunScriptBuildPhase("CMake PreLink Rules", gtgt, prelink);
+
+    std::vector<std::string> depends;
+    if (gtgt->IsBundleOnApple()) {
+      // In Xcode 16+ the POST_BUILD phase needs explicit dependencies to
+      // ensure it runs after certain bundle files are generated.
+      depends = {
+        "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/"
+        "Contents/Resources/DWARF/${PRODUCT_NAME}",
+        "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/"
+        "Contents/Info.plist",
+        "$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
+        "$(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)",
+      };
+      if (resourceBuildPhase) {
+        auto resourceFiles = resourceBuildPhase->GetAttribute("files");
+        for (auto xsf : resourceFiles->GetObjectList()) {
+          auto fileRef = xsf->GetAttribute("fileRef");
+          auto fileObj = fileRef->GetObject();
+          auto path = fileObj->GetAttribute("path");
+          auto fileName = cmSystemTools::GetFilenameName(path->GetString());
+          if (cmSystemTools::GetFilenameLastExtension(fileName) == ".plist") {
+            depends.push_back(
+              "$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/" +
+              fileName);
+          }
+        }
+      }
+    }
     // create postbuild phase
     postBuildPhase = this->CreateRunScriptBuildPhase("CMake PostBuild Rules",
-                                                     gtgt, postbuild);
+                                                     gtgt, postbuild, depends);
   } else {
     std::vector<cmSourceFile*> classes;
     if (!gtgt->GetConfigCommonSourceFilesForXcode(classes)) {
@@ -2033,7 +2152,8 @@
 
 cmXCodeObject* cmGlobalXCodeGenerator::CreateRunScriptBuildPhase(
   std::string const& name, cmGeneratorTarget const* gt,
-  std::vector<cmCustomCommand> const& commands)
+  std::vector<cmCustomCommand> const& commands,
+  std::vector<std::string> const& depends)
 {
   if (commands.empty()) {
     return nullptr;
@@ -2069,6 +2189,13 @@
   buildPhase->AddAttribute("shellScript", this->CreateString(shellScript));
   buildPhase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
   {
+    cmXCodeObject* inputPaths = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+    for (std::string const& s : depends) {
+      inputPaths->AddUniqueObject(this->CreateString(s));
+    }
+    buildPhase->AddAttribute("inputPaths", inputPaths);
+  }
+  {
     cmXCodeObject* outputPaths =
       this->CreateObject(cmXCodeObject::OBJECT_LIST);
     for (std::string const& o : allConfigOutputs) {
@@ -2228,7 +2355,7 @@
   cdir = cmSystemTools::ConvertToOutputPath(cdir);
   std::string makecmd = cmStrCat(
     "make -C ", cdir, " -f ", cmSystemTools::ConvertToOutputPath(makefile),
-    "$CONFIGURATION", " OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\") all");
+    "$CONFIGURATION OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\") all");
   buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
   buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
 }
@@ -2517,7 +2644,7 @@
           this->CurrentLocalGenerator->IssueMessage(
             MessageType::AUTHOR_WARNING,
             cmStrCat("Unknown Swift_COMPILATION_MODE on target '",
-                     gtgt->GetName(), "'"));
+                     gtgt->GetName(), '\''));
           break;
       }
     }
@@ -2687,16 +2814,20 @@
     case cmStateEnums::MODULE_LIBRARY: {
       buildSettings->AddAttribute("LIBRARY_STYLE",
                                   this->CreateString("BUNDLE"));
+      // Add the flags to create a module library (bundle).
+      std::string createFlags = this->LookupFlags(
+        "CMAKE_SHARED_MODULE_CREATE_", llang, "_FLAGS", gtgt);
+      if (this->GetTargetProductType(gtgt) !=
+          "com.apple.product-type.app-extension"_s) {
+        // Xcode passes -bundle automatically.
+        cmSystemTools::ReplaceString(createFlags, "-bundle", "");
+      }
+      createFlags = cmTrimWhitespace(createFlags);
+      if (!createFlags.empty()) {
+        extraLinkOptions += ' ';
+        extraLinkOptions += createFlags;
+      }
       if (gtgt->IsCFBundleOnApple()) {
-        // It turns out that a BUNDLE is basically the same
-        // in many ways as an application bundle, as far as
-        // link flags go
-        std::string createFlags = this->LookupFlags(
-          "CMAKE_SHARED_MODULE_CREATE_", llang, "_FLAGS", gtgt, "-bundle");
-        if (!createFlags.empty()) {
-          extraLinkOptions += ' ';
-          extraLinkOptions += createFlags;
-        }
         cmValue ext = gtgt->GetProperty("BUNDLE_EXTENSION");
         if (ext) {
           buildSettings->AddAttribute("WRAPPER_EXTENSION",
@@ -2716,13 +2847,6 @@
                                     this->CreateString("mh_bundle"));
         buildSettings->AddAttribute("GCC_DYNAMIC_NO_PIC",
                                     this->CreateString("NO"));
-        // Add the flags to create an executable.
-        std::string createFlags =
-          this->LookupFlags("CMAKE_", llang, "_LINK_FLAGS", gtgt, "");
-        if (!createFlags.empty()) {
-          extraLinkOptions += ' ';
-          extraLinkOptions += createFlags;
-        }
       }
       break;
     }
@@ -2747,9 +2871,11 @@
                                     this->CreateString(plist));
       } else {
         // Add the flags to create a shared library.
-        std::string createFlags =
-          this->LookupFlags("CMAKE_SHARED_LIBRARY_CREATE_", llang, "_FLAGS",
-                            gtgt, "-dynamiclib");
+        std::string createFlags = this->LookupFlags(
+          "CMAKE_SHARED_LIBRARY_CREATE_", llang, "_FLAGS", gtgt);
+        // Xcode passes -dynamiclib automatically.
+        cmSystemTools::ReplaceString(createFlags, "-dynamiclib", "");
+        createFlags = cmTrimWhitespace(createFlags);
         if (!createFlags.empty()) {
           extraLinkOptions += ' ';
           extraLinkOptions += createFlags;
@@ -2769,7 +2895,7 @@
     case cmStateEnums::EXECUTABLE: {
       // Add the flags to create an executable.
       std::string createFlags =
-        this->LookupFlags("CMAKE_", llang, "_LINK_FLAGS", gtgt, "");
+        this->LookupFlags("CMAKE_", llang, "_LINK_FLAGS", gtgt);
       if (!createFlags.empty()) {
         extraLinkOptions += ' ';
         extraLinkOptions += createFlags;
@@ -3146,7 +3272,7 @@
 
   cmXCodeObject* target = this->CreateObject(
     cmXCodeObject::PBXAggregateTarget,
-    cmStrCat("PBXAggregateTarget:", gtgt->GetName(), ":", targetBinaryPath));
+    cmStrCat("PBXAggregateTarget:", gtgt->GetName(), ':', targetBinaryPath));
   target->SetComment(gtgt->GetName());
   cmXCodeObject* buildPhases = this->CreateObject(cmXCodeObject::OBJECT_LIST);
   std::vector<cmXCodeObject*> emptyContentVector;
@@ -3328,40 +3454,40 @@
   return nullptr;
 }
 
-char const* cmGlobalXCodeGenerator::GetTargetProductType(
+cm::string_view cmGlobalXCodeGenerator::GetTargetProductType(
   cmGeneratorTarget* target)
 {
   if (cmValue e = target->GetProperty("XCODE_PRODUCT_TYPE")) {
-    return e->c_str();
+    return cm::string_view(*e);
   }
 
   switch (target->GetType()) {
     case cmStateEnums::OBJECT_LIBRARY:
-      return "com.apple.product-type.library.static";
+      return "com.apple.product-type.library.static"_s;
     case cmStateEnums::STATIC_LIBRARY:
-      return (target->GetPropertyAsBool("FRAMEWORK")
-                ? "com.apple.product-type.framework"
-                : "com.apple.product-type.library.static");
+      return target->GetPropertyAsBool("FRAMEWORK")
+        ? "com.apple.product-type.framework"_s
+        : "com.apple.product-type.library.static"_s;
     case cmStateEnums::MODULE_LIBRARY:
       if (target->IsXCTestOnApple()) {
-        return "com.apple.product-type.bundle.unit-test";
+        return "com.apple.product-type.bundle.unit-test"_s;
       } else if (target->IsCFBundleOnApple()) {
-        return "com.apple.product-type.bundle";
+        return "com.apple.product-type.bundle"_s;
       } else {
-        return "com.apple.product-type.tool";
+        return "com.apple.product-type.tool"_s;
       }
     case cmStateEnums::SHARED_LIBRARY:
-      return (target->GetPropertyAsBool("FRAMEWORK")
-                ? "com.apple.product-type.framework"
-                : "com.apple.product-type.library.dynamic");
+      return target->GetPropertyAsBool("FRAMEWORK")
+        ? "com.apple.product-type.framework"_s
+        : "com.apple.product-type.library.dynamic"_s;
     case cmStateEnums::EXECUTABLE:
-      return (target->GetPropertyAsBool("MACOSX_BUNDLE")
-                ? "com.apple.product-type.application"
-                : "com.apple.product-type.tool");
+      return target->GetPropertyAsBool("MACOSX_BUNDLE")
+        ? "com.apple.product-type.application"_s
+        : "com.apple.product-type.tool"_s;
     default:
       break;
   }
-  return nullptr;
+  return ""_s;
 }
 
 cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeTarget(
@@ -3376,7 +3502,7 @@
 
   cmXCodeObject* target = this->CreateObject(
     cmXCodeObject::PBXNativeTarget,
-    cmStrCat("PBXNativeTarget:", gtgt->GetName(), ":", targetBinaryPath));
+    cmStrCat("PBXNativeTarget:", gtgt->GetName(), ':', targetBinaryPath));
 
   target->AddAttribute("buildPhases", buildPhases);
   cmXCodeObject* buildRules = this->CreateObject(cmXCodeObject::OBJECT_LIST);
@@ -3404,7 +3530,8 @@
   fileRef->SetComment(gtgt->GetName());
   target->AddAttribute("productReference",
                        this->CreateObjectReference(fileRef));
-  if (char const* productType = this->GetTargetProductType(gtgt)) {
+  cm::string_view productType = this->GetTargetProductType(gtgt);
+  if (!productType.empty()) {
     target->AddAttribute("productType", this->CreateString(productType));
   }
   target->SetTarget(gtgt);
@@ -5200,21 +5327,19 @@
 
 std::string cmGlobalXCodeGenerator::LookupFlags(
   std::string const& varNamePrefix, std::string const& varNameLang,
-  std::string const& varNameSuffix, cmGeneratorTarget const* gt,
-  std::string const& default_flags)
+  std::string const& varNameSuffix, cmGeneratorTarget const* gt)
 {
+  std::string flags;
   if (!varNameLang.empty()) {
     std::string varName = cmStrCat(varNamePrefix, varNameLang, varNameSuffix);
     if (cmValue varValue = this->CurrentMakefile->GetDefinition(varName)) {
       if (!varValue->empty()) {
-        std::string flags;
         this->CurrentLocalGenerator->AppendFlags(
           flags, *varValue, varName, gt, cmBuildStep::Link, varNameLang);
-        return flags;
       }
     }
   }
-  return default_flags;
+  return flags;
 }
 
 void cmGlobalXCodeGenerator::AppendDefines(BuildObjectListOrString& defs,
@@ -5308,9 +5433,7 @@
 std::string cmGlobalXCodeGenerator::ComputeInfoPListLocation(
   cmGeneratorTarget* target)
 {
-  std::string plist =
-    cmStrCat(target->GetLocalGenerator()->GetCurrentBinaryDirectory(),
-             "/CMakeFiles/", target->GetName(), ".dir/Info.plist");
+  std::string plist = cmStrCat(target->GetSupportDirectory(), "/Info.plist");
   return plist;
 }
 
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index f4451b3..a4dbde5 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -192,7 +192,7 @@
   cmXCodeObject* CreateObject(cmXCodeObject::PBXType ptype,
                               cm::string_view key = {});
   cmXCodeObject* CreateObject(cmXCodeObject::Type type);
-  cmXCodeObject* CreateString(std::string const& s);
+  cmXCodeObject* CreateString(cm::string_view s);
   cmXCodeObject* CreateObjectReference(cmXCodeObject*);
   cmXCodeObject* CreateFlatClone(cmXCodeObject*);
   cmXCodeObject* CreateXCodeTarget(cmGeneratorTarget* gtgt,
@@ -201,7 +201,7 @@
   void ForceLinkerLanguage(cmGeneratorTarget* gtgt);
   char const* GetTargetLinkFlagsVar(cmGeneratorTarget const* target) const;
   char const* GetTargetFileType(cmGeneratorTarget* target);
-  char const* GetTargetProductType(cmGeneratorTarget* target);
+  cm::string_view GetTargetProductType(cmGeneratorTarget* target);
   std::string AddConfigurations(cmXCodeObject* target,
                                 cmGeneratorTarget* gtgt);
   void AppendOrAddBuildSetting(cmXCodeObject* settings, char const* attr,
@@ -298,7 +298,8 @@
                                            cmCustomCommand const& cc);
   cmXCodeObject* CreateRunScriptBuildPhase(
     std::string const& name, cmGeneratorTarget const* gt,
-    std::vector<cmCustomCommand> const& commands);
+    std::vector<cmCustomCommand> const& commands,
+    std::vector<std::string> const& depends = {});
   std::string ConstructScript(cmCustomCommandGenerator const& ccg);
   void CreateReRunCMakeFile(cmLocalGenerator* root,
                             std::vector<cmLocalGenerator*> const& gens);
@@ -306,8 +307,7 @@
   std::string LookupFlags(std::string const& varNamePrefix,
                           std::string const& varNameLang,
                           std::string const& varNameSuffix,
-                          cmGeneratorTarget const* gt,
-                          std::string const& default_flags);
+                          cmGeneratorTarget const* gt);
 
   class Factory;
   class BuildObjectListOrString;
@@ -334,6 +334,7 @@
   BuildSystem XcodeBuildSystem = BuildSystem::One;
 
 private:
+  std::string GetAppleSpecificPlatformName();
   std::string const& GetXcodeBuildCommand();
   std::string FindXcodeBuildCommand();
   std::string XcodeBuildCommand;
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index ab27a92..c8c314c 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -107,6 +107,12 @@
         return true;
       }
 
+      if (func.Arguments().empty()) {
+        mf.GetCMakeInstance()->IssueMessage(
+          MessageType::AUTHOR_WARNING,
+          "ELSEIF called with no arguments, it will be skipped. ", elseifBT);
+      }
+
       if (this->HasRun) {
         this->IsBlocking = true;
       } else {
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index d4759da..0a39824 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -19,12 +19,15 @@
 {
   static std::map<std::string, cmPolicies::PolicyID> DeprecatedModules;
   if (DeprecatedModules.empty()) {
+    DeprecatedModules["CMakeDetermineVSServicePack"] = cmPolicies::CMP0196;
     DeprecatedModules["CMakeFindFrameworks"] = cmPolicies::CMP0173;
     DeprecatedModules["Dart"] = cmPolicies::CMP0145;
     DeprecatedModules["Documentation"] = cmPolicies::CMP0106;
     DeprecatedModules["FindBoost"] = cmPolicies::CMP0167;
+    DeprecatedModules["FindCABLE"] = cmPolicies::CMP0191;
     DeprecatedModules["FindCUDA"] = cmPolicies::CMP0146;
     DeprecatedModules["FindDart"] = cmPolicies::CMP0145;
+    DeprecatedModules["FindGCCXML"] = cmPolicies::CMP0188;
     DeprecatedModules["FindPythonInterp"] = cmPolicies::CMP0148;
     DeprecatedModules["FindPythonLibs"] = cmPolicies::CMP0148;
     DeprecatedModules["WriteCompilerDetectionHeader"] = cmPolicies::CMP0120;
@@ -94,7 +97,7 @@
             status.GetMakefile().IssueMessage(
               MessageType::AUTHOR_WARNING,
               cmStrCat(cmPolicies::GetPolicyWarning(ModulePolicy->second),
-                       "\n"));
+                       '\n'));
             CM_FALLTHROUGH;
           }
           case cmPolicies::OLD:
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index e0044c6..b1c083d 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -24,7 +24,6 @@
 #include "cmExecutionStatus.h"
 #include "cmExperimental.h"
 #include "cmExportSet.h"
-#include "cmFileSet.h"
 #include "cmGeneratorExpression.h"
 #include "cmGlobalGenerator.h"
 #include "cmInstallAndroidMKExportGenerator.h"
@@ -45,6 +44,7 @@
 #include "cmList.h"
 #include "cmMakefile.h"
 #include "cmMessageType.h"
+#include "cmPackageInfoArguments.h"
 #include "cmPolicies.h"
 #include "cmRange.h"
 #include "cmRuntimeDependencyArchive.h"
@@ -197,15 +197,15 @@
 }
 
 std::unique_ptr<cmInstallFileSetGenerator> CreateInstallFileSetGenerator(
-  Helper& helper, cmTarget& target, cmFileSet* fileSet,
-  std::string const& destination, cmInstallCommandArguments const& args)
+  Helper& helper, cmTarget& target, cmFileSetDestinations dests,
+  cmInstallCommandFileSetArguments const& args)
 {
   cmInstallGenerator::MessageLevel message =
     cmInstallGenerator::SelectMessageLevel(helper.Makefile);
   return cm::make_unique<cmInstallFileSetGenerator>(
-    target.GetName(), fileSet, destination, args.GetPermissions(),
-    args.GetConfigurations(), args.GetComponent(), message,
-    args.GetExcludeFromAll(), args.GetOptional(),
+    target.GetName(), args.GetFileSet(), std::move(dests),
+    args.GetPermissions(), args.GetConfigurations(), args.GetComponent(),
+    message, args.GetExcludeFromAll(), args.GetOptional(),
     helper.Makefile->GetBacktrace());
 }
 
@@ -808,7 +808,7 @@
         te->RuntimeGenerator = runtimeGenerator.get();
         te->ObjectsGenerator = objectGenerator.get();
         for (auto const& gen : fileSetGenerators) {
-          te->FileSetGenerators[gen->GetFileSet()] = gen.get();
+          te->FileSetGenerators[gen->GetFileSetName()] = gen.get();
         }
         te->CxxModuleBmiGenerator = cxxModuleBmiGenerator.get();
         target.AddInstallIncludeDirectories(
@@ -999,7 +999,7 @@
           if (!target.HasKnownObjectFileLocation(&reason)) {
             status.SetError(
               cmStrCat("TARGETS given OBJECT library \"", target.GetName(),
-                       "\" whose objects may not be installed", reason, "."));
+                       "\" whose objects may not be installed", reason, '.'));
             return false;
           }
 
@@ -1144,31 +1144,12 @@
 
     if (!namelinkOnly) {
       for (std::size_t i = 0; i < fileSetArgs.size(); i++) {
-        if (auto* fileSet = target.GetFileSet(fileSetArgs[i].GetFileSet())) {
-          cmList interfaceFileSetEntries{ target.GetSafeProperty(
-            cmTarget::GetInterfaceFileSetsPropertyName(fileSet->GetType())) };
-          if (std::find(interfaceFileSetEntries.begin(),
-                        interfaceFileSetEntries.end(),
-                        fileSetArgs[i].GetFileSet()) !=
-              interfaceFileSetEntries.end()) {
-            std::string destination;
-            if (fileSet->GetType() == "HEADERS"_s) {
-              destination = helper.GetIncludeDestination(&fileSetArgs[i]);
-            } else {
-              destination = fileSetArgs[i].GetDestination();
-              if (destination.empty()) {
-                status.SetError(cmStrCat(
-                  "TARGETS given no FILE_SET DESTINATION for target \"",
-                  target.GetName(), "\" file set \"", fileSet->GetName(),
-                  "\"."));
-                return false;
-              }
-            }
-            fileSetGenerators.push_back(CreateInstallFileSetGenerator(
-              helper, target, fileSet, destination, fileSetArgs[i]));
-            installsFileSet[i] = true;
-          }
-        }
+        cmFileSetDestinations dests;
+        dests.Headers = helper.GetIncludeDestination(&fileSetArgs[i]);
+        dests.CXXModules = fileSetArgs[i].GetDestination();
+        fileSetGenerators.push_back(CreateInstallFileSetGenerator(
+          helper, target, std::move(dests), fileSetArgs[i]));
+        installsFileSet[i] = true;
       }
     }
 
@@ -1604,7 +1585,8 @@
     if (gg->IsExportedTargetsFile(file)) {
       helper.Makefile->IssueMessage(
         MessageType::FATAL_ERROR,
-        cmStrCat("The file\n  ", file, '\n',
+        cmStrCat("The file\n  ", file,
+                 "\n"
                  "was generated by the export() command.  "
                  "It may not be installed with the install() command.  "
                  "Use the install(EXPORT) mechanism instead.  "
@@ -2165,26 +2147,12 @@
   // This is the PACKAGE_INFO mode.
   cmInstallCommandArguments ica(helper.DefaultComponentName, *helper.Makefile);
 
-  ArgumentParser::NonEmpty<std::string> pkg;
-  ArgumentParser::NonEmpty<std::string> appendix;
+  cmPackageInfoArguments arguments;
   ArgumentParser::NonEmpty<std::string> exportName;
-  bool lowerCase = false;
-  ArgumentParser::NonEmpty<std::string> version;
-  ArgumentParser::NonEmpty<std::string> versionCompat;
-  ArgumentParser::NonEmpty<std::string> versionSchema;
-  ArgumentParser::NonEmpty<std::vector<std::string>> defaultTargets;
-  ArgumentParser::NonEmpty<std::vector<std::string>> defaultConfigs;
   ArgumentParser::NonEmpty<std::string> cxxModulesDirectory;
 
-  ica.Bind("PACKAGE_INFO"_s, pkg);
+  arguments.Bind(ica);
   ica.Bind("EXPORT"_s, exportName);
-  ica.Bind("APPENDIX"_s, appendix);
-  ica.Bind("LOWER_CASE_FILE"_s, lowerCase);
-  ica.Bind("VERSION"_s, version);
-  ica.Bind("COMPAT_VERSION"_s, versionCompat);
-  ica.Bind("VERSION_SCHEMA"_s, versionSchema);
-  ica.Bind("DEFAULT_TARGETS"_s, defaultTargets);
-  ica.Bind("DEFAULT_CONFIGURATIONS"_s, defaultConfigs);
   // ica.Bind("CXX_MODULES_DIRECTORY"_s, cxxModulesDirectory); TODO?
 
   std::vector<std::string> unknownArgs;
@@ -2206,51 +2174,10 @@
     return false;
   }
 
-  if (version.empty()) {
-    if (!versionCompat.empty()) {
-      status.SetError("COMPAT_VERSION requires VERSION.");
-      return false;
-    }
-    if (!versionSchema.empty()) {
-      status.SetError("VERSION_SCHEMA requires VERSION.");
-      return false;
-    }
-  } else {
-    if (!appendix.empty()) {
-      status.SetError("APPENDIX and VERSION are mutually exclusive.");
-      return false;
-    }
-  }
-  if (!appendix.empty()) {
-    if (!defaultTargets.empty()) {
-      status.SetError("APPENDIX and DEFAULT_TARGETS are mutually exclusive.");
-      return false;
-    }
-    if (!defaultConfigs.empty()) {
-      status.SetError("APPENDIX and DEFAULT_CONFIGURATIONS "
-                      "are mutually exclusive.");
-      return false;
-    }
-  }
-
-  // Validate the package name.
-  if (!cmGeneratorExpression::IsValidTargetName(pkg) ||
-      pkg.find(':') != std::string::npos) {
-    status.SetError(
-      cmStrCat(args[0], " given invalid package name \"", pkg, "\"."));
+  if (!arguments.Check(status) || !arguments.SetMetadataFromProject(status)) {
     return false;
   }
 
-  // Construct the case-normalized package name and the file name.
-  std::string const pkgNameOnDisk =
-    (lowerCase ? cmSystemTools::LowerCase(pkg) : pkg);
-  std::string pkgFileName = [&]() -> std::string {
-    if (appendix.empty()) {
-      return cmStrCat(pkgNameOnDisk, ".cps");
-    }
-    return cmStrCat(pkgNameOnDisk, '-', appendix, ".cps");
-  }();
-
   // Get or construct the destination path.
   std::string dest = ica.GetDestination();
   if (dest.empty()) {
@@ -2258,7 +2185,7 @@
       dest = std::string{ "cps"_s };
     } else {
       dest = cmStrCat(helper.GetLibraryDestination(nullptr), "/cps/",
-                      pkgNameOnDisk);
+                      arguments.GetPackageDirName());
     }
   }
 
@@ -2273,10 +2200,8 @@
     cm::make_unique<cmInstallPackageInfoExportGenerator>(
       &exportSet, dest, ica.GetPermissions(), ica.GetConfigurations(),
       ica.GetComponent(), message, ica.GetExcludeFromAll(),
-      std::move(pkgFileName), std::move(pkg), std::move(version),
-      std::move(versionCompat), std::move(versionSchema),
-      std::move(defaultTargets), std::move(defaultConfigs),
-      std::move(cxxModulesDirectory), helper.Makefile->GetBacktrace()));
+      std::move(arguments), std::move(cxxModulesDirectory),
+      helper.Makefile->GetBacktrace()));
 
   return true;
 #else
diff --git a/Source/cmInstallCxxModuleBmiGenerator.cxx b/Source/cmInstallCxxModuleBmiGenerator.cxx
index 37d9ce5..5f7ea52 100644
--- a/Source/cmInstallCxxModuleBmiGenerator.cxx
+++ b/Source/cmInstallCxxModuleBmiGenerator.cxx
@@ -51,7 +51,7 @@
   if (config.empty()) {
     config_name = "noconfig";
   }
-  return cmStrCat(this->Target->GetSupportDirectory(),
+  return cmStrCat(this->Target->GetCMFSupportDirectory(),
                   "/install-cxx-module-bmi-", config_name, ".cmake");
 }
 
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 0eeebcf..a388d91 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -85,7 +85,7 @@
   cmMakefile const& mf = *this->LocalGenerator->GetMakefile();
   for (std::string& d : dirs) {
     if (!cmSystemTools::FileIsFullPath(d)) {
-      d = cmStrCat(mf.GetCurrentSourceDirectory(), "/", d);
+      d = cmStrCat(mf.GetCurrentSourceDirectory(), '/', d);
     }
   }
 
diff --git a/Source/cmInstallFileSetGenerator.cxx b/Source/cmInstallFileSetGenerator.cxx
index d40d262..7763f43 100644
--- a/Source/cmInstallFileSetGenerator.cxx
+++ b/Source/cmInstallFileSetGenerator.cxx
@@ -2,29 +2,39 @@
    file LICENSE.rst or https://cmake.org/licensing for details.  */
 #include "cmInstallFileSetGenerator.h"
 
+#include <algorithm>
 #include <map>
 #include <string>
 #include <utility>
 #include <vector>
 
+#include <cm/string_view>
+#include <cmext/string_view>
+
 #include "cmFileSet.h"
+#include "cmGenExContext.h"
 #include "cmGeneratorExpression.h"
+#include "cmGeneratorTarget.h"
 #include "cmGlobalGenerator.h"
 #include "cmInstallType.h"
+#include "cmList.h"
 #include "cmListFileCache.h"
 #include "cmLocalGenerator.h"
+#include "cmMessageType.h"
 #include "cmStringAlgorithms.h"
+#include "cmTarget.h"
 
 cmInstallFileSetGenerator::cmInstallFileSetGenerator(
-  std::string targetName, cmFileSet* fileSet, std::string const& dest,
+  std::string targetName, std::string fileSetName, cmFileSetDestinations dests,
   std::string file_permissions, std::vector<std::string> const& configurations,
   std::string const& component, MessageLevel message, bool exclude_from_all,
   bool optional, cmListFileBacktrace backtrace)
-  : cmInstallGenerator(dest, configurations, component, message,
+  : cmInstallGenerator("", configurations, component, message,
                        exclude_from_all, false, std::move(backtrace))
   , TargetName(std::move(targetName))
-  , FileSet(fileSet)
+  , FileSetName(std::move(fileSetName))
   , FilePermissions(std::move(file_permissions))
+  , FileSetDestinations(std::move(dests))
   , Optional(optional)
 {
   this->ActionsPerConfig = true;
@@ -44,6 +54,39 @@
       lg->GetGlobalGenerator()->FindGeneratorTarget(this->TargetName);
   }
 
+  auto const& target = *this->Target->Target;
+  this->FileSet = target.GetFileSet(this->FileSetName);
+
+  if (!this->FileSet) {
+    // No file set of the given name was ever provided for this target, nothing
+    // for this generator to do
+    return true;
+  }
+
+  cmList interfaceFileSetEntries{ target.GetSafeProperty(
+    cmTarget::GetInterfaceFileSetsPropertyName(this->FileSet->GetType())) };
+
+  if (std::find(interfaceFileSetEntries.begin(), interfaceFileSetEntries.end(),
+                this->FileSetName) != interfaceFileSetEntries.end()) {
+    if (this->FileSet->GetType() == "HEADERS"_s) {
+      this->Destination = this->FileSetDestinations.Headers;
+    } else {
+      this->Destination = this->FileSetDestinations.CXXModules;
+    }
+  } else {
+    // File set of the given name was provided but it's private, so give up
+    this->FileSet = nullptr;
+    return true;
+  }
+
+  if (this->Destination.empty()) {
+    lg->IssueMessage(MessageType::FATAL_ERROR,
+                     cmStrCat("File set \"", this->FileSetName,
+                              "\" installed by target \"", this->TargetName,
+                              "\" has no destination."));
+    return false;
+  }
+
   return true;
 }
 
@@ -57,6 +100,11 @@
 void cmInstallFileSetGenerator::GenerateScriptForConfig(
   std::ostream& os, std::string const& config, Indent indent)
 {
+
+  if (!this->FileSet) {
+    return;
+  }
+
   for (auto const& dirEntry : this->CalculateFilesPerDir(config)) {
     std::string destSub;
     if (!dirEntry.first.empty()) {
@@ -75,14 +123,16 @@
 {
   std::map<std::string, std::vector<std::string>> result;
 
+  cm::GenEx::Context context(this->LocalGenerator, config);
+
   auto dirCges = this->FileSet->CompileDirectoryEntries();
-  auto dirs = this->FileSet->EvaluateDirectoryEntries(
-    dirCges, this->LocalGenerator, config, this->Target);
+  auto dirs =
+    this->FileSet->EvaluateDirectoryEntries(dirCges, context, this->Target);
 
   auto fileCges = this->FileSet->CompileFileEntries();
   for (auto const& fileCge : fileCges) {
-    this->FileSet->EvaluateFileEntry(
-      dirs, result, fileCge, this->LocalGenerator, config, this->Target);
+    this->FileSet->EvaluateFileEntry(dirs, result, fileCge, context,
+                                     this->Target);
   }
 
   return result;
diff --git a/Source/cmInstallFileSetGenerator.h b/Source/cmInstallFileSetGenerator.h
index b13a5e0..ba30414 100644
--- a/Source/cmInstallFileSetGenerator.h
+++ b/Source/cmInstallFileSetGenerator.h
@@ -14,11 +14,17 @@
 class cmListFileBacktrace;
 class cmLocalGenerator;
 
+struct cmFileSetDestinations
+{
+  std::string Headers;
+  std::string CXXModules;
+};
+
 class cmInstallFileSetGenerator : public cmInstallGenerator
 {
 public:
-  cmInstallFileSetGenerator(std::string targetName, cmFileSet* fileSet,
-                            std::string const& dest,
+  cmInstallFileSetGenerator(std::string targetName, std::string fileSetName,
+                            cmFileSetDestinations dests,
                             std::string file_permissions,
                             std::vector<std::string> const& configurations,
                             std::string const& component, MessageLevel message,
@@ -31,7 +37,8 @@
   std::string GetDestination(std::string const& config) const;
   std::string GetDestination() const { return this->Destination; }
   bool GetOptional() const { return this->Optional; }
-  cmFileSet* GetFileSet() const { return this->FileSet; }
+  std::string GetFileSetName() const { return this->FileSetName; }
+  cmFileSet const* GetFileSet() const { return this->FileSet; };
   cmGeneratorTarget* GetTarget() const { return this->Target; }
 
 protected:
@@ -41,8 +48,10 @@
 private:
   std::string TargetName;
   cmLocalGenerator* LocalGenerator;
-  cmFileSet* const FileSet;
+  cmFileSet const* FileSet;
+  std::string const FileSetName;
   std::string const FilePermissions;
+  cmFileSetDestinations FileSetDestinations;
   bool const Optional;
   cmGeneratorTarget* Target;
 
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index 27f4b4f..572d192 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -93,7 +93,7 @@
                        TweakMethod const& tweak);
 
   // Information shared by most generator types.
-  std::string const Destination;
+  std::string Destination;
   std::string const Component;
   MessageLevel const Message;
   bool const ExcludeFromAll;
diff --git a/Source/cmInstallPackageInfoExportGenerator.cxx b/Source/cmInstallPackageInfoExportGenerator.cxx
index 756ef6a..55dcbd1 100644
--- a/Source/cmInstallPackageInfoExportGenerator.cxx
+++ b/Source/cmInstallPackageInfoExportGenerator.cxx
@@ -9,27 +9,23 @@
 #include "cmExportInstallFileGenerator.h"
 #include "cmExportInstallPackageInfoGenerator.h"
 #include "cmListFileCache.h"
+#include "cmPackageInfoArguments.h"
 
 class cmExportSet;
 
 cmInstallPackageInfoExportGenerator::cmInstallPackageInfoExportGenerator(
   cmExportSet* exportSet, std::string destination, std::string filePermissions,
   std::vector<std::string> const& configurations, std::string component,
-  MessageLevel message, bool excludeFromAll, std::string filename,
-  std::string packageName, std::string version, std::string versionCompat,
-  std::string versionSchema, std::vector<std::string> defaultTargets,
-  std::vector<std::string> defaultConfigurations,
+  MessageLevel message, bool excludeFromAll, cmPackageInfoArguments arguments,
   std::string cxxModulesDirectory, cmListFileBacktrace backtrace)
   : cmInstallExportGenerator(
       exportSet, std::move(destination), std::move(filePermissions),
       configurations, std::move(component), message, excludeFromAll,
-      std::move(filename), packageName + "::", std::move(cxxModulesDirectory),
-      std::move(backtrace))
+      arguments.GetPackageFileName(), arguments.GetNamespace(),
+      std::move(cxxModulesDirectory), std::move(backtrace))
 {
   this->EFGen = cm::make_unique<cmExportInstallPackageInfoGenerator>(
-    this, std::move(packageName), std::move(version), std::move(versionCompat),
-    std::move(versionSchema), std::move(defaultTargets),
-    std::move(defaultConfigurations));
+    this, std::move(arguments));
 }
 
 cmInstallPackageInfoExportGenerator::~cmInstallPackageInfoExportGenerator() =
diff --git a/Source/cmInstallPackageInfoExportGenerator.h b/Source/cmInstallPackageInfoExportGenerator.h
index a5413d9..0209f82 100644
--- a/Source/cmInstallPackageInfoExportGenerator.h
+++ b/Source/cmInstallPackageInfoExportGenerator.h
@@ -9,6 +9,7 @@
 
 class cmExportSet;
 class cmListFileBacktrace;
+class cmPackageInfoArguments;
 
 /** \class cmInstallPackageInfoGenerator
  * \brief Generate rules for creating CPS package info files.
@@ -20,11 +21,9 @@
     cmExportSet* exportSet, std::string destination,
     std::string filePermissions,
     std::vector<std::string> const& configurations, std::string component,
-    MessageLevel message, bool excludeFromAll, std::string filename,
-    std::string packageName, std::string version, std::string versionCompat,
-    std::string versionSchema, std::vector<std::string> defaultTargets,
-    std::vector<std::string> defaultConfigurations,
-    std::string cxxModulesDirectory, cmListFileBacktrace backtrace);
+    MessageLevel message, bool excludeFromAll,
+    cmPackageInfoArguments arguments, std::string cxxModulesDirectory,
+    cmListFileBacktrace backtrace);
   cmInstallPackageInfoExportGenerator(
     cmInstallPackageInfoExportGenerator const&) = delete;
   ~cmInstallPackageInfoExportGenerator() override;
diff --git a/Source/cmInstallScriptHandler.cxx b/Source/cmInstallScriptHandler.cxx
index 03fada0..7ae56a2 100644
--- a/Source/cmInstallScriptHandler.cxx
+++ b/Source/cmInstallScriptHandler.cxx
@@ -165,7 +165,7 @@
         cmStrCat("install_manifest_", md5.HashString(this->component), ".txt");
     }
   }
-  cmGeneratedFileStream fout(cmStrCat(this->binaryDir, "/", install_manifest));
+  cmGeneratedFileStream fout(cmStrCat(this->binaryDir, '/', install_manifest));
   fout.SetCopyIfDifferent(true);
   for (auto const& dir : this->directories) {
     auto local_manifest = cmStrCat(dir, "/install_local_manifest.txt");
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index bd3b700..b2a5f51 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -425,7 +425,7 @@
 {
   this->Target->GetTargetObjectNames(config, objects);
   for (std::string& o : objects) {
-    o = cmStrCat(computeInstallObjectDir(this->Target, config), "/", o);
+    o = cmStrCat(computeInstallObjectDir(this->Target, config), '/', o);
   }
 }
 
diff --git a/Source/cmInstrumentation.cxx b/Source/cmInstrumentation.cxx
index aba09d4..52461af 100644
--- a/Source/cmInstrumentation.cxx
+++ b/Source/cmInstrumentation.cxx
@@ -161,6 +161,16 @@
   auto query = cmInstrumentationQuery();
   query.ReadJSON(file, this->errorMsg, this->queries, this->hooks,
                  this->callbacks);
+  if (!this->errorMsg.empty()) {
+    cmSystemTools::Error(cmStrCat(
+      "Could not load instrumentation queries from ",
+      cmSystemTools::GetParentDirectory(file), ":\n", this->errorMsg));
+  }
+}
+
+bool cmInstrumentation::HasErrors() const
+{
+  return !this->errorMsg.empty();
 }
 
 void cmInstrumentation::WriteJSONQuery(
@@ -231,7 +241,7 @@
   std::string const& directory = cmStrCat(this->timingDirv1, "/data");
   std::string const& file_name =
     cmStrCat("index-", ComputeSuffixTime(), ".json");
-  std::string index_path = cmStrCat(directory, "/", file_name);
+  std::string index_path = cmStrCat(directory, '/', file_name);
   cmSystemTools::Touch(index_path, true);
 
   // Gather Snippets
@@ -289,7 +299,7 @@
 
   // Execute callbacks
   for (auto& cb : this->callbacks) {
-    cmSystemTools::RunSingleCommand(cmStrCat(cb, " \"", index_path, "\""),
+    cmSystemTools::RunSingleCommand(cmStrCat(cb, " \"", index_path, '"'),
                                     nullptr, nullptr, nullptr, nullptr,
                                     cmSystemTools::OUTPUT_PASSTHROUGH);
   }
@@ -301,7 +311,7 @@
 
   // Delete files
   for (auto const& f : index["snippets"]) {
-    cmSystemTools::RemoveFile(cmStrCat(directory, "/", f.asString()));
+    cmSystemTools::RemoveFile(cmStrCat(directory, '/', f.asString()));
   }
   cmSystemTools::RemoveFile(index_path);
 
@@ -390,9 +400,9 @@
   wbuilder["indentation"] = "\t";
   std::unique_ptr<Json::StreamWriter> JsonWriter =
     std::unique_ptr<Json::StreamWriter>(wbuilder.newStreamWriter());
-  std::string const& directory = cmStrCat(this->timingDirv1, "/", subdir);
+  std::string const& directory = cmStrCat(this->timingDirv1, '/', subdir);
   cmSystemTools::MakeDirectory(directory);
-  cmsys::ofstream ftmp(cmStrCat(directory, "/", file_name).c_str());
+  cmsys::ofstream ftmp(cmStrCat(directory, '/', file_name).c_str());
   JsonWriter->write(root, &ftmp);
   ftmp << "\n";
   ftmp.close();
@@ -535,7 +545,7 @@
         for (auto const& output : root["outputs"]) {
           root["outputSizes"].append(
             static_cast<Json::Value::UInt64>(cmSystemTools::FileLength(
-              cmStrCat(this->binaryDir, "/", output.asCString()))));
+              cmStrCat(this->binaryDir, '/', output.asCString()))));
         }
       }
     }
@@ -546,7 +556,7 @@
   // Write Json
   cmsys::SystemInformation& info = this->GetSystemInformation();
   std::string const& file_name = cmStrCat(
-    command_type, "-",
+    command_type, '-',
     this->ComputeSuffixHash(cmStrCat(command_str, info.GetProcessId())),
     this->ComputeSuffixTime(), ".json");
   this->WriteInstrumentationJson(root, "data", file_name);
diff --git a/Source/cmInstrumentation.h b/Source/cmInstrumentation.h
index 602ce06..46c04af 100644
--- a/Source/cmInstrumentation.h
+++ b/Source/cmInstrumentation.h
@@ -63,7 +63,7 @@
   int CollectTimingAfterBuild(int ppid);
   void AddHook(cmInstrumentationQuery::Hook hook);
   void AddQuery(cmInstrumentationQuery::Query query);
-  std::string errorMsg;
+  bool HasErrors() const;
   std::string const& GetCDashDir();
 
 private:
@@ -93,6 +93,7 @@
   std::vector<std::string> queryFiles;
   std::map<std::string, std::string> cdashSnippetsMap;
   Json::Value preTestStats;
+  std::string errorMsg;
   bool hasQuery = false;
   bool ranSystemChecks = false;
   bool ranOSCheck = false;
diff --git a/Source/cmInstrumentationCommand.cxx b/Source/cmInstrumentationCommand.cxx
index d638f30..696968a 100644
--- a/Source/cmInstrumentationCommand.cxx
+++ b/Source/cmInstrumentationCommand.cxx
@@ -30,7 +30,7 @@
                      int& version, cmExecutionStatus& status)
 {
   if (!std::all_of(versionString.begin(), versionString.end(), isCharDigit)) {
-    status.SetError(cmStrCat("given a non-integer ", key, "."));
+    status.SetError(cmStrCat("given a non-integer ", key, '.'));
     return false;
   }
   version = std::atoi(versionString.c_str());
@@ -118,7 +118,7 @@
     cmInstrumentationQuery::Query query;
     if (!queryParser(arg, query)) {
       status.SetError(
-        cmStrCat("given invalid argument to QUERIES \"", arg, "\""));
+        cmStrCat("given invalid argument to QUERIES \"", arg, '"'));
       return false;
     }
     queries.insert(query);
@@ -131,7 +131,7 @@
     cmInstrumentationQuery::Hook hook;
     if (!hookParser(arg, hook)) {
       status.SetError(
-        cmStrCat("given invalid argument to HOOKS \"", arg, "\""));
+        cmStrCat("given invalid argument to HOOKS \"", arg, '"'));
       return false;
     }
     hooks.insert(hook);
diff --git a/Source/cmInstrumentationQuery.cxx b/Source/cmInstrumentationQuery.cxx
index 88872f6..7bc27be 100644
--- a/Source/cmInstrumentationQuery.cxx
+++ b/Source/cmInstrumentationQuery.cxx
@@ -60,7 +60,7 @@
       }
     }
     state->AddErrorAtValue(
-      cmStrCat("Not a valid ", type, ": \"", value->asString(), "\""), value);
+      cmStrCat("Not a valid ", type, ": \"", value->asString(), '"'), value);
     return false;
   };
 }
diff --git a/Source/cmJSONHelpers.cxx b/Source/cmJSONHelpers.cxx
index a79e3ab..f0f3050 100644
--- a/Source/cmJSONHelpers.cxx
+++ b/Source/cmJSONHelpers.cxx
@@ -20,7 +20,7 @@
       state->AddErrorAtValue(cmStrCat("Expected ", type), value);
       return;
     }
-    std::string errMsg = cmStrCat("\"", state->key(), "\" expected ", type);
+    std::string errMsg = cmStrCat('"', state->key(), "\" expected ", type);
     if (value && value->isConvertibleTo(Json::ValueType::stringValue)) {
       errMsg = cmStrCat(errMsg, ", got: ", value->asString());
     }
@@ -52,6 +52,11 @@
   std::function<std::string(Json::Value const*, cmJSONState*)> const&
     nameGenerator)
 {
+#if defined(__GNUC__) && __GNUC__ >= 15
+#  define CM_GCC_diagnostic_push_Wmaybe_uninitialized
+#  pragma GCC diagnostic push
+#  pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
   return [nameGenerator](
            ObjectError errorType,
            Json::Value::Members const& extraFields) -> ErrorGenerator {
@@ -85,6 +90,10 @@
       }
     };
   };
+#ifdef CM_GCC_diagnostic_push_Wmaybe_uninitialized
+#  pragma GCC diagnostic pop
+#  undef CM_GCC_diagnostic_push_Wmaybe_uninitialized
+#endif
 }
 
 ErrorGenerator INVALID_OBJECT(ObjectError errorType,
@@ -105,7 +114,7 @@
         if (it->first.rfind("$vector_item_", 0) == 0) {
           continue;
         }
-        return cmStrCat("\"", it->first, "\"");